ql/errors.hpp File Reference


Detailed Description

Classes and functions for error handling.

#include <ql/qldefines.hpp>
#include <exception>
#include <string>
#include <boost/assert.hpp>
#include <boost/current_function.hpp>

Include dependency graph for errors.hpp:

Include dependency graph

Namespaces

namespace  QuantLib

Defines

#define QL_FAIL(message)   throw QuantLib::Error(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION,message)
 throw an error (possibly with file and line information)

#define QL_ASSERT(condition, message)
 throw an error if the given condition is not verified

#define QL_REQUIRE(condition, message)
 throw an error if the given pre-condition is not verified

#define QL_ENSURE(condition, message)
 throw an error if the given post-condition is not verified


Define Documentation

#define QL_ASSERT condition,
message   ) 
 

Value:

if (!(condition)) \ throw QuantLib::Error(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION,message); \ else
throw an error if the given condition is not verified

#define QL_REQUIRE condition,
message   ) 
 

Value:

if (!(condition)) \ throw QuantLib::Error(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION,message); \ else
throw an error if the given pre-condition is not verified

Examples:
DiscreteHedging.cpp, and swapvaluation.cpp.

#define QL_ENSURE condition,
message   ) 
 

Value:

if (!(condition)) \ throw QuantLib::Error(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION,message); \ else
throw an error if the given post-condition is not verified


QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen