46 #include "../Text/TextTools.h"
54 Exception(
"ParameterException: " + text + (param != 0 ?
"(" + param->getName() +
")" : string(
""))),
63 + (param->hasConstraint() ? param->getConstraint()->getDescription() :
"no constraint"), param),
64 badValue_(badValue) {}
71 Exception(
"ParameterNotFoundException: " + text + (!TextTools::
isEmpty(param) ?
"(" + param +
")" : string(
""))),
ConstraintException(const std::string &text, const Parameter *param, double badValue)
Build a new ConstraintException object.
virtual double getBadValue() const
Get the value that doesn't match the constraint.
Exception base class. Overload exception constructor (to control the exceptions mechanism)....
The parameter exception base class.
ParameterException(const std::string &text, const Parameter *param)
Build a new ParameterException object.
virtual const Parameter * getParameter() const
Get the parameter that threw the exception.
const Parameter * parameter_
const std::string parameter_
virtual std::string getParameter() const
Get the name of the parameter not found.
ParameterNotFoundException(const std::string &text, const std::string ¶m="")
Build a new ParameterNotFoundException object.
This class is designed to facilitate the manipulation of parameters.
bool isEmpty(const std::string &s)
Tell if a string is empty. A string is considered to be 'empty' if it is only made of white spaces.
std::string toString(T t)
General template method to convert to a string.