GenericParam.h
170 SpecificParam(const std::string &name, const SetterFn &setter, const GetterFn &getter = GetterFn()) :
GenericParam(const std::string &name)
The constructor of a parameter takes the name of the parameter (name)
Definition: GenericParam.h:69
virtual std::string getValue() const =0
Retrieve the value of the parameter, as a string.
Motion planning algorithms often employ parameters to guide their exploration process. (e.g., goal biasing). Motion planners (and some of their components) use this class to declare what the parameters are, in a generic way, so that they can be set externally.
Definition: GenericParam.h:64
std::function< T()> GetterFn
The type for the 'getter' function for this parameter.
Definition: GenericParam.h:166
virtual bool setValue(const std::string &value)
Set the value of the parameter. The value is taken in as a string, but converted to the type of that ...
Definition: GenericParam.h:181
std::size_t size() const
Get the number of parameters maintained by this instance.
Definition: GenericParam.h:301
virtual std::string getValue() const
Retrieve the value of the parameter, as a string.
Definition: GenericParam.h:202
This is a helper class that instantiates parameters with different data types.
Definition: GenericParam.h:158
std::function< void(T)> SetterFn
The type for the 'setter' function for this parameter.
Definition: GenericParam.h:163
const std::string & maybeWrapBool(const std::string &value) const
Bool values such as "false" cannot be converted to bool using lexical_cast. We need to map those to "...
Definition: GenericParam.h:127
const std::string & getRangeSuggestion() const
Get the suggested range of values.
Definition: GenericParam.h:117
GenericParam & operator=(const T &value)
Assignment operator by type. This is just for convenience, as it just calls setValue() ...
Definition: GenericParam.h:97
void declareParam(const std::string &name, const typename SpecificParam< T >::SetterFn &setter, const typename SpecificParam< T >::GetterFn &getter=typename SpecificParam< T >::GetterFn())
This function declares a parameter name, and specifies the setter and getter functions.
Definition: GenericParam.h:239
void setRangeSuggestion(const std::string &rangeSuggestion)
Set a suggested range.
Definition: GenericParam.h:111
SpecificParam(const std::string &name, const SetterFn &setter, const GetterFn &getter=GetterFn())
An explicit instantiation of a parameter name requires the setter function and optionally the getter ...
Definition: GenericParam.h:170
virtual bool setValue(const std::string &value)=0
Set the value of the parameter. The value is taken in as a string, but converted to the type of that ...