9 #include "../Text/TextTools.h" 17 Exception(
"ParameterException: " + text + (param != 0 ?
"(" + param->getName() +
")" : string(
""))),
26 + (param->hasConstraint() ? param->getConstraint()->getDescription() :
"no constraint"), param),
27 badValue_(badValue) {}
34 Exception(
"ParameterNotFoundException: " + text + (!TextTools::
isEmpty(param) ?
"(" + param +
")" : string(
""))),
ConstraintException(const std::string &text, const Parameter *param, double badValue)
Build a new ConstraintException object.
ParameterException(const std::string &text, const Parameter *param)
Build a new ParameterException object.
virtual const Parameter * parameter() const
Get the parameter that threw the exception.
const Parameter * parameter_
ParameterNotFoundException(const std::string &text, const std::string ¶m="")
Build a new ParameterNotFoundException object.
This class is designed to facilitate the manipulation of parameters.
virtual double getBadValue() const
Get the value that doesn't match the constraint.
virtual std::string parameter() const
Get the name of the parameter not found.
const std::string parameter_
Exception base class. Overload exception constructor (to control the exceptions mechanism). Destructor is already virtual (from std::exception)
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.
The parameter exception base class.