dd_bool_param.cpp
Go to the documentation of this file.
00001 //
00002 // Created by Noam Dori on 19/06/18.
00003 //
00004 
00005 #include <ddynamic_reconfigure/param/dd_bool_param.h>
00006 
00007 namespace ddynamic_reconfigure {
00008     string DDBool::getName() const {
00009         return name_;
00010     }
00011 
00012     void DDBool::prepGroup(Group &group) {
00013         ParamDescription desc;
00014         desc.name  = name_;
00015         desc.level = level_;
00016         desc.description = desc_;
00017         desc.type = "bool";
00018         group.parameters.push_back(desc);
00019     }
00020 
00021     void DDBool::prepConfig(Config &conf) {
00022         BoolParameter param;
00023         param.name = name_;
00024         param.value = (unsigned char)val_;
00025         conf.bools.push_back(param);
00026     }
00027 
00028     void DDBool::prepConfigDescription(ConfigDescription &conf_desc) {
00029         BoolParameter param;
00030         param.name = name_;
00031         param.value = (unsigned char)def_;
00032         conf_desc.dflt.bools.push_back(param);
00033         param.value = (unsigned char)true;
00034         conf_desc.max.bools.push_back(param);
00035         param.value = (unsigned char)false;
00036         conf_desc.min.bools.push_back(param);
00037     }
00038 
00039     int DDBool::getLevel() const {
00040         return level_;
00041     }
00042 
00043     bool DDBool::sameType(Value val) {
00044         return val.getType() == "bool";
00045     }
00046 
00047     bool DDBool::sameValue(Value val) {
00048         return val.toBool() == val_;
00049     }
00050 
00051     void DDBool::setValue(Value val) {
00052         val_ = val.toBool();
00053     }
00054 
00055     Value DDBool::getValue() const {
00056         return Value(val_);
00057     }
00058 }


ddynamic_reconfigure
Author(s): Noam Dori
autogenerated on Wed May 15 2019 04:39:27