Orocos Real-Time Toolkit  2.9.0
Public Types | Public Member Functions | Public Attributes | List of all members
RTT::types::TemplateConstructor< S > Struct Template Reference

The constructor classes allow to define type constructors or type conversions (convert type B from type A). More...

#include <rtt/types/rtt-types-fwd.hpp>

Inheritance diagram for RTT::types::TemplateConstructor< S >:
RTT::types::TypeConstructor

Public Types

typedef boost::function_traits< S >::result_type result_type
 
typedef boost::function_traits< S >::arg1_type arg1_type
 
typedef internal::create_sequence< typename boost::function_types::parameter_types< S >::type > SequenceFactory
 

Public Member Functions

template<class FInit >
 TemplateConstructor (FInit f, bool autom)
 
virtual base::DataSourceBase::shared_ptr build (const std::vector< base::DataSourceBase::shared_ptr > &args) const
 Inspect args and return a type constructed with these args if such a constructor exists. More...
 
virtual base::DataSourceBase::shared_ptr convert (base::DataSourceBase::shared_ptr arg) const
 Automatic type conversion (float->double,... More...
 

Public Attributes

boost::function< S > ff
 
bool automatic
 

Detailed Description

template<class S>
struct RTT::types::TemplateConstructor< S >

The constructor classes allow to define type constructors or type conversions (convert type B from type A).

See also
TypeInfo::addConstructor()
Parameters
SThe function Signature, should at least have one argument and must return non-void.

Definition at line 23 of file rtt-types-fwd.hpp.

Member Typedef Documentation

template<class S>
typedef boost::function_traits<S>::arg1_type RTT::types::TemplateConstructor< S >::arg1_type

Definition at line 67 of file TemplateConstructor.hpp.

template<class S>
typedef boost::function_traits<S>::result_type RTT::types::TemplateConstructor< S >::result_type

Definition at line 66 of file TemplateConstructor.hpp.

template<class S>
typedef internal::create_sequence<typename boost::function_types::parameter_types<S>::type> RTT::types::TemplateConstructor< S >::SequenceFactory

Definition at line 68 of file TemplateConstructor.hpp.

Constructor & Destructor Documentation

template<class S>
template<class FInit >
RTT::types::TemplateConstructor< S >::TemplateConstructor ( FInit  f,
bool  autom 
)
inline

Definition at line 74 of file TemplateConstructor.hpp.

Member Function Documentation

template<class S>
virtual base::DataSourceBase::shared_ptr RTT::types::TemplateConstructor< S >::build ( const std::vector< base::DataSourceBase::shared_ptr > &  args) const
inlinevirtual

Inspect args and return a type constructed with these args if such a constructor exists.

Implements RTT::types::TypeConstructor.

Definition at line 78 of file TemplateConstructor.hpp.

References RTT::types::TemplateConstructor< S >::ff, and RTT::internal::create_sequence_impl< List, mpl::size< List >::value >::sources().

Referenced by RTT::types::TemplateConstructor< S >::convert().

template<class S>
virtual base::DataSourceBase::shared_ptr RTT::types::TemplateConstructor< S >::convert ( base::DataSourceBase::shared_ptr  arg) const
inlinevirtual

Automatic type conversion (float->double,...

). Fails by default.

Reimplemented from RTT::types::TypeConstructor.

Definition at line 89 of file TemplateConstructor.hpp.

References RTT::types::TemplateConstructor< S >::build(), RTT::internal::DataSourceTypeInfo< T >::getTypeInfo(), and RTT::Warning.

Member Data Documentation

template<class S>
bool RTT::types::TemplateConstructor< S >::automatic

Definition at line 71 of file TemplateConstructor.hpp.

Referenced by RTT::types::newConstructor().

template<class S>
boost::function<S> RTT::types::TemplateConstructor< S >::ff

Definition at line 70 of file TemplateConstructor.hpp.

Referenced by RTT::types::TemplateConstructor< S >::build().


The documentation for this struct was generated from the following files: