39 #ifndef ORO_COLLECT_SIGNATURE_HPP 40 #define ORO_COLLECT_SIGNATURE_HPP 42 #include <boost/function_types/function_type.hpp> 43 #include <boost/function_types/function_arity.hpp> 44 #include <boost/function_types/result_type.hpp> 45 #include <boost/function_types/parameter_types.hpp> 46 #include <boost/mpl/vector.hpp> 47 #include <boost/mpl/remove_if.hpp> 48 #include <boost/mpl/push_front.hpp> 49 #include <boost/mpl/not.hpp> 50 #include <boost/mpl/logical.hpp> 51 #include <boost/mpl/if.hpp> 52 #include <boost/type_traits.hpp> 53 #include "../SendStatus.hpp" 59 namespace ft=boost::function_types;
60 namespace mpl=boost::mpl;
80 typedef typename ft::result_type<F>::type ret_type;
81 typedef typename ft::parameter_types<F>::type arg_type;
82 typedef typename tt::remove_const< typename tt::remove_reference<ret_type>::type >
::type bare_ret_type;
83 typedef typename mpl::if_<
84 typename mpl::not_< typename tt::is_void<ret_type>::type >
::type,
85 typename mpl::push_front< arg_type, typename tt::add_reference< bare_ret_type >::type >
::type,
91 typedef typename mpl::remove_if< basic_sig, tt::is_const< tt::remove_reference<mpl::_1> > >::type no_const_sig;
93 typedef typename mpl::remove_if< no_const_sig, mpl::not_<tt::is_reference<mpl::_1> > >::type no_value_sig;
95 typedef typename mpl::push_front< no_value_sig, ret_type>::type fttype;
98 typedef typename ft::function_type<fttype>::type
Ft;
111 template<
int,
class Signature,
class ToCollect>
116 template<
class F,
class ToCollect>
127 return this->cimpl->collect();
134 return this->cimpl->collectIfDone();
144 template<
class F,
class ToCollect>
147 typedef typename boost::function_traits<F>::result_type
result_type;
148 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
160 return cimpl->collect( a1 );
167 return cimpl->collectIfDone( a1 );
174 template<
class F,
class ToCollect>
177 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
178 typedef typename boost::function_traits<F>::arg2_type
arg2_type;
190 return cimpl->collect(t1, t2);
197 return cimpl->collectIfDone(t1, t2);
204 template<
class F,
class ToCollect>
207 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
208 typedef typename boost::function_traits<F>::arg2_type
arg2_type;
209 typedef typename boost::function_traits<F>::arg3_type
arg3_type;
221 return cimpl->collect(t1, t2, t3);
228 return cimpl->collectIfDone(t1, t2, t3);
235 template<
class F,
class ToCollect>
238 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
239 typedef typename boost::function_traits<F>::arg2_type
arg2_type;
240 typedef typename boost::function_traits<F>::arg3_type
arg3_type;
241 typedef typename boost::function_traits<F>::arg4_type
arg4_type;
253 return cimpl->collect(t1, t2, t3, t4);
260 return cimpl->collectIfDone(t1, t2, t3, t4);
267 template<
class F,
class ToCollect>
270 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
271 typedef typename boost::function_traits<F>::arg2_type
arg2_type;
272 typedef typename boost::function_traits<F>::arg3_type
arg3_type;
273 typedef typename boost::function_traits<F>::arg4_type
arg4_type;
274 typedef typename boost::function_traits<F>::arg5_type
arg5_type;
286 return cimpl->collect(t1, t2, t3, t4, t5);
293 return cimpl->collectIfDone(t1, t2, t3, t4, t5);
300 template<
class F,
class ToCollect>
303 typedef typename boost::function_traits<F>::arg1_type
arg1_type;
304 typedef typename boost::function_traits<F>::arg2_type
arg2_type;
305 typedef typename boost::function_traits<F>::arg3_type
arg3_type;
306 typedef typename boost::function_traits<F>::arg4_type
arg4_type;
307 typedef typename boost::function_traits<F>::arg5_type
arg5_type;
308 typedef typename boost::function_traits<F>::arg6_type
arg6_type;
317 SendStatus collect(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6)
const 320 return cimpl->collect(t1, t2, t3, t4, t5, t6);
327 return cimpl->collectIfDone(t1, t2, t3, t4, t5, t6);
boost::function_traits< F >::arg2_type arg2_type
boost::function_traits< F >::result_type result_type
boost::function_traits< F >::arg4_type arg4_type
SendStatus collect(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5) const
Collect this operator if the method has four arguments.
ft::function_type< fttype >::type Ft
SendStatus collect(arg1_type t1, arg2_type t2) const
Collect this operator if the method has two arguments.
CollectSignature(ToCollect implementation)
boost::function_traits< F >::arg1_type arg1_type
CollectSignature(ToCollect implementation)
CollectSignature(ToCollect implementation)
SendStatus collect(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6) const
Collect this operator if the method has four arguments.
boost::function_traits< F >::arg2_type arg2_type
SendStatus collect() const
boost::function_traits< F >::arg2_type arg2_type
SendStatus collectIfDone(arg1_type a1) const
SendStatus collect(arg1_type t1, arg2_type t2, arg3_type t3) const
Collect this operator if the method has three arguments.
CollectSignature(ToCollect implementation)
boost::function_traits< F >::arg1_type arg1_type
boost::function_traits< F >::arg2_type arg2_type
CollectSignature(ToCollect implementation)
SendStatus
Returns the status of a send() or collect() invocation.
boost::function_traits< F >::arg4_type arg4_type
boost::function_traits< F >::arg3_type arg3_type
SendStatus collect(arg1_type a1) const
Collect this operator if the method has one argument.
boost::function_traits< F >::arg2_type arg2_type
CollectSignature(ToCollect implementation)
boost::function_traits< F >::arg5_type arg5_type
boost::function_traits< F >::arg1_type arg1_type
Returned when the result of the send() could not be collected.
SendStatus collect(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4) const
Collect this operator if the method has four arguments.
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6) const
boost::function_traits< F >::arg1_type arg1_type
boost::function_traits< F >::arg1_type arg1_type
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4) const
boost::function_traits< F >::arg3_type arg3_type
boost::function_traits< F >::arg3_type arg3_type
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3) const
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5) const
boost::function_traits< F >::arg1_type arg1_type
boost::function_traits< F >::arg6_type arg6_type
CollectSignature(ToCollect implementation)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
SendStatus collectIfDone(arg1_type t1, arg2_type t2) const
boost::function_traits< F >::arg3_type arg3_type
boost::function_traits< F >::arg5_type arg5_type
Used to implement collect(), given a Function Signature.
boost::function_traits< F >::arg4_type arg4_type
This helper struct decomposes F and creates Ft, as required by CollectBaseImpl.
SendStatus collectIfDone() const