/usr/include/dynamic_reconfigure/config_tools.h is in libdynamic-reconfigure-config-init-mutex-dev 1.5.49-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | #ifndef __DYNAMIC_RECONFIGURE__CONFIG_TOOLS__
#define __DYNAMIC_RECONFIGURE__CONFIG_TOOLS__
#include <string>
#include <vector>
#include <dynamic_reconfigure/Config.h>
#include <dynamic_reconfigure/Group.h>
namespace dynamic_reconfigure
{
class ConfigTools
{
public:
static std::vector<dynamic_reconfigure::BoolParameter> &getVectorForType(dynamic_reconfigure::Config &set, const bool /*val*/)
{
return set.bools;
}
static std::vector<dynamic_reconfigure::IntParameter> &getVectorForType(dynamic_reconfigure::Config &set, const int /*val*/)
{
return set.ints;
}
static std::vector<dynamic_reconfigure::StrParameter> &getVectorForType(dynamic_reconfigure::Config &set, const std::string& /*val*/)
{
return set.strs;
}
static std::vector<dynamic_reconfigure::DoubleParameter> &getVectorForType(dynamic_reconfigure::Config &set, const double /*val*/)
{
return set.doubles;
}
static const std::vector<dynamic_reconfigure::BoolParameter> &getVectorForType(const dynamic_reconfigure::Config &set, const bool /*val*/)
{
return set.bools;
}
static const std::vector<dynamic_reconfigure::IntParameter> &getVectorForType(const dynamic_reconfigure::Config &set, const int /*val*/)
{
return set.ints;
}
static const std::vector<dynamic_reconfigure::StrParameter> &getVectorForType(const dynamic_reconfigure::Config &set, const std::string& /*val*/)
{
return set.strs;
}
static const std::vector<dynamic_reconfigure::DoubleParameter> &getVectorForType(const dynamic_reconfigure::Config &set, const double /*val*/)
{
return set.doubles;
}
static dynamic_reconfigure::BoolParameter makeKeyValuePair(const std::string &name, const bool val)
{
dynamic_reconfigure::BoolParameter param;
param.name = name;
param.value = val ;
return param;
}
static dynamic_reconfigure::IntParameter makeKeyValuePair(const std::string &name, const int val)
{
dynamic_reconfigure::IntParameter param;
param.name = name;
param.value = val ;
return param;
}
static dynamic_reconfigure::StrParameter makeKeyValuePair(const std::string &name, const std::string &val)
{
dynamic_reconfigure::StrParameter param;
param.name = name;
param.value = val ;
return param;
}
static dynamic_reconfigure::DoubleParameter makeKeyValuePair(const std::string &name, const double val)
{
dynamic_reconfigure::DoubleParameter param;
param.name = name;
param.value = val ;
return param;
}
template <class T>
static void appendParameter(dynamic_reconfigure::Config &set, const std::string &name, const T &val)
{
getVectorForType(set, val).push_back(makeKeyValuePair(name, val));
}
template <class VT, class T>
static bool getParameter(const std::vector<VT> &vec, const std::string &name, T &val)
{
for (typename std::vector<VT>::const_iterator i = vec.begin(); i != vec.end(); ++i)
if (i->name == name)
{
val = i->value;
return true;
}
return false;
}
template <class T>
static bool getParameter(const dynamic_reconfigure::Config &set, const std::string &name, T &val)
{
return getParameter(getVectorForType(set, val), name, val);
}
template<class T>
static void appendGroup(dynamic_reconfigure::Config &set, const std::string &name, int id, int parent, const T &val)
{
dynamic_reconfigure::GroupState msg;
msg.name = name;
msg.id= id;
msg.parent = parent;
msg.state = val.state;
set.groups.push_back(msg);
}
template<class T>
static bool getGroupState(const dynamic_reconfigure::Config &msg, const std::string &name, T &val)
{
for(std::vector<dynamic_reconfigure::GroupState>::const_iterator i = msg.groups.begin(); i != msg.groups.end(); ++i)
if(i->name == name)
{
val.state = i->state;
return true;
}
return false;
}
static int size(dynamic_reconfigure::Config &msg)
{
return msg.bools.size() + msg.doubles.size() + msg.ints.size() + msg.strs.size();
}
static void clear(dynamic_reconfigure::Config &msg)
{
msg.bools.clear();
msg.ints.clear();
msg.strs.clear();
msg.doubles.clear();
msg.groups.clear();
}
};
}
#endif
|