ql/errors.hpp File Reference


Detailed Description

Classes and functions for error handling.

#include <ql/qldefines.hpp>
#include <exception>
#include <string>

Include dependency graph for errors.hpp:

Include dependency graph

Namespaces

namespace  QuantLib

Defines

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

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

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


Define Documentation

#define QL_ASSERT condition,
description   ) 
 

Value:

if (!(condition)) \
    throw QuantLib::AssertionFailedError(\
        QuantLib::Error::where(__FILE__,__LINE__) +  description); \
else
throw an error if the given condition is not verified

#define QL_REQUIRE condition,
description   ) 
 

Value:

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

Examples:
DiscreteHedging.cpp, and swapvaluation.cpp.

#define QL_ENSURE condition,
description   ) 
 

Value:

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


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