dd_enum_param.h
Go to the documentation of this file.
1 //
2 // Created by Noam Dori on 20/06/18.
3 //
4 
5 #ifndef DDYNAMIC_RECONFIGURE_DD_ENUM_PARAM_H
6 #define DDYNAMIC_RECONFIGURE_DD_ENUM_PARAM_H
7 
8 #include "dd_int_param.h"
9 #include <boost/foreach.hpp>
10 
11 namespace ddynamic_reconfigure {
12  typedef map<string,pair<int,string> > EnumMap;
19  class DDEnum : virtual public DDInt {
20  public:
21 
22  void prepGroup(Group &group);
23 
24  bool sameType(Value val);
25 
26  bool sameValue(Value val);
27 
28  void setValue(Value val);
29 
38  DDEnum(const string &name, unsigned int level, const string &description,
39  int def, const map<string,int> &dictionary);
40 
49  DDEnum(const string &name, unsigned int level, const string &description,
50  const string& def, const map<string,int> &dictionary);
51 
52  #ifdef __clang__
53  #pragma clang diagnostic push
54  #pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
55  #endif
56 
67  DDEnum(const string &name, unsigned int level, const string &description,
68  int def, const pair<map<string,pair<int,string> >,string> &dictionary);
69 
81  DDEnum(const string &name, unsigned int level, const string &description,
82  const string& def, const pair<map<string,pair<int,string> >,string> &dictionary);
83  #ifdef __clang__
84  #pragma clang diagnostic pop
85  #endif
86 
87  protected:
92  const EnumMap dict_;
97  private:
104  int lookup(Value val);
105 
110  string makeEditMethod();
111 
119  string makeConst(string name, int value, string desc);
120  };
121 }
122 
123 #endif //DDYNAMIC_RECONFIGURE_DD_ENUM_PARAM_H
bool sameType(Value val)
checks whether or not the raw value stored in the value is compatible with the given parameter...
DDEnum(const string &name, unsigned int level, const string &description, int def, const map< string, int > &dictionary)
creates a new int-enum param
void setValue(Value val)
sets the value of this parameter as this one.
void prepGroup(Group &group)
updates a group message according to this param&#39;s info.
bool sameValue(Value val)
checks whether or not the value stored in the value object, when converted to the type of the interna...
const EnumMap dict_
A dictionary from the string aliases to their integer counterparts. This method of storage allows int...
Definition: dd_enum_param.h:92
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: dd_enum_param.h:19
string enum_description_
this holds the physical enum&#39;s description. why is this here? because 1D-reconfigure.
Definition: dd_enum_param.h:96
The Value class is used to wrap all basic data-types (bool,int,double,string) in something generic...
Definition: dd_value.h:29
map< string, pair< int, string > > EnumMap
Definition: dd_enum_param.h:12
string makeConst(string name, int value, string desc)
an integer implementation of the parameter. This is used to 32 bit signed integral numbers...
Definition: dd_int_param.h:17


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