bpp-core  2.2.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:

Public Member Functions

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

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::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.

◆ ~ConstraintException()

virtual bpp::ConstraintException::~ConstraintException ( )
throw (
)
inlinevirtual

Definition at line 118 of file ParameterExceptions.h.

Member Function Documentation

◆ getBadValue()

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().

◆ getParameter()

const Parameter * ParameterException::getParameter ( ) const
virtualinherited

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_.

◆ what()

const char* bpp::Exception::what ( ) const
throw (
)
inlineinherited

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

Returns
The message passed to the exception hierarchy.

Definition at line 87 of file Exceptions.h.

References bpp::Exception::message_.

Member Data Documentation

◆ badValue_

double bpp::ConstraintException::badValue_
private

Definition at line 106 of file ParameterExceptions.h.

Referenced by getBadValue().

◆ message_

std::string bpp::Exception::message_
protectedinherited

Definition at line 61 of file Exceptions.h.

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


The documentation for this class was generated from the following files: