The DDParam class is the abstraction of all parameter types, and is the template for creating them. At this point, not much is known about the parameter, but the following: More...
#include <dd_param.h>
Public Member Functions | |
virtual int | getLevel () const =0 |
fetches the level of the parameter More... | |
virtual string | getName () const =0 |
gets the name of the parameter, that is, the ID used in the program when requesting it. More... | |
virtual Value | getValue () const =0 |
gets the value of this parameter. More... | |
virtual void | prepConfig (Config &conf)=0 |
updates a config message according to this param's info. More... | |
virtual void | prepConfigDescription (ConfigDescription &conf_desc)=0 |
updates a config description message according to this param's info. More... | |
virtual void | prepGroup (Group &group)=0 |
updates a group message according to this param's info. More... | |
virtual bool | sameType (Value val)=0 |
checks whether or not the raw value stored in the value is compatible with the given parameter. Compatible is a very broad word in this scenario. It means that the value can be placed in the parameter regardless of other limitations. More... | |
virtual bool | sameValue (Value val)=0 |
checks whether or not the value stored in the value object, when converted to the type of the internal value, are equal. This acts regardless of type. More... | |
virtual void | setValue (Value val)=0 |
sets the value of this parameter as this one. More... | |
Friends | |
ostream & | operator<< (ostream &os, const DDParam ¶m) |
the operator taking care of streaming the param values More... | |
The DDParam class is the abstraction of all parameter types, and is the template for creating them. At this point, not much is known about the parameter, but the following:
Other than storing data, the parameter also has specialised methods to interact with DDynamicReconfigure in order to apply changes and send them. These methods should not be touched by the user.
Since this class is abstract, the class has multiple implementations whicch are not directly exposed but are used, so its worth checking out their descriptions.
While this class is abstract, it does have one implemented thing, and that is its stream operator (<<
) which can be freely used.
While DDParam is abstract, all of its concrete implementations should follow this guideline: DD<Type>(const string &name, unsigned int level, const string &description, <type> def, <extra-args>) Where:
You may then include extra arguments as you wish, required or optional.
Definition at line 48 of file dd_param.h.
|
pure virtual |
fetches the level of the parameter
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
gets the name of the parameter, that is, the ID used in the program when requesting it.
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
gets the value of this parameter.
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
updates a config message according to this param's info.
conf | the group to update. |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
updates a config description message according to this param's info.
conf_desc | the config description to update. |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
updates a group message according to this param's info.
group | the group to update. |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDEnum, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, and ddynamic_reconfigure::DDString.
|
pure virtual |
checks whether or not the raw value stored in the value is compatible with the given parameter. Compatible is a very broad word in this scenario. It means that the value can be placed in the parameter regardless of other limitations.
val | the value to test |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, ddynamic_reconfigure::DDString, and ddynamic_reconfigure::DDEnum.
|
pure virtual |
checks whether or not the value stored in the value object, when converted to the type of the internal value, are equal. This acts regardless of type.
val | the value to test |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, ddynamic_reconfigure::DDString, and ddynamic_reconfigure::DDEnum.
|
pure virtual |
sets the value of this parameter as this one.
val | the value to use |
Implemented in ddynamic_reconfigure::DDDouble, ddynamic_reconfigure::DDInt, ddynamic_reconfigure::DDBool, ddynamic_reconfigure::DDString, and ddynamic_reconfigure::DDEnum.
|
friend |
the operator taking care of streaming the param values
os | the stream to place the param into |
param | the param you want to place into the stream |
Definition at line 8 of file dd_param.cpp.