39 #ifndef ORO_TEMPLATE_CONSTRUCTOR_HPP 40 #define ORO_TEMPLATE_CONSTRUCTOR_HPP 43 #include "../internal/FusedFunctorDataSource.hpp" 44 #include "../internal/CreateSequence.hpp" 45 #include "../Logger.hpp" 47 #include <boost/type_traits/function_traits.hpp> 48 #include <boost/function.hpp> 50 #include "../rtt-config.h" 63 struct TemplateConstructor
64 :
public TypeConstructor
66 typedef typename boost::function_traits<S>::result_type
result_type;
67 typedef typename boost::function_traits<S>::arg1_type
arg1_type;
70 boost::function<S>
ff;
75 : ff(f), automatic(autom)
80 if ( args.size() != boost::function_traits<S>::arity )
90 if ( boost::function_traits<S>::arity != 1) {
104 std::vector<base::DataSourceBase::shared_ptr> args;
109 log(
Warning) <<
"Conversion from " << arg->getTypeName() <<
" to " << ret->getTypeName() <<
endlog();
121 template<
class Function>
134 template<
class Object>
TemplateConstructor(FInit f, bool autom)
TypeConstructor * newConstructor(Function *foo, bool automatic=false)
static type sources(std::vector< base::DataSourceBase::shared_ptr >::const_iterator args, int argnbr=1)
internal::create_sequence< typename boost::function_types::parameter_types< S >::type > SequenceFactory
boost::function_traits< S >::result_type result_type
virtual base::DataSourceBase::shared_ptr build(const std::vector< base::DataSourceBase::shared_ptr > &args) const
boost::function_traits< S >::arg1_type arg1_type
static const types::TypeInfo * getTypeInfo()
virtual base::DataSourceBase::shared_ptr convert(base::DataSourceBase::shared_ptr arg) const
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
static Logger::LogFunction endlog()