13 #include "../Text/TextTools.h" 14 #include "../App/ApplicationTools.h" 20 string AutoParameter::CONSTRAINTS_AUTO =
"auto";
21 string AutoParameter::CONSTRAINTS_IGNORE =
"ignore";
22 string AutoParameter::CONSTRAINTS_KEEP =
"keep";
26 AutoParameter::AutoParameter(
const std::string& name,
double value, std::shared_ptr<ConstraintInterface> constraint) :
54 (*messageHandler_) <<
"Constraint match at parameter ";
55 (*messageHandler_) <<
name_;
56 (*messageHandler_) <<
", badValue = ";
58 (*messageHandler_) <<
" ";
61 double limit =
constraint_->getAcceptedLimit(value);
AutoParameter & operator=(const AutoParameter ¶m)
Assignment operator.
This class is designed to facilitate the manipulation of parameters.
virtual double getBadValue() const
Get the value that doesn't match the constraint.
virtual void setValue(double value)
Set the value of this parameter.
std::shared_ptr< OutputStream > messageHandler_
AutoParameter(const std::string &name="", double value=0, std::shared_ptr< ConstraintInterface > constraint=nullptr)
Build a new AutoParameter.
std::shared_ptr< ConstraintInterface > constraint_
Exception thrown when a value do not match a given constraint.
Parameter & operator=(const Parameter ¶m)
Assignment operator.
virtual void setValue(double value)
Set the value of this parameter.