dd_double_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 DDDouble::getName() const {
9  return name_;
10  }
11 
12  void DDDouble::prepGroup(Group &group) {
13  ParamDescription desc;
14  desc.name = name_;
15  desc.level = level_;
16  desc.description = desc_;
17  desc.type = "double";
18  group.parameters.push_back(desc);
19  }
20 
21  void DDDouble::prepConfig(Config &conf) {
22  DoubleParameter param;
23  param.name = name_;
24  param.value = val_;
25  conf.doubles.push_back(param);
26  }
27 
28  void DDDouble::prepConfigDescription(ConfigDescription &conf_desc) {
29  DoubleParameter param;
30  param.name = name_;
31  param.value = def_;
32  conf_desc.dflt.doubles.push_back(param);
33  param.value = max_;
34  conf_desc.max.doubles.push_back(param);
35  param.value = min_;
36  conf_desc.min.doubles.push_back(param);
37  }
38 
39  int DDDouble::getLevel() const {
40  return level_;
41  }
42 
44  return val.getType() == "double";
45  }
46 
48  return val.toDouble() == val_;
49  }
50 
52  val_ = val.toDouble();
53  }
54 
56  return Value(val_);
57  }
58 }
bool param(const std::string &param_name, T &param_val, const T &default_val)
Value getValue() const
gets the value of this parameter.
unsigned int level_
the level of the parameter: the degree in which things need to be shut down if this param changes ...
double def_
the default value (def_), the current value (val_), the minimum allowed value (min_), and the maximum allowed value (max_)
int getLevel() const
fetches the level of the parameter
void setValue(Value val)
sets the value of this parameter as this one.
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...
The Value class is used to wrap all basic data-types (bool,int,double,string) in something generic...
Definition: dd_value.h:29
bool sameValue(Value val)
checks whether or not the value stored in the value object, when converted to the type of the interna...
double toDouble() const
converts the stored value into a double.
Definition: dd_value.h:133
void prepConfigDescription(ConfigDescription &conf_desc)
updates a config description message according to this param's info.
void prepConfig(Config &conf)
updates a config 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...
string getType() const
gets the type this value wrapper stores
Definition: dd_value.h:84
void prepGroup(Group &group)
updates a group message according to this param's info.


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