dd_string_param.cpp
Go to the documentation of this file.
1 //
2 // Created by Noam Dori on 19/06/18.
3 //
4 
6 
7 namespace ddynamic_reconfigure {
8  string DDString::getName() const {
9  return name_;
10  }
11 
12  void DDString::prepGroup(Group &group) {
13  ParamDescription desc;
14  desc.name = name_;
15  desc.level = level_;
16  desc.description = desc_;
17  desc.type = "string";
18  group.parameters.push_back(desc);
19  }
20 
21  void DDString::prepConfig(Config &conf) {
22  StrParameter param;
23  param.name = name_;
24  param.value = val_;
25  conf.strs.push_back(param);
26  }
27 
28  void DDString::prepConfigDescription(ConfigDescription &conf_desc) {
29  StrParameter param;
30  param.name = name_;
31  param.value = def_;
32  conf_desc.dflt.strs.push_back(param);
33  param.value = "";
34  conf_desc.max.strs.push_back(param);
35  param.value = "";
36  conf_desc.min.strs.push_back(param);
37  }
38 
39  int DDString::getLevel() const {
40  return level_;
41  }
42 
44  return val.getType() == "string";
45  }
46 
48  return val.toString() == val_;
49  }
50 
52  val_ = val.toString();
53  }
54 
56  return Value(val_);
57  }
58 }
int getLevel() const
fetches the level of the parameter
bool param(const std::string &param_name, T &param_val, const T &default_val)
Value getValue() const
gets the value of this parameter.
bool sameValue(Value val)
checks whether or not the value stored in the value object, when converted to the type of the interna...
unsigned int level_
the level of the parameter: the degree in which things need to be shut down if this param changes ...
void prepConfig(Config &conf)
updates a config message according to this param's info.
string name_
the name of the parameter (name_), and its description (desc_)
string getName() const
gets the name of the parameter, that is, the ID used in the program when requesting it...
string def_
the default value (def_), and the current value (val_)
void prepConfigDescription(ConfigDescription &conf_desc)
updates a config description message according to this param's info.
bool sameType(Value val)
checks whether or not the raw value stored in the value is compatible with the given parameter...
void prepGroup(Group &group)
updates a group message according to this param's info.
The Value class is used to wrap all basic data-types (bool,int,double,string) in something generic...
Definition: dd_value.h:29
string toString() const
converts the stored value into a string.
Definition: dd_value.h:116
void setValue(Value val)
sets the value of this parameter as this one.
string getType() const
gets the type this value wrapper stores
Definition: dd_value.h:84


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