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) |
Static Public Member Functions | |
| static ParameterServer * | instance () |
Private Member Functions | |
| void | defaultConfig () |
| template<typename T > | |
| T | getFromParameterServer (const std::string param, T def) |
| void | getValues () |
| ParameterServer () | |
Private Attributes | |
| std::map< std::string, boost::any > | config |
| 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 20 of file parameter_server.h.
| ParameterServer::ParameterServer | ( | ) | [private] |
Default constructor private, because of singleton
Definition at line 11 of file parameter_server.cpp.
| void ParameterServer::defaultConfig | ( | ) | [private] |
Loads the default configuration
Definition at line 31 of file parameter_server.cpp.
| T ParameterServer::get | ( | const std::string | param | ) | [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 35 of file parameter_server.h.
| 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 76 of file parameter_server.h.
| void ParameterServer::getValues | ( | ) | [private] |
Receives all values from the parameter server and store them in the map 'config'. Will be called in the constructor
Definition at line 58 of file parameter_server.cpp.
| ParameterServer * ParameterServer::instance | ( | ) | [static] |
Returns the singleton instance
Definition at line 20 of file parameter_server.cpp.
ParameterServer * ParameterServer::_instance = NULL [static, private] |
Definition at line 44 of file parameter_server.h.
std::map<std::string, boost::any> ParameterServer::config [private] |
Definition at line 42 of file parameter_server.h.
ros::NodeHandle ParameterServer::handle [private] |
Definition at line 46 of file parameter_server.h.
std::string ParameterServer::pre [private] |
Definition at line 45 of file parameter_server.h.