45 #include "../Clonable.h" 73 #ifndef NO_VIRTUAL_COV 96 #ifndef NO_VIRTUAL_COV 108 virtual const std::string&
getId()
const = 0;
166 Parameter(
const std::string& name,
double value,
Constraint* constraint,
bool attachConstraint,
double precision=0)
194 #ifndef NO_VIRTUAL_COV 208 virtual void setName(
const std::string & name)
322 for(std::vector<ParameterListener *>::iterator it =
listeners_.begin(); it !=
listeners_.end(); it++)
323 (*it)->parameterNameChanged(event);
327 for(std::vector<ParameterListener *>::iterator it =
listeners_.begin(); it !=
listeners_.end(); it++)
328 (*it)->parameterValueChanged(event);
342 #endif //_PARAMETER_H_ virtual void parameterNameChanged(ParameterEvent &event)=0
Notify a renaming action.
const Parameter * getParameter() const
The parameter listener interface.
static const IntervalConstraint R_MINUS_STAR
virtual const Constraint * removeConstraint()
Remove the constraint associated to this parameter.
Parameter * clone() const
Create a copy of this object and send a pointer to it.
virtual const Constraint * getConstraint() const
Return the constraint associated to this parameter if there is one.
Parameter()
Default contructor. Creates a parameter with no name, no constraint, and a value of 0...
ParameterEvent(Parameter *parameter)
An interval, either bounded or not, which can also have infinite bounds.
This class allows to perform a correspondence analysis.
std::vector< ParameterListener * > listeners_
void fireParameterValueChanged(ParameterEvent &event)
static const IntervalConstraint PROP_CONSTRAINT_EX
This class is designed to facilitate the manipulation of parameters.
virtual void addParameterListener(ParameterListener *listener, bool attachListener=true)
Add a new listener to this parameter.
static const IntervalConstraint R_PLUS_STAR
ParameterEvent(const ParameterEvent &pe)
void setPrecision(double precision)
Set the precision of this parameter.
virtual const std::string & getId() const =0
virtual bool hasConstraint() const
Tells if this parameter has a constraint.
virtual void removeParameterListener(const std::string &listenerId)
Remove all listeners with a given id from this parameter.
virtual void setValue(double value)
Set the value of this parameter.
Parameter * getParameter()
ParameterEvent * clone() const
Create a copy of this object and send a pointer to it.
static const IntervalConstraint R_MINUS
virtual void setConstraint(Constraint *constraint, bool attach=false)
Set a constraint to this parameter.
The constraint interface.
virtual void parameterValueChanged(ParameterEvent &event)=0
Notify a value change.
virtual const std::string & getName() const
Get the name of this parameter.
virtual void setName(const std::string &name)
Set the name of this parameter.
virtual bool hasParameterListener(const std::string &listenerId)
Tell is there is a listener with a given id from this parameter.
The Clonable interface (allow an object to be cloned).
static const IntervalConstraint PROP_CONSTRAINT_IN
ParameterListener * clone() const =0
Create a copy of this object and send a pointer to it.
virtual double getValue() const
Get the value of this parameter.
Exception thrown when a value do not match a given constraint.
std::vector< bool > listenerAttach_
static const IntervalConstraint R_PLUS
void fireParameterNameChanged(ParameterEvent &event)
virtual double getPrecision() const
Get the precision of this parameter.
ParameterEvent & operator=(const ParameterEvent &pe)
virtual Constraint * getConstraint()
Return the constraint associated to this parameter if there is one.