an integer enum implementation of the parameter. This is an extension to the int parameter, which allows creating string aliases for certain (if not all) numbers available. More...
#include <dd_enum_param.h>
Public Member Functions | |
DDEnum (const string &name, unsigned int level, const string &description, int def, const map< string, int > &dictionary) | |
creates a new int-enum param More... | |
DDEnum (const string &name, unsigned int level, const string &description, const string &def, const map< string, int > &dictionary) | |
creates a new int-enum param More... | |
DDEnum (const string &name, unsigned int level, const string &description, int def, const pair< map< string, pair< int, string > >, string > &dictionary) | |
creates a new int-enum param More... | |
DDEnum (const string &name, unsigned int level, const string &description, const string &def, const pair< map< string, pair< int, string > >, string > &dictionary) | |
creates a new int-enum param More... | |
void | prepGroup (Group &group) |
updates a group message according to this param's info. More... | |
bool | sameType (Value val) |
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... | |
bool | sameValue (Value val) |
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... | |
void | setValue (Value val) |
sets the value of this parameter as this one. More... | |
Public Member Functions inherited from ddynamic_reconfigure::DDInt | |
DDInt (const string &name, unsigned int level, const string &description, int def, int min=INT32_MIN, int max=INT32_MAX) | |
int | getLevel () const |
fetches the level of the parameter More... | |
string | getName () const |
gets the name of the parameter, that is, the ID used in the program when requesting it. More... | |
Value | getValue () const |
gets the value of this parameter. More... | |
void | prepConfig (Config &conf) |
updates a config message according to this param's info. More... | |
void | prepConfigDescription (ConfigDescription &conf_desc) |
updates a config description message according to this param's info. More... | |
void | prepGroup (Group &group) |
updates a group message according to this param's info. More... | |
bool | sameType (Value val) |
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... | |
bool | sameValue (Value val) |
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... | |
void | setValue (Value val) |
sets the value of this parameter as this one. More... | |
Protected Attributes | |
const EnumMap | dict_ |
A dictionary from the string aliases to their integer counterparts. This method of storage allows integers to have multiple aliases. More... | |
string | enum_description_ |
this holds the physical enum's description. why is this here? because 1D-reconfigure. More... | |
Protected Attributes inherited from ddynamic_reconfigure::DDInt | |
int | def_ |
the default value (def_), the current value (val_), the minimum allowed value (min_), and the maximum allowed value (max_) More... | |
string | desc_ |
unsigned int | level_ |
the level of the parameter: the degree in which things need to be shut down if this param changes More... | |
int | max_ |
int | min_ |
string | name_ |
the name of the parameter (name_), and its description (desc_) More... | |
int | val_ |
Private Member Functions | |
int | lookup (Value val) |
string | makeConst (string name, int value, string desc) |
string | makeEditMethod () |
an integer enum implementation of the parameter. This is an extension to the int parameter, which allows creating string aliases for certain (if not all) numbers available.
Definition at line 19 of file dd_enum_param.h.
ddynamic_reconfigure::DDEnum::DDEnum | ( | const string & | name, |
unsigned int | level, | ||
const string & | description, | ||
int | def, | ||
const map< string, int > & | dictionary | ||
) |
creates a new int-enum param
name | the name of the parameter |
level | the change level |
def | the default value in integer form |
description | details about the parameter |
dictionary | the alias dictionary this enum will use. |
Definition at line 64 of file dd_enum_param.cpp.
ddynamic_reconfigure::DDEnum::DDEnum | ( | const string & | name, |
unsigned int | level, | ||
const string & | description, | ||
const string & | def, | ||
const map< string, int > & | dictionary | ||
) |
creates a new int-enum param
name | the name of the parameter |
level | the change level |
def | an alias of the default value |
description | details about the parameter |
dictionary | the alias dictionary this enum will use. |
Definition at line 76 of file dd_enum_param.cpp.
ddynamic_reconfigure::DDEnum::DDEnum | ( | const string & | name, |
unsigned int | level, | ||
const string & | description, | ||
int | def, | ||
const pair< map< string, pair< int, string > >, string > & | dictionary | ||
) |
creates a new int-enum param
name | the name of the parameter |
level | the change level |
def | the default value in integer form |
description | details about the parameter |
dictionary | the alias dictionary this enum will use. |
Definition at line 88 of file dd_enum_param.cpp.
ddynamic_reconfigure::DDEnum::DDEnum | ( | const string & | name, |
unsigned int | level, | ||
const string & | description, | ||
const string & | def, | ||
const pair< map< string, pair< int, string > >, string > & | dictionary | ||
) |
creates a new int-enum param
name | the name of the parameter |
level | the change level |
def | an alias of the default value |
description | details about the parameter |
dictionary | the alias dictionary this enum will use. |
Definition at line 101 of file dd_enum_param.cpp.
|
private |
converts the value given to an integer according to the embedded dictionary.
val | the value to look up within the dictionary |
Definition at line 56 of file dd_enum_param.cpp.
|
private |
generates a 'const' sting for prepGroup().
name | the name of the constant |
value | the value of the constant |
desc | the description given to the constant. |
Definition at line 133 of file dd_enum_param.cpp.
|
private |
generates the 'edit_method' sting for prepGroup().
Definition at line 114 of file dd_enum_param.cpp.
|
virtual |
updates a group message according to this param's info.
group | the group to update. |
Implements ddynamic_reconfigure::DDParam.
Definition at line 26 of file dd_enum_param.cpp.
|
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 |
Implements ddynamic_reconfigure::DDParam.
Definition at line 36 of file dd_enum_param.cpp.
|
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 |
Implements ddynamic_reconfigure::DDParam.
Definition at line 40 of file dd_enum_param.cpp.
|
virtual |
sets the value of this parameter as this one.
val | the value to use |
Implements ddynamic_reconfigure::DDParam.
Definition at line 48 of file dd_enum_param.cpp.
|
protected |
A dictionary from the string aliases to their integer counterparts. This method of storage allows integers to have multiple aliases.
Definition at line 92 of file dd_enum_param.h.
|
protected |
this holds the physical enum's description. why is this here? because 1D-reconfigure.
Definition at line 96 of file dd_enum_param.h.