Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ddynamic_reconfigure::DDEnum Class Reference

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>

Inheritance diagram for ddynamic_reconfigure::DDEnum:
Inheritance graph
[legend]

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

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

Parameters
namethe name of the parameter
levelthe change level
defthe default value in integer form
descriptiondetails about the parameter
dictionarythe 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

Parameters
namethe name of the parameter
levelthe change level
defan alias of the default value
descriptiondetails about the parameter
dictionarythe 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

Parameters
namethe name of the parameter
levelthe change level
defthe default value in integer form
descriptiondetails about the parameter
dictionarythe alias dictionary this enum will use.
Note
since ROS cannot send the enum and const descriptions, this method is useless. Please use the constructor which takes a map<string,int> instead.
Deprecated:
see note. This is not tested, so it may fail.

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

Parameters
namethe name of the parameter
levelthe change level
defan alias of the default value
descriptiondetails about the parameter
dictionarythe alias dictionary this enum will use.
Note
since ROS cannot send the enum and const descriptions, this method is useless. Please use the constructor which takes a map<string,int> instead.
Deprecated:
see note. This is not tested, so it may fail.

Definition at line 101 of file dd_enum_param.cpp.

Member Function Documentation

int ddynamic_reconfigure::DDEnum::lookup ( Value  val)
private

converts the value given to an integer according to the embedded dictionary.

Parameters
valthe value to look up within the dictionary
Returns
if the value is a string which exists in the dictionary, returns the int definition of the term given. otherwise, returns the Value object defined conversion of the type to an integer.

Definition at line 56 of file dd_enum_param.cpp.

string ddynamic_reconfigure::DDEnum::makeConst ( string  name,
int  value,
string  desc 
)
private

generates a 'const' sting for prepGroup().

Parameters
namethe name of the constant
valuethe value of the constant
descthe description given to the constant.
Returns
a string that should not be touched.

Definition at line 133 of file dd_enum_param.cpp.

string ddynamic_reconfigure::DDEnum::makeEditMethod ( )
private

generates the 'edit_method' sting for prepGroup().

Returns
a string that should not be touched.

Definition at line 114 of file dd_enum_param.cpp.

void ddynamic_reconfigure::DDEnum::prepGroup ( Group &  group)
virtual

updates a group message according to this param's info.

Parameters
groupthe group to update.
Note
this is an internal method. It is recommended not to use it.

Implements ddynamic_reconfigure::DDParam.

Definition at line 26 of file dd_enum_param.cpp.

bool ddynamic_reconfigure::DDEnum::sameType ( Value  val)
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.

Parameters
valthe value to test
Returns
true is this parameter can handle the original value, false otherwise.

Implements ddynamic_reconfigure::DDParam.

Definition at line 36 of file dd_enum_param.cpp.

bool ddynamic_reconfigure::DDEnum::sameValue ( Value  val)
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.

Parameters
valthe value to test
Returns
true is this parameter can is the same as the original value, false otherwise.

Implements ddynamic_reconfigure::DDParam.

Definition at line 40 of file dd_enum_param.cpp.

void ddynamic_reconfigure::DDEnum::setValue ( Value  val)
virtual

sets the value of this parameter as this one.

Parameters
valthe value to use

Implements ddynamic_reconfigure::DDParam.

Definition at line 48 of file dd_enum_param.cpp.

Member Data Documentation

const EnumMap ddynamic_reconfigure::DDEnum::dict_
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.

string ddynamic_reconfigure::DDEnum::enum_description_
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.


The documentation for this class was generated from the following files:


ddynamic_reconfigure
Author(s): Noam Dori
autogenerated on Thu May 16 2019 02:46:38