39 #ifndef ORO_OPERATION_INTERFACE_PART_FUSED_HPP 40 #define ORO_OPERATION_INTERFACE_PART_FUSED_HPP 43 #include <boost/shared_ptr.hpp> 44 #include <boost/function_types/result_type.hpp> 45 #include <boost/function_types/parameter_types.hpp> 47 #include <boost/version.hpp> 48 #if BOOST_VERSION >= 104100 50 #ifndef BOOST_FUSION_UNFUSED_MAX_ARITY 51 #define BOOST_FUSION_UNFUSED_MAX_ARITY 7 53 #include <boost/functional/forward_adapter.hpp> 54 #include <boost/fusion/functional/generation/make_unfused.hpp> 57 #ifndef BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY 58 #define BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY 7 60 #include <boost/fusion/include/make_unfused_generic.hpp> 69 #include "../OperationInterfacePart.hpp" 70 #include "../FactoryExceptions.hpp" 71 #include "../Operation.hpp" 72 #include "../base/OperationCallerBase.hpp" 86 static std::vector<ArgumentDescription> getArgumentList(
base::OperationBase* ob,
const int arity, std::vector<std::string>
const& types);
93 template<
typename Signature>
98 typedef typename boost::function_traits<Signature>::result_type
result_type;
119 std::vector<std::string> types;
121 types.push_back( SequenceFactory::GetType(i) );
130 unsigned int arity()
const {
return boost::function_traits<Signature>::arity; }
136 return SequenceFactory::GetTypeInfo(arg);
139 unsigned int collectArity()
const {
return boost::function_traits< typename CollectType<Signature>::type >::arity; }
143 return CollectSequenceFactory::GetTypeInfo(arg);
147 const std::vector<base::DataSourceBase::shared_ptr>& args,
ExecutionEngine* caller)
const 167 const unsigned int carity = boost::mpl::size<typename FusedMCollectDataSource<Signature>::handle_and_arg_types>::value;
168 assert( carity == collectArity() + 1 );
174 #ifdef ORO_SIGNALLING_OPERATIONS 186 #ifdef ORO_SIGNALLING_OPERATIONS 191 template<
typename Signature>
192 class EventOperationInterfacePartFused
195 typedef typename boost::function_traits<Signature>::result_type
result_type;
210 if ( subscriber == impl->getMessageProcessor() )
215 #if BOOST_VERSION >= 104100 216 #if __cplusplus > 199711L 221 typedef typename boost::fusion::result_of::make_unfused< decltype(invoke_fused) >::type unfused_type;
222 return this->op->signals(boost::forward_adapter<unfused_type>(boost::fusion::make_unfused(invoke_fused)));
223 #else // __cplusplus > 199711L 224 return this->op->signals(
231 #endif // __cplusplus > 199711L 232 #else // BOOST_VERSION >= 104100 233 return this->op->signals(
240 #endif // BOOST_VERSION >= 104100 243 #endif // ORO_SIGNALLING_OPERATIONS 250 template<
typename Signature>
254 typedef typename boost::function_traits<Signature>::result_type
result_type;
270 #ifdef ORO_SIGNALLING_OPERATIONS 285 std::vector<std::string> types;
287 types.push_back( SequenceFactory::GetType(i) );
296 unsigned int arity()
const {
return boost::function_traits<Signature>::arity; }
302 return SequenceFactory::GetTypeInfo(arg);
305 unsigned int collectArity()
const {
return boost::function_traits< typename CollectType<Signature>::type >::arity; }
309 return CollectSequenceFactory::GetTypeInfo(arg);
313 const std::vector<base::DataSourceBase::shared_ptr>& args,
ExecutionEngine* caller)
const 334 template<
typename Signature,
typename ObjT>
340 typedef typename boost::function_traits<Signature>::result_type
result_type;
350 typedef std::vector<base::DataSourceBase::shared_ptr>
ArgList;
357 unsigned int arity()
const {
return boost::function_traits<Signature>::arity - 1; }
363 return SequenceFactory::GetTypeInfo(arg);
366 unsigned int collectArity()
const {
return boost::function_traits< typename CollectType<Signature>::type >::arity; }
370 return CollectSequenceFactory::GetTypeInfo(arg);
383 std::vector<ArgumentDescription> ret;
384 descr.resize( 1 + arity() * 2 );
385 for (
unsigned int i =1; i < descr.size(); i +=2 )
386 ret.push_back(
ArgumentDescription(descr[i],descr[i+1], SequenceFactory::GetType((i-1)/2+2)) );
395 a2.reserve(args.size()+1);
397 a2.insert(a2.end(), args.begin(), args.end());
406 a2.reserve(args.size()+1);
408 a2.insert(a2.end(), args.begin(), args.end());
419 const unsigned int carity = boost::mpl::size<typename FusedMCollectDataSource<Signature>::handle_and_arg_types>::value;
420 assert( carity == collectArity() + 1 );
425 #ifdef ORO_SIGNALLING_OPERATIONS 429 if ( subscriber == impl->getMessageProcessor() )
433 a2.reserve(args.size()+1);
435 a2.insert(a2.end(), args.begin(), args.end());
437 #if BOOST_VERSION >= 104100 438 #if __cplusplus > 199711L 443 typedef typename boost::fusion::result_of::make_unfused< decltype(invoke_fused) >::type unfused_type;
444 return this->op->signals(boost::forward_adapter<unfused_type>(boost::fusion::make_unfused(invoke_fused)));
445 #else // __cplusplus > 199711L 446 return this->op->signals(
453 #endif // __cplusplus > 199711L 454 #else // BOOST_VERSION >= 104100 455 return this->op->signals(
462 #endif // BOOST_VERSION >= 104100 464 #endif // ORO_SIGNALLING_OPERATIONS
virtual std::vector< ArgumentDescription > getArgumentList() const
virtual base::OperationCallerBase< Signature >::shared_ptr getOperationCaller()
std::vector< base::DataSourceBase::shared_ptr > ArgList
virtual base::DataSourceBase::shared_ptr produceSend(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
create_sequence< typename boost::function_types::parameter_types< Signature >::type > SequenceFactory
The factory for converting data sources to C++ types in call()
const types::TypeInfo * getArgumentType(unsigned int arg) const
virtual std::string getName() const
Operation< Signature > * op
virtual base::DataSourceBase::shared_ptr produceHandle() const
unsigned int arity() const
const types::TypeInfo * getArgumentType(unsigned int arg) const
std::string resultType() const
const types::TypeInfo * getCollectType(unsigned int arg) const
virtual std::string description() const
Operation< Signature > * op
OperationInterfacePartFusedDS(DataSource< boost::shared_ptr< ObjT > > *wp, Operation< Signature > *o)
boost::shared_ptr< OperationCallerInterface > shared_ptr
const types::TypeInfo * getCollectType(unsigned int arg) const
const types::TypeInfo * getArgumentType(unsigned int arg) const
const std::vector< std::string > & getDescriptions()
unsigned int arity() const
virtual std::string description() const
boost::shared_ptr< OperationCallerBase< F > > shared_ptr
virtual std::string description() const
virtual std::vector< ArgumentDescription > getArgumentList() const
virtual base::DataSourceBase::shared_ptr produceHandle() const
SynchronousOperationInterfacePartFused(Operation< Signature > *o)
Description of one Argument of a Command.
std::string resultType() const
create_sequence< typename boost::function_types::parameter_types< Signature >::type > SequenceFactory
unsigned int collectArity() const
std::string resultType() const
boost::function_traits< Signature >::result_type result_type
Based on the software pattern 'command', this interface allows execution of action objects...
base::DataSourceBase::shared_ptr produce(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
boost::function_traits< Signature >::result_type result_type
const types::TypeInfo * getCollectType(unsigned int arg) const
virtual base::DisposableInterface::shared_ptr getImplementation()
boost::shared_ptr< base::DisposableInterface > getLocalOperation() const
virtual std::vector< ArgumentDescription > getArgumentList() const
static std::vector< ArgumentDescription > getArgumentList(base::OperationBase *ob, const int arity, std::vector< std::string > const &types)
boost::intrusive_ptr< DataSource< T > > shared_ptr
static std::string description(base::OperationBase *ob)
static const types::TypeInfo * getTypeInfo()
unsigned int arity() const
virtual std::string getName() const
virtual base::DataSourceBase::shared_ptr produceCollect(const std::vector< base::DataSourceBase::shared_ptr > &args, DataSource< bool >::shared_ptr blocking) const
DataSource< boost::shared_ptr< ObjT > >::shared_ptr mwp
virtual base::DataSourceBase::shared_ptr produceHandle() const
base::DataSourceBase::shared_ptr produce(ArgList const &args, ExecutionEngine *caller) const
boost::shared_ptr< base::DisposableInterface > getLocalOperation() const
create_sequence< typename boost::function_types::parameter_types< typename CollectType< Signature >::type >::type > CollectSequenceFactory
The factory for converting data sources to C++ types in collect(). This includes SendHandle.
static const std::string & getQualifier()
create_sequence< typename boost::function_types::parameter_types< Signature >::type > SequenceFactory
The factory for converting data sources to C++ types in call()
base::DataSourceBase::shared_ptr produce(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
virtual base::DataSourceBase::shared_ptr produceSend(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
virtual base::DataSourceBase::shared_ptr produceCollect(const std::vector< base::DataSourceBase::shared_ptr > &args, DataSource< bool >::shared_ptr blocking) const
static const std::string & getType()
unsigned int collectArity() const
create_sequence< typename boost::function_types::parameter_types< typename CollectType< Signature >::type >::type > CollectSequenceFactory
boost::intrusive_ptr< DataSourceBase > shared_ptr
create_sequence< typename boost::function_types::parameter_types< typename CollectType< Signature >::type >::type > CollectSequenceFactory
The factory for converting data sources to C++ types in collect(). This includes SendHandle.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual base::DataSourceBase::shared_ptr produceCollect(const std::vector< base::DataSourceBase::shared_ptr > &args, internal::DataSource< bool >::shared_ptr blocking) const
boost::shared_ptr< base::DisposableInterface > getLocalOperation() const
const std::string & getName()
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
boost::function_traits< Signature >::result_type result_type
virtual std::string getName() const
Operation< Signature > * op
unsigned int collectArity() const
virtual base::DataSourceBase::shared_ptr produceSend(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
OperationInterfacePartFused(Operation< Signature > *o)