Getting values from parameter server. This class is used for getting the parameters from the parameter server. More...
#include <parameter_server.h>
Public Member Functions | |
template<typename T > | |
T | get (const std::string param) |
std::map< std::string, boost::any > & | getConfigData () |
std::string | getDescription (std::string param_name) |
void | getValues () |
template<typename T > | |
void | set (const std::string param, T value) |
Static Public Member Functions | |
static ParameterServer * | instance () |
Private Member Functions | |
void | addOption (std::string name, boost::any value, std::string description) |
void | checkValues () |
void | defaultConfig () |
template<typename T > | |
T | getFromParameterServer (const std::string param, T def) |
ParameterServer () | |
Private Attributes | |
std::map< std::string, boost::any > | config |
std::map< std::string, std::string > | descriptions |
ros::NodeHandle | handle |
std::string | pre |
Static Private Attributes | |
static ParameterServer * | _instance = NULL |
Getting values from parameter server. This class is used for getting the parameters from the parameter server.
Definition at line 38 of file parameter_server.h.
ParameterServer::ParameterServer | ( | ) | [private] |
Default constructor private, because of singleton
Definition at line 22 of file parameter_server.cpp.
void ParameterServer::addOption | ( | std::string | name, |
boost::any | value, | ||
std::string | description | ||
) | [private] |
Definition at line 37 of file parameter_server.cpp.
void ParameterServer::checkValues | ( | ) | [private] |
Checks, whether the parameters are ok
Definition at line 152 of file parameter_server.cpp.
void ParameterServer::defaultConfig | ( | ) | [private] |
Loads the default configuration
Definition at line 42 of file parameter_server.cpp.
T ParameterServer::get | ( | const std::string | param | ) | [inline] |
Definition at line 68 of file parameter_server.h.
std::map<std::string, boost::any>& ParameterServer::getConfigData | ( | ) | [inline] |
Provides access to the raw config data
Definition at line 85 of file parameter_server.h.
std::string ParameterServer::getDescription | ( | std::string | param_name | ) |
Returns the description text for the named option
Definition at line 123 of file parameter_server.cpp.
T ParameterServer::getFromParameterServer | ( | const std::string | param, |
T | def | ||
) | [inline, private] |
Returns a value from the parameter server Will only be used by getValue()
param | name of the parameter |
def | default value (get through defaultConfig()) |
Definition at line 130 of file parameter_server.h.
void ParameterServer::getValues | ( | ) |
Receives all values from the parameter server and store them in the map 'config'. Will be called in the constructor
Definition at line 127 of file parameter_server.cpp.
ParameterServer * ParameterServer::instance | ( | ) | [static] |
Returns the singleton instance
Definition at line 30 of file parameter_server.cpp.
void ParameterServer::set | ( | const std::string | param, |
T | value | ||
) | [inline] |
The method returns a value from the local cache. You can use bool, int, double and std::string for T
param | the name of the parameter |
Definition at line 53 of file parameter_server.h.
ParameterServer * ParameterServer::_instance = NULL [static, private] |
Definition at line 100 of file parameter_server.h.
std::map<std::string, boost::any> ParameterServer::config [private] |
Definition at line 97 of file parameter_server.h.
std::map<std::string, std::string> ParameterServer::descriptions [private] |
Definition at line 98 of file parameter_server.h.
ros::NodeHandle ParameterServer::handle [private] |
Definition at line 102 of file parameter_server.h.
std::string ParameterServer::pre [private] |
Definition at line 101 of file parameter_server.h.