17 #ifndef __sot_talos_balance_commands_helper_H__ 18 #define __sot_talos_balance_commands_helper_H__ 21 #include <dynamic-graph/command.h> 22 #include <dynamic-graph/command-direct-setter.h> 23 #include <dynamic-graph/command-direct-getter.h> 24 #include <dynamic-graph/command-bind.h> 26 #include <boost/function.hpp> 31 namespace talos_balance {
32 using ::dynamicgraph::command::makeDirectGetter;
33 using ::dynamicgraph::command::docDirectGetter;
34 using ::dynamicgraph::command::makeDirectSetter;
35 using ::dynamicgraph::command::docDirectSetter;
36 using ::dynamicgraph::command::makeCommandVoid0;
37 using ::dynamicgraph::command::docCommandVoid0;
38 using ::dynamicgraph::command::makeCommandVoid1;
39 using ::dynamicgraph::command::docCommandVoid1;
40 using ::dynamicgraph::command::makeCommandVoid2;
41 using ::dynamicgraph::command::docCommandVoid2;
42 using ::dynamicgraph::command::makeCommandVerbose;
43 using ::dynamicgraph::command::docCommandVerbose;
51 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
55 typedef boost::function<void(const T1&,const T2&,const T3&,const T4&,const T5&)>
function_t;
56 typedef boost::function<void(E*,const T1&,const T2&,const T3&,const T4&,const T5&)>
memberFunction_t;
60 const std::string& docString)
62 boost::assign::list_of
63 (ValueHelper<T1>::TypeID)
64 (ValueHelper<T2>::TypeID)
65 (ValueHelper<T3>::TypeID)
66 (ValueHelper<T4>::TypeID)
67 (ValueHelper<T5>::TypeID)
75 assert( getParameterValues().size() == 5 );
76 T1 val1 = getParameterValues()[0].value();
77 T2 val2 = getParameterValues()[1].value();
78 T3 val3 = getParameterValues()[2].value();
79 T4 val4 = getParameterValues()[3].value();
80 T5 val5 = getParameterValues()[4].value();
81 fptr(val1,val2,val3,val4,val5);
89 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
93 const std::string& docString)
98 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
101 boost::function<
void(E*,
const T1&,
const T2&,
const T3&,
const T4&,
const T5&)>
function,
102 const std::string& docString)
105 boost::bind(
function,&entity,_1,_2,_3,_4,_5),docString );
108 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
111 void (E::*
function) (
const T1&,
const T2&,
const T3&,
const T4&,
const T5&),
112 const std::string& docString)
115 boost::bind(
function,&entity,_1,_2,_3,_4,_5),
121 const std::string& type1,
122 const std::string& type2,
123 const std::string& type3,
124 const std::string& type4,
125 const std::string& type5)
127 return (std::string(
"\n")+doc+
"\n\n" 128 +
"Input:\n - A "+type1+
".\n" 129 +
"Input:\n - A "+type2+
".\n" 130 +
"Input:\n - A "+type3+
".\n" 131 +
"Input:\n - A "+type4+
".\n" 132 +
"Input:\n - A "+type5+
".\n" 133 +
"Void return.\n\n" );
136 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6 >
140 typedef boost::function<void(const T1&,const T2&,const T3&,const T4&,const T5&,const T6&)>
function_t;
141 typedef boost::function<void(E*,const T1&,const T2&,const T3&,const T4&,const T5&,const T6&)>
memberFunction_t;
145 const std::string& docString)
147 boost::assign::list_of
148 (ValueHelper<T1>::TypeID)
149 (ValueHelper<T2>::TypeID)
150 (ValueHelper<T3>::TypeID)
151 (ValueHelper<T4>::TypeID)
152 (ValueHelper<T5>::TypeID)
153 (ValueHelper<T6>::TypeID)
161 assert( getParameterValues().size() == 6 );
162 T1 val1 = getParameterValues()[0].value();
163 T2 val2 = getParameterValues()[1].value();
164 T3 val3 = getParameterValues()[2].value();
165 T4 val4 = getParameterValues()[3].value();
166 T5 val5 = getParameterValues()[4].value();
167 T6 val6 = getParameterValues()[5].value();
168 fptr(val1,val2,val3,val4,val5,val6);
176 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6 >
180 const std::string& docString)
185 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6 >
188 boost::function<
void(E*,
const T1&,
const T2&,
const T3&,
const T4&,
const T5&,
const T6&)>
function,
189 const std::string& docString)
192 boost::bind(
function,&entity,_1,_2,_3,_4,_5,_6),docString );
195 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6 >
198 void (E::*
function) (
const T1&,
const T2&,
const T3&,
const T4&,
const T5&,
const T6&),
199 const std::string& docString)
202 boost::bind(
function,&entity,_1,_2,_3,_4,_5,_6),
208 const std::string& type1,
209 const std::string& type2,
210 const std::string& type3,
211 const std::string& type4,
212 const std::string& type5,
213 const std::string& type6)
215 return (std::string(
"\n")+doc+
"\n\n" 216 +
"Input:\n - A "+type1+
".\n" 217 +
"Input:\n - A "+type2+
".\n" 218 +
"Input:\n - A "+type3+
".\n" 219 +
"Input:\n - A "+type4+
".\n" 220 +
"Input:\n - A "+type5+
".\n" 221 +
"Input:\n - A "+type6+
".\n" 222 +
"Void return.\n\n" );
225 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7 >
229 typedef boost::function<void(const T1&,const T2&,const T3&,const T4&,const T5&,const T6&,const T7&)>
function_t;
230 typedef boost::function<void(E*,const T1&,const T2&,const T3&,const T4&,const T5&,const T6&,const T7&)>
memberFunction_t;
231 typedef void (E::*
memberFunction_ptr_t) (
const T1&,
const T2&,
const T3&,
const T4&,
const T5&,
const T6&,
const T7&);
234 const std::string& docString)
236 boost::assign::list_of
237 (ValueHelper<T1>::TypeID)
238 (ValueHelper<T2>::TypeID)
239 (ValueHelper<T3>::TypeID)
240 (ValueHelper<T4>::TypeID)
241 (ValueHelper<T5>::TypeID)
242 (ValueHelper<T6>::TypeID)
243 (ValueHelper<T7>::TypeID)
251 assert( getParameterValues().size() == 7 );
252 T1 val1 = getParameterValues()[0].value();
253 T2 val2 = getParameterValues()[1].value();
254 T3 val3 = getParameterValues()[2].value();
255 T4 val4 = getParameterValues()[3].value();
256 T5 val5 = getParameterValues()[4].value();
257 T6 val6 = getParameterValues()[5].value();
258 T7 val7 = getParameterValues()[6].value();
259 fptr(val1,val2,val3,val4,val5,val6,val7);
267 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7 >
271 const std::string& docString)
276 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7 >
279 boost::function<
void(E*,
const T1&,
const T2&,
const T3&,
const T4&,
const T5&,
const T6&,
const T7&)>
function,
280 const std::string& docString)
283 boost::bind(
function,&entity,_1,_2,_3,_4,_5,_6,_7),docString );
286 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7 >
289 void (E::*
function) (
const T1&,
const T2&,
const T3&,
const T4&,
const T5&,
const T6&,
const T7&),
290 const std::string& docString)
293 boost::bind(
function,&entity,_1,_2,_3,_4,_5,_6,_7),
299 const std::string& type1,
300 const std::string& type2,
301 const std::string& type3,
302 const std::string& type4,
303 const std::string& type5,
304 const std::string& type6,
305 const std::string& type7)
307 return (std::string(
"\n")+doc+
"\n\n" 308 +
"Input:\n - A "+type1+
".\n" 309 +
"Input:\n - A "+type2+
".\n" 310 +
"Input:\n - A "+type3+
".\n" 311 +
"Input:\n - A "+type4+
".\n" 312 +
"Input:\n - A "+type5+
".\n" 313 +
"Input:\n - A "+type6+
".\n" 314 +
"Input:\n - A "+type7+
".\n" 315 +
"Void return.\n\n" );
324 #endif // __sot_talos_balance_commands_helper_H__ std::string docCommandVoid6(const std::string &doc, const std::string &type1, const std::string &type2, const std::string &type3, const std::string &type4, const std::string &type5, const std::string &type6)
CommandVoid6< E, T1, T2, T3, T4, T5, T6 > * makeCommandVoid6(E &entity, void(E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &), const std::string &docString)
boost::function< void(E *, const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &)> memberFunction_t
CommandVoid5(E &entity, function_t function, const std::string &docString)
virtual Value doExecute()
boost::function< void(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &)> function_t
CommandVoid7< E, T1, T2, T3, T4, T5, T6, T7 > * makeCommandVoid7(E &entity, void(E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &), const std::string &docString)
std::string docCommandVoid5(const std::string &doc, const std::string &type1, const std::string &type2, const std::string &type3, const std::string &type4, const std::string &type5)
virtual Value doExecute()
void(E::* memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &)
boost::function< void(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &)> function_t
boost::function< void(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &)> function_t
boost::function< void(E *, const T1 &, const T2 &, const T3 &, const T4 &, const T5 &, const T6 &, const T7 &)> memberFunction_t
CommandVoid5< E, T1, T2, T3, T4, T5 > * makeCommandVoid5(E &entity, void(E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, const T5 &), const std::string &docString)
virtual Value doExecute()
CommandVoid7(E &entity, function_t function, const std::string &docString)
boost::function< void(E *, const T1 &, const T2 &, const T3 &, const T4 &, const T5 &)> memberFunction_t
std::string docCommandVoid7(const std::string &doc, const std::string &type1, const std::string &type2, const std::string &type3, const std::string &type4, const std::string &type5, const std::string &type6, const std::string &type7)
CommandVoid6(E &entity, function_t function, const std::string &docString)