40 #ifndef _ABSTRACTPARAMETERALIASABLE_H_ 41 #define _ABSTRACTPARAMETERALIASABLE_H_ 74 name_ = (*pl_)[alias].getName();
98 const std::string&
getId()
const {
return id_; }
110 throw Exception(
"AbstractParameterAliasable::AliasParameterListener::parameterValueChanged. Error, aliased parameter have change, maybe because it was renamed, or a parameter was removed?");
111 p->
setValue(event.getParameter()->getValue());
180 void aliasParameters(std::map<std::string, std::string>& unparsedParams,
bool verbose);
197 std::vector<std::string>
getAlias(
const std::string& name)
const;
204 std::string
getFrom(
const std::string& name)
const;
242 for (
size_t i=0; i<names.size(); i++)
259 #endif //_ABSTRACTPARAMETERALIASABLE_H_ Exception thrown when a parameter is not found, for instance in a ParameterList.
The parameter listener interface.
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
std::vector< std::string > getAlias(const std::string &name) const
Parameter * clone() const
Create a copy of this object and send a pointer to it.
Extend the Parametrizable interface with support for parameter aliases.
const ParameterList & getIndependentParameters() const
Get the minimal list of parameters to set the model.
virtual void reset()
Reset the list: delete all parameters.
This class allows to perform a correspondence analysis.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.
void unaliasParameters(const std::string &p1, const std::string &p2)
Detach two parameters previously set as 'aliased'.
A partial implementation of the Parametrizable interface.
virtual ~AbstractParameterAliasable()
This class is designed to facilitate the manipulation of parameters.
void addParameter_(Parameter *parameter)
size_t getNumberOfIndependentParameters() const
Get the number of independent parameters.
virtual void deleteParameter(const std::string &name)
Delete a parameter from the list.
const std::string & getName() const
void deleteParameter_(size_t index)
The parameter list object.
virtual void addParameters(const ParameterList ¶ms)
Add new parameters at the end of the list.
AliasParameterListener & operator=(const AliasParameterListener &apl)
void deleteParameters_(const std::vector< std::string > &names)
virtual void setValue(double value)
Set the value of this parameter.
A partial implementation of the Parametrizable interface.
std::map< std::string, AliasParameterListener * > aliasListenersRegister_
void addParameters_(const ParameterList ¶meters)
const std::string & getFrom() const
AliasParameterListener * clone() const
Create a copy of this object and send a pointer to it.
void deleteParameter_(size_t index)
virtual bool hasParameter(const std::string &name) const
const std::string & getId() const
std::string getFrom(const std::string &name) const
ParameterList independentParameters_
void addParameters_(const ParameterList ¶meters)
virtual const std::string & getName() const
Get the name of this parameter.
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
void addParameter_(Parameter *parameter)
virtual void addParameter(const Parameter ¶m)
Add a new parameter at the end of the list.
void deleteParameter_(std::string &name)
const std::string & getAlias() const
const ParameterList & getParameters() const
Get all parameters available.
void parameterNameChanged(ParameterEvent &event)
Notify a renaming action.
AbstractParameterAliasable(const std::string &prefix)
void parameterValueChanged(ParameterEvent &event)
Notify a value change.
AliasParameterListener(const std::string &id, size_t alias, ParameterList *pl, const std::string &from)
void setNamespace(const std::string &prefix)
Set the namespace for the parameter names.
void rename(const std::string &name)
void aliasParameters(const std::string &p1, const std::string &p2)
Set two parameters as 'aliased'.
Parameter & getParameter_(const std::string &name)
Index out of bounds exception class.
void setParameterList(ParameterList *pl)
Inner listener class used by AbstractParameterAliasable.
ParameterList getAliasedParameters(const ParameterList &pl) const
Return the list of the names of the parameters that are aliased (directly or not) to one of the param...
AliasParameterListener(const AliasParameterListener &apl)