Orocos Real-Time Toolkit  2.6.0
Public Types | Public Member Functions | Protected Attributes
RTT::types::PrimitiveTypeInfo< T, use_ostream > Class Template Reference

This template class allows primitive types, which are not sent over ports, to be added to Orocos. More...

#include <rtt/types/PrimitiveTypeInfo.hpp>

Inheritance diagram for RTT::types::PrimitiveTypeInfo< T, use_ostream >:
RTT::types::TypeInfoGenerator RTT::types::TemplateTypeInfo< T, use_ostream > RTT::types::TemplateTypeInfo< T, false > RTT::types::TemplateTypeInfo< T, has_ostream > RTT::types::TemplateTypeInfo< T, true > RTT::types::SequenceTypeInfo< rt_string, true > RTT::types::SequenceTypeInfo< std::string, true > RTT::types::SequenceTypeInfo< std::vector< double >, true > RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream > RTT::types::EnumTypeInfo< T > RTT::types::SequenceTypeInfo< T, has_ostream > RTT::types::StructTypeInfo< T, has_ostream > RTT::types::StdTypeInfo< T >

List of all members.

Public Types

typedef T DataType
 The given T parameter is the type of the DataSources.

Public Member Functions

 PrimitiveTypeInfo (std::string name)
 Setup Type Information for type name.
boost::shared_ptr
< PrimitiveTypeInfo< T,
use_ostream > > 
getSharedPtr ()
bool installTypeInfoObject (TypeInfo *ti)
 Installs the type info object in the global data source type info handler and adds any additional features to the type info object.
TypeInfogetTypeInfoObject () const
 Returns the TypeInfo object of this type, or null if none exists yet.
virtual const std::string & getTypeName () const
 Return the type name for which this generator generates type info features.
virtual std::ostream & write (std::ostream &os, base::DataSourceBase::shared_ptr in) const
virtual std::istream & read (std::istream &os, base::DataSourceBase::shared_ptr out) const
virtual bool isStreamable () const
virtual bool composeType (base::DataSourceBase::shared_ptr source, base::DataSourceBase::shared_ptr result) const
virtual
base::DataSourceBase::shared_ptr 
decomposeType (base::DataSourceBase::shared_ptr source) const
 A primitive type is decomposed into itself.
virtual bool decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const
base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const
base::AttributeBasebuildVariable (std::string name) const
base::AttributeBasebuildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const
base::AttributeBasebuildAlias (std::string name, base::DataSourceBase::shared_ptr in) const
base::DataSourceBase::shared_ptr buildActionAlias (base::ActionInterface *action, base::DataSourceBase::shared_ptr in) const
virtual base::PropertyBasebuildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
virtual
base::DataSourceBase::shared_ptr 
buildValue () const
virtual
base::DataSourceBase::shared_ptr 
buildReference (void *ptr) const
Type building/factory functions

Used to create objects that hold data of a certain type.

virtual base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr, int sizehint) const
 Build a non modifyable instance of this type.
virtual base::AttributeBasebuildVariable (std::string name, int sizehint) const
 Build a modifyable instance of this type.
Conversion to/from text

Used to convert data to human readable text and vice versa.

virtual std::string toString (base::DataSourceBase::shared_ptr in) const
 Usability function which converts data to a string.
virtual bool fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const
 Usability function which converts a string to data.

Protected Attributes

const std::string tname
boost::shared_ptr
< PrimitiveTypeInfo< T,
use_ostream > > 
mshared

Detailed Description

template<typename T, bool use_ostream = false>
class RTT::types::PrimitiveTypeInfo< T, use_ostream >

This template class allows primitive types, which are not sent over ports, to be added to Orocos.

The type is known to the type system, but you can not use it in flow ports.

Parameters:
TThe user class type.
use_ostreamWhen set to true, the class will use operator<<(std::ostream&, T) to write out the type to a stream. When set to false, the class will use this function and write '( type name )' to a stream instead. Defaults to false. Set to true if your class T has the above mentioned function.
See also:
TypeInfoRepository.
operator<<
StructTypeInfo, SequenceTypeInfo, CArrayTypeInfo, BoostArrayTypeInfo

Definition at line 32 of file PrimitiveTypeInfo.hpp.


Constructor & Destructor Documentation

template<typename T, bool use_ostream = false>
RTT::types::PrimitiveTypeInfo< T, use_ostream >::PrimitiveTypeInfo ( std::string  name) [inline]

Setup Type Information for type name.

This causes a switch from 'unknown' type to basic type information for type T.

Parameters:
namethe 'Orocos' type name.

Definition at line 53 of file PrimitiveTypeInfo.hpp.


Member Function Documentation

AttributeBase * RTT::ValueFactory::buildConstant ( std::string  name,
base::DataSourceBase::shared_ptr  dsb,
int  sizehint 
) const [virtual, inherited]

Build a non modifyable instance of this type.

Parameters:
sizehintFor variable size instances, use it to hint the size of the instance.

Definition at line 14 of file ValueFactory.cpp.

AttributeBase * RTT::ValueFactory::buildVariable ( std::string  name,
int  sizehint 
) const [virtual, inherited]

Build a modifyable instance of this type.

Parameters:
sizehintFor variable size instances, use it to hint the size of the instance.

Reimplemented in RTT::types::CArrayTypeInfo< T, has_ostream >.

Definition at line 10 of file ValueFactory.cpp.

template<typename T, bool use_ostream = false>
TypeInfo* RTT::types::PrimitiveTypeInfo< T, use_ostream >::getTypeInfoObject ( ) const [inline, virtual]

Returns the TypeInfo object of this type, or null if none exists yet.

Returns:
All generators should return here TypeInfoRepository::Instance()->getTypeInfo<T>();

Implements RTT::types::TypeInfoGenerator.

Definition at line 83 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
virtual const std::string& RTT::types::PrimitiveTypeInfo< T, use_ostream >::getTypeName ( ) const [inline, virtual]

Return the type name for which this generator generates type info features.

This name will be aliased by the TypeInfo object.

Implements RTT::types::TypeInfoGenerator.

Definition at line 87 of file PrimitiveTypeInfo.hpp.

Referenced by RTT::types::EnumTypeInfo< T >::decomposeType().

template<typename T, bool use_ostream = false>
bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::installTypeInfoObject ( TypeInfo ti) [inline, virtual]

Installs the type info object in the global data source type info handler and adds any additional features to the type info object.

This method will be called by the TypeInfoRepository, in order to register this type's factories into the TypeInfo object.

Parameters:
tiA valid TypeInfo object into which new features may be installed
Returns:
true if this object may be deleted, false if not.
Postcondition:
When true is returned, this instance is still valid and the caller (TypeInfoRepository) will delete it. When false is returned, the validity is undefined and the instance will not be used anymore by the caller.

Implements RTT::types::TypeInfoGenerator.

Reimplemented in RTT::types::TemplateTypeInfo< T, use_ostream >, RTT::types::TemplateTypeInfo< T, has_ostream >, RTT::types::TemplateTypeInfo< rt_string, has_ostream >, RTT::types::TemplateTypeInfo< std::vector< T >, has_ostream >, RTT::types::TemplateTypeInfo< std::string, has_ostream >, RTT::types::TemplateTypeInfo< T, true >, RTT::types::TemplateTypeInfo< bool >, RTT::types::TemplateTypeInfo< std::vector< double >, has_ostream >, RTT::types::TemplateTypeInfo< T, false >, RTT::types::BoostArrayTypeInfo< T, has_ostream >, RTT::types::EnumTypeInfo< T >, RTT::types::CArrayTypeInfo< T, has_ostream >, and RTT::types::StructTypeInfo< T, has_ostream >.

Definition at line 68 of file PrimitiveTypeInfo.hpp.


The documentation for this class was generated from the following file: