39 #ifndef ORO_REMOTE_METHOD_HPP 40 #define ORO_REMOTE_METHOD_HPP 42 #include <boost/function.hpp> 44 #include "../base/OperationCallerBase.hpp" 49 #include <boost/fusion/include/vector_tie.hpp> 50 #include <boost/fusion/include/filter_if.hpp> 51 #include <boost/fusion/include/as_vector.hpp> 59 namespace bf = ::boost::fusion;
70 template<
class OperationCallerT>
82 typedef typename boost::function_traits<OperationCallerT>::result_type
result_type;
95 : mmeth(), mhandle(handle)
99 virtual bool isError()
const {
return false; }
107 template<
class Xignored>
110 return sendargs.getResult();
115 sendargs.store( a1 );
117 return sendargs.getResult();
120 template<
class T1,
class T2>
122 sendargs.store( a1, a2 );
124 return sendargs.getResult();
127 template<
class T1,
class T2,
class T3>
129 sendargs.store( a1, a2, a3 );
131 return sendargs.getResult();
134 template<
class T1,
class T2,
class T3,
class T4>
136 sendargs.store( a1, a2, a3, a4 );
138 return sendargs.getResult();
141 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6>
142 result_type
call_impl( T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6 ) {
143 sendargs.store( a1, a2, a3, a4, a5, a6 );
145 return sendargs.getResult();
148 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
class T7>
149 result_type
call_impl( T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7 ) {
150 sendargs.store( a1, a2, a3, a4, a5, a6, a7 );
152 return sendargs.getResult();
155 template<
class T1,
class T2,
class T3,
class T4,
class T5>
156 result_type
call_impl( T1 a1, T2 a2, T3 a3, T4 a4, T5 a5 ) {
157 sendargs.store( a1, a2, a3, a4, a5 );
159 return sendargs.getResult();
163 mhandle = mmeth.
send();
170 sendargs.store( a1 );
171 mhandle = mmeth.
send();
175 template<
class T1,
class T2>
177 sendargs.store( a1, a2 );
178 mhandle = mmeth.
send();
182 template<
class T1,
class T2,
class T3>
184 sendargs.store( a1, a2, a3 );
185 mhandle = mmeth.
send();
189 template<
class T1,
class T2,
class T3,
class T4>
191 sendargs.store( a1, a2, a3, a4 );
192 mhandle = mmeth.
send();
196 template<
class T1,
class T2,
class T3,
class T4,
class T5>
198 sendargs.store( a1, a2, a3, a4, a5 );
199 mhandle = mmeth.
send();
203 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6>
205 sendargs.store( a1, a2, a3, a4, a5, a6 );
206 mhandle = mmeth.
send();
210 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
class T7>
212 sendargs.store( a1, a2, a3, a4, a5, a6, a7 );
213 mhandle = mmeth.
send();
226 collectargs.store( a1 );
233 template<
class T1,
class T2>
235 collectargs.store( a1, a2);
242 template<
class T1,
class T2,
class T3>
244 collectargs.store( a1, a2, a3);
251 template<
class T1,
class T2,
class T3,
class T4>
253 collectargs.store( a1, a2, a3, a4);
260 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6>
262 collectargs.store( a1, a2, a3, a4, a5, a6);
269 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
class T7>
271 collectargs.store( a1, a2, a3, a4, a5, a6, a7 );
278 template<
class T1,
class T2,
class T3,
class T4,
class T5>
280 collectargs.store( a1, a2, a3, a4, a5);
292 collectargs.store( a1 );
296 template<
class T1,
class T2>
298 collectargs.store( a1, a2);
302 template<
class T1,
class T2,
class T3>
304 collectargs.store( a1, a2, a3);
308 template<
class T1,
class T2,
class T3,
class T4>
310 collectargs.store( a1, a2, a3, a4);
314 template<
class T1,
class T2,
class T3,
class T4,
class T5>
316 collectargs.store( a1, a2, a3, a4, a5);
322 return sendargs.getResult();
333 sendargs.store( a1 );
335 return sendargs.getResult();
338 template<
class T1,
class T2>
341 sendargs.store( a1, a2 );
343 return sendargs.getResult();
346 template<
class T1,
class T2,
class T3>
349 sendargs.store( a1, a2, a3 );
351 return sendargs.getResult();
354 template<
class T1,
class T2,
class T3,
class T4>
357 sendargs.store( a1, a2, a3, a4 );
359 return sendargs.getResult();
362 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6>
363 result_type
ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
365 sendargs.store( a1, a2, a3, a4, a5, a6 );
367 return sendargs.getResult();
370 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6,
class T7>
371 result_type
ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
373 sendargs.store( a1, a2, a3, a4, a5, a6, a7 );
375 return sendargs.getResult();
378 template<
class T1,
class T2,
class T3,
class T4,
class T5>
379 result_type
ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
381 sendargs.store( a1, a2, a3, a4, a5);
383 return sendargs.getResult();
403 template<
class OperationCallerT>
405 :
public Invoker<OperationCallerT,RemoteOperationCallerImpl<OperationCallerT> >
SendStatus collect_impl(T1 &a1)
virtual bool ready() const
virtual bool isError() const
result_type call_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
SendStatus collect_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5)
SendStatus collectIfDone_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5, T6 &a6)
SendStatus collectIfDone_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4)
result_type ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
virtual void setCaller(ExecutionEngine *caller)
SendStatus collectIfDone_impl()
virtual base::OperationCallerBase< OperationCallerT > * cloneI(ExecutionEngine *caller) const
SendHandle< Signature > send_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
virtual void setCaller(ExecutionEngine *ee)
result_type ret_impl(T1 a1)
SendHandle< Signature > send_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
DataSourceStorage< OperationCallerT > sendargs
SendStatus collectIfDone_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5)
SendHandle< Signature > send_impl(T1 a1, T2 a2, T3 a3, T4 a4)
SendStatus collect_impl()
void setAutoCollect(bool on_off)
virtual void executeAndDispose()
result_type call_impl(T1 a1, T2 a2, T3 a3, T4 a4)
RemoteOperationCaller(OperationInterfacePart *of, std::string name, ExecutionEngine *caller=0)
SendStatus collectIfDone_impl(T1 &a1, T2 &a2)
result_type ret_impl(T1 a1, T2 a2, T3 a3, T4 a4)
result_type call_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
SendStatus collect_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4)
SendHandle< Signature > send_impl(T1 a1, T2 a2, T3 a3)
SendStatus collect_impl(T1 &a1, T2 &a2)
RemoteOperationCallerImpl(SendHandleC handle)
result_type call_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
result_type ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
The SendHandle is used to collect the result values of an asynchronous invocation. The template argument Signature must have the same type as the method being invoked.
SendHandle< Signature > send_impl(T1 a1)
OperationCallerT Signature
SendStatus collectIfDone_impl(T1 &a1)
SendStatus collectIfDone()
DataSourceStorage< typename CollectType< OperationCallerT >::type > collectargs
SendHandle< Signature > send_impl()
RemoteOperationCallerImpl()
SendHandle< Signature > send_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
SendHandle< Signature > send_impl(T1 a1, T2 a2)
SendStatus collect_impl(T1 &a1, T2 &a2, T3 &a3)
result_type ret_impl(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
result_type ret_impl(T1 a1, T2 a2)
SendStatus collectIfDone_impl(T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5, T6 &a6, T7 &a7)
std::string const & getName() const
result_type call_impl(T1 a1)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
OperationInterfacePart * getOrp() const
RemoteOperationCaller(const SendHandleC &sh)
result_type ret_impl(T1 a1, T2 a2, T3 a3)
result_type call_impl(T1 a1, T2 a2)
result_type call_impl(T1 a1, T2 a2, T3 a3)
SendStatus collectIfDone_impl(T1 &a1, T2 &a2, T3 &a3)
OperationCallerT Signature
boost::function_traits< OperationCallerT >::result_type result_type