rosparam.h
Go to the documentation of this file.
1 #ifndef __RTT_ROSPARAM_ROSPARAM_H
2 #define __RTT_ROSPARAM_ROSPARAM_H
3 
4 #include <rtt/RTT.hpp>
5 #include <rtt/Property.hpp>
6 
7 #define RTT_ROSPARAM_EIGEN_SUPPORT
8 #ifdef RTT_ROSPARAM_EIGEN_SUPPORT
9  #include <Eigen/Dense>
10  #define eigen_matrix_xd Eigen::Matrix<double,Eigen::Dynamic,1>
11  #define eigen_matrix_xf Eigen::Matrix<float,Eigen::Dynamic,1>
12 #endif
13 
14 #ifndef ADD_ROSPARAM_SERVICE_CONSTRUCTOR
15 #define ADD_ROSPARAM_SERVICE_CONSTRUCTOR(return_type_str) \
16  ,get##return_type_str("get"#return_type_str) \
17  ,set##return_type_str("set"#return_type_str) \
18  ,get##return_type_str##Relative ("get"#return_type_str"Relative") \
19  ,set##return_type_str##Relative ("set"#return_type_str"Relative") \
20  ,get##return_type_str##Absolute ("get"#return_type_str"Absolute") \
21  ,set##return_type_str##Absolute ("set"#return_type_str"Absolute") \
22  ,get##return_type_str##Private ("get"#return_type_str"Private") \
23  ,set##return_type_str##Private ("set"#return_type_str"Private") \
24  ,get##return_type_str##ComponentPrivate ("get"#return_type_str"ComponentPrivate") \
25  ,set##return_type_str##ComponentPrivate ("set"#return_type_str"ComponentPrivate") \
26  ,get##return_type_str##ComponentRelative ("get"#return_type_str"ComponentRelative") \
27  ,set##return_type_str##ComponentRelative ("set"#return_type_str"ComponentRelative") \
28  ,get##return_type_str##ComponentAbsolute ("get"#return_type_str"ComponentAbsolute") \
29  ,set##return_type_str##ComponentAbsolute ("set"#return_type_str"ComponentAbsolute")
30 #endif
31 
32 #ifndef ADD_ROSPARAM_OPERATION_CALLER
33 #define ADD_ROSPARAM_OPERATION_CALLER(return_type_str) \
34  this->addOperationCaller(get##return_type_str); \
35  this->addOperationCaller(set##return_type_str); \
36  this->addOperationCaller(get##return_type_str##Relative); \
37  this->addOperationCaller(set##return_type_str##Relative); \
38  this->addOperationCaller(get##return_type_str##Absolute); \
39  this->addOperationCaller(set##return_type_str##Absolute); \
40  this->addOperationCaller(get##return_type_str##Private); \
41  this->addOperationCaller(set##return_type_str##Private); \
42  this->addOperationCaller(get##return_type_str##ComponentPrivate); \
43  this->addOperationCaller(set##return_type_str##ComponentPrivate); \
44  this->addOperationCaller(get##return_type_str##ComponentRelative); \
45  this->addOperationCaller(set##return_type_str##ComponentRelative); \
46  this->addOperationCaller(get##return_type_str##ComponentAbsolute); \
47  this->addOperationCaller(set##return_type_str##ComponentAbsolute);
48 #endif
49 
50 #ifndef DECLARE_ROSPARAM_OPERATION_CALLER
51 #define DECLARE_ROSPARAM_OPERATION_CALLER(return_type_str, return_type) \
52  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str; \
53  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str; \
54  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##Relative; \
55  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##Relative; \
56  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##Absolute; \
57  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##Absolute; \
58  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##Private; \
59  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##Private; \
60  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##ComponentPrivate; \
61  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##ComponentPrivate; \
62  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##ComponentRelative; \
63  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##ComponentRelative; \
64  RTT::OperationCaller<bool(const std::string &, return_type &)> get##return_type_str##ComponentAbsolute; \
65  RTT::OperationCaller<void(const std::string &, const return_type &)> set##return_type_str##ComponentAbsolute;
66 #endif
67 
68 namespace rtt_rosparam {
69 
70  typedef enum {
79 
81  {
82 
83  public:
84  static const int RELATIVE = rtt_rosparam::RELATIVE;
85  static const int ABSOLUTE = rtt_rosparam::ABSOLUTE;
86  static const int PRIVATE = rtt_rosparam::PRIVATE;
91 
93  RTT::ServiceRequester("rosparam",owner),
94  getAllRelative("getAllRelative"),
95  getAllAbsolute("getAllAbsolute"),
96  getAllPrivate("getAllPrivate"),
97  getAllComponentPrivate("getAllComponentPrivate"),
98  getAllComponentRelative("getAllComponentRelative"),
99  getAllComponentAbsolute("getAllComponentAbsolute"),
100  getAll("getAll"),
101  setAllRelative("setAllRelative"),
102  setAllAbsolute("setAllAbsolute"),
103  setAllPrivate("setAllPrivate"),
104  setAllComponentPrivate("setAllComponentPrivate"),
105  setAllComponentRelative("setAllComponentRelative"),
106  setAllComponentAbsolute("setAllComponentAbsolute"),
107  setAll("setAll"),
108  get("get"),
109  getParam("getParam"),
110  getRelative("getRelative"),
111  getAbsolute("getAbsolute"),
112  getPrivate("getPrivate"),
113  getComponentPrivate("getComponentPrivate"),
114  getComponentRelative("getComponentRelative"),
115  getComponentAbsolute("getComponentAbsolute"),
116  set("set"),
117  setParam("setParam"),
118  setRelative("setRelative"),
119  setAbsolute("setAbsolute"),
120  setPrivate("setPrivate"),
121  setComponentPrivate("setComponentPrivate"),
122  setComponentRelative("setComponentRelative"),
123  setComponentAbsolute("setComponentAbsolute")
124 
130  ADD_ROSPARAM_SERVICE_CONSTRUCTOR(VectorOfString)
131  ADD_ROSPARAM_SERVICE_CONSTRUCTOR(VectorOfDouble)
132  ADD_ROSPARAM_SERVICE_CONSTRUCTOR(VectorOfFloat)
135 
137  ADD_ROSPARAM_SERVICE_CONSTRUCTOR(EigenVectorXd)
138  ADD_ROSPARAM_SERVICE_CONSTRUCTOR(EigenVectorXf)
139 #endif
140 
141  {
148  this->addOperationCaller(getAll);
149 
156  this->addOperationCaller(setAll);
157 
158  this->addOperationCaller(get);
166 
167  this->addOperationCaller(set);
175 
181  ADD_ROSPARAM_OPERATION_CALLER(VectorOfString)
182  ADD_ROSPARAM_OPERATION_CALLER(VectorOfDouble)
183  ADD_ROSPARAM_OPERATION_CALLER(VectorOfFloat)
184  ADD_ROSPARAM_OPERATION_CALLER(VectorOfInt)
185  ADD_ROSPARAM_OPERATION_CALLER(VectorOfBool)
186 
187 #ifdef RTT_ROSPARAM_EIGEN_SUPPORT
188  ADD_ROSPARAM_OPERATION_CALLER(EigenVectorXd)
189  ADD_ROSPARAM_OPERATION_CALLER(EigenVectorXf)
190 #endif
191  }
192 
207 
216 
225 
226  DECLARE_ROSPARAM_OPERATION_CALLER(String, std::string)
227  DECLARE_ROSPARAM_OPERATION_CALLER(Double, double)
231  DECLARE_ROSPARAM_OPERATION_CALLER(VectorOfString, std::vector<std::string>)
232  DECLARE_ROSPARAM_OPERATION_CALLER(VectorOfDouble, std::vector<double>)
233  DECLARE_ROSPARAM_OPERATION_CALLER(VectorOfFloat, std::vector<float>)
234  DECLARE_ROSPARAM_OPERATION_CALLER(VectorOfInt, std::vector<int>)
235  DECLARE_ROSPARAM_OPERATION_CALLER(VectorOfBool, std::vector<bool>)
236 
237 #ifdef RTT_ROSPARAM_EIGEN_SUPPORT
240 #endif
241 
242  };
243 }
244 
245 #endif // ifndef __RTT_ROSPARAM_ROSPARAM_H
RTT::OperationCaller< bool(const std::string &)> getAbsolute
Definition: rosparam.h:211
RTT::OperationCaller< bool(const std::string &)> getComponentPrivate
Definition: rosparam.h:213
static const int PRIVATE
For backwards compatibility.
Definition: rosparam.h:86
RTT::OperationCaller< bool(const std::string &)> setComponentAbsolute
Definition: rosparam.h:224
RTT::OperationCaller< bool(const std::string &)> setRelative
Definition: rosparam.h:219
RTT::OperationCaller< bool(const std::string &, const std::string &)> getParam
Definition: rosparam.h:209
#define DECLARE_ROSPARAM_OPERATION_CALLER(return_type_str, return_type)
Definition: rosparam.h:51
RTT::OperationCaller< bool(void)> setAllComponentRelative
Definition: rosparam.h:204
Component resolution: "name" -> "COMPONENT_NAME/name".
Definition: rosparam.h:76
RTT::OperationCaller< bool(void)> setAllAbsolute
Definition: rosparam.h:201
RTT::OperationCaller< bool(void)> setAllComponentPrivate
Definition: rosparam.h:203
RTT::OperationCaller< bool(const std::string &)> setAbsolute
Definition: rosparam.h:220
Absolute resolution: "name" -> "/name".
Definition: rosparam.h:73
static const int COMPONENT_ABSOLUTE
For backwards compatibility.
Definition: rosparam.h:89
RTT::OperationCaller< bool(void)> setAll
Definition: rosparam.h:206
RTT::OperationCaller< bool(void)> setAllComponentAbsolute
Definition: rosparam.h:205
#define RTT_ROSPARAM_EIGEN_SUPPORT
Definition: rosparam.h:7
ServiceRequester(const std::string &name, TaskContext *owner=0)
RTT::OperationCaller< bool(const std::string &, const std::string &)> setParam
Definition: rosparam.h:218
RTT::OperationCaller< bool(const std::string &)> setComponentRelative
Definition: rosparam.h:223
RTT::OperationCaller< bool(void)> getAllComponentPrivate
Definition: rosparam.h:196
RTT::OperationCaller< bool(const std::string &)> getPrivate
Definition: rosparam.h:212
RTT::OperationCaller< bool(void)> getAllAbsolute
Definition: rosparam.h:194
RTT::OperationCaller< bool(void)> getAllComponentRelative
Definition: rosparam.h:197
RTT::OperationCaller< bool(void)> getAllComponentAbsolute
Definition: rosparam.h:198
RTT::OperationCaller< bool(void)> getAllPrivate
Definition: rosparam.h:195
RTT::OperationCaller< bool(void)> getAll
Definition: rosparam.h:199
RTT::OperationCaller< bool(const std::string &)> getComponentRelative
Definition: rosparam.h:214
RTT::OperationCaller< bool(void)> setAllPrivate
Definition: rosparam.h:202
static const int COMPONENT_PRIVATE
For backwards compatibility.
Definition: rosparam.h:87
RTT::OperationCaller< bool(const std::string &)> setComponentPrivate
Definition: rosparam.h:222
static const int COMPONENT_RELATIVE
For backwards compatibility.
Definition: rosparam.h:88
RTT::OperationCaller< bool(void)> getAllRelative
Definition: rosparam.h:193
#define eigen_matrix_xf
Definition: rosparam.h:11
RTT::OperationCaller< bool(const std::string &, const unsigned int)> set
Definition: rosparam.h:217
static const int COMPONENT
For backwards compatibility.
Definition: rosparam.h:90
Relative resolution: "name" -> "name".
Definition: rosparam.h:72
RTT::OperationCaller< bool(const std::string &)> getComponentAbsolute
Definition: rosparam.h:215
RTT::OperationCaller< bool(const std::string &)> getRelative
Definition: rosparam.h:210
ROSParam(RTT::TaskContext *owner)
For backwards compatibility, component resolution: COMPONENT_PRIVATE.
Definition: rosparam.h:92
Private resolution: "name" -> "~name".
Definition: rosparam.h:74
RTT::OperationCaller< bool(const std::string &, const unsigned int)> get
Definition: rosparam.h:208
static const int RELATIVE
Definition: rosparam.h:84
#define ADD_ROSPARAM_SERVICE_CONSTRUCTOR(return_type_str)
Definition: rosparam.h:15
static const int ABSOLUTE
For backwards compatibility.
Definition: rosparam.h:85
Component resolution: "name" -> "~COMPONENT_NAME/name".
Definition: rosparam.h:75
#define eigen_matrix_xd
Definition: rosparam.h:10
RTT::OperationCaller< bool(void)> setAllRelative
Definition: rosparam.h:200
#define ADD_ROSPARAM_OPERATION_CALLER(return_type_str)
Definition: rosparam.h:33
RTT::OperationCaller< bool(const std::string &)> setPrivate
Definition: rosparam.h:221
Component resolution: "name" -> "/COMPONENT_NAME/name".
Definition: rosparam.h:77
bool addOperationCaller(base::OperationCallerBaseInvoker &mbi)


rtt_rosparam
Author(s): Ruben Smits
autogenerated on Sat Jun 8 2019 18:05:28