bpp-core  2.1.0
bpp::ConstraintException Class Reference

Exception thrown when a value do not match a given constraint. More...

#include <Bpp/Numeric/ParameterExceptions.h>

+ Inheritance diagram for bpp::ConstraintException:
+ Collaboration diagram for bpp::ConstraintException:

List of all members.

Public Member Functions

 ConstraintException (const std::string &text, const Parameter *param, double badValue)
 Build a new ConstraintException object.
virtual ~ConstraintException () throw ()
virtual double getBadValue () const
 Get the value that doesn't match the constraint.
virtual const ParametergetParameter () const
 Get the parameter that threw the exception.
const char * what () const throw ()
 Method to get the message of the exception (STL method redefinition).

Protected Attributes

std::string message_

Private Attributes

double badValue_

Detailed Description

Exception thrown when a value do not match a given constraint.

See also:
Constraint

Definition at line 102 of file ParameterExceptions.h.


Constructor & Destructor Documentation

ConstraintException::ConstraintException ( const std::string &  text,
const Parameter param,
double  badValue 
)

Build a new ConstraintException object.

Parameters:
textA message to be passed to the exception hierarchy.
paramA const pointer toward the parameter that threw the exception.
badValueThe value that doesn't match the constraint.

Definition at line 59 of file ParameterExceptions.cpp.

virtual bpp::ConstraintException::~ConstraintException ( ) throw () [inline, virtual]

Definition at line 118 of file ParameterExceptions.h.


Member Function Documentation

double ConstraintException::getBadValue ( ) const [virtual]

Get the value that doesn't match the constraint.

Returns:
The faulty value.

Definition at line 64 of file ParameterExceptions.cpp.

References badValue_.

Referenced by bpp::AutoParameter::setValue().

const Parameter * ParameterException::getParameter ( ) const [virtual, inherited]

Get the parameter that threw the exception.

Returns:
A const pointer toward the parameter.

Definition at line 55 of file ParameterExceptions.cpp.

References bpp::ParameterException::parameter_.

const char* bpp::Exception::what ( ) const throw () [inline, inherited]

Method to get the message of the exception (STL method redefinition).

Returns:
The message passed to the exception hierarchy.

Definition at line 86 of file Exceptions.h.

References bpp::Exception::message_.


Member Data Documentation

Definition at line 106 of file ParameterExceptions.h.

Referenced by getBadValue().

std::string bpp::Exception::message_ [protected, inherited]

Definition at line 60 of file Exceptions.h.

Referenced by bpp::Exception::what().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends