Public Types | Public Member Functions | Protected Attributes | List of all members
RTT::types::PrimitiveTypeInfo< T, use_ostream > Class Template Reference

#include <PrimitiveTypeInfo.hpp>

Inheritance diagram for RTT::types::PrimitiveTypeInfo< T, use_ostream >:
Inheritance graph
[legend]

Public Types

typedef T DataType
 
- Public Types inherited from RTT::types::TemplateValueFactory< T >
typedef T DataType
 

Public Member Functions

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
 
virtual bool decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const
 
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > getSharedPtr ()
 
TypeInfogetTypeInfoObject () const
 
virtual const std::string & getTypeName () const
 
bool installTypeInfoObject (TypeInfo *ti)
 
virtual bool isStreamable () const
 
 PrimitiveTypeInfo (std::string name)
 
virtual std::istream & read (std::istream &os, base::DataSourceBase::shared_ptr out) const
 
virtual std::ostream & write (std::ostream &os, base::DataSourceBase::shared_ptr in) const
 
virtual ~PrimitiveTypeInfo ()
 
- Public Member Functions inherited from RTT::types::TypeInfoGenerator
virtual ~TypeInfoGenerator ()
 
- Public Member Functions inherited from RTT::types::TemplateValueFactory< T >
base::DataSourceBase::shared_ptr buildActionAlias (base::ActionInterface *action, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildAlias (std::string name, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const
 
virtual base::PropertyBasebuildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
 
virtual base::DataSourceBase::shared_ptr buildReference (void *ptr) const
 
virtual base::DataSourceBase::shared_ptr buildValue () const
 
base::AttributeBasebuildVariable (std::string name) const
 
- Public Member Functions inherited from RTT::types::ValueFactory
virtual ~ValueFactory ()
 
virtual base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr, int sizehint) const
 
virtual base::AttributeBasebuildVariable (std::string name, int sizehint) const
 
- Public Member Functions inherited from RTT::types::StreamFactory
virtual ~StreamFactory ()
 
virtual std::string toString (base::DataSourceBase::shared_ptr in) const
 
virtual bool fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const
 

Protected Attributes

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

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 70 of file PrimitiveTypeInfo.hpp.

Member Typedef Documentation

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

The given T parameter is the type of the DataSources.

Definition at line 82 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 91 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
virtual RTT::types::PrimitiveTypeInfo< T, use_ostream >::~PrimitiveTypeInfo ( )
inlinevirtual

Definition at line 96 of file PrimitiveTypeInfo.hpp.

Member Function Documentation

template<typename T, bool use_ostream = false>
virtual bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::composeType ( base::DataSourceBase::shared_ptr  source,
base::DataSourceBase::shared_ptr  result 
) const
inlinevirtual
template<typename T, bool use_ostream = false>
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveTypeInfo< T, use_ostream >::decomposeType ( base::DataSourceBase::shared_ptr  source) const
inlinevirtual
template<typename T, bool use_ostream = false>
virtual bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::decomposeType ( base::DataSourceBase::shared_ptr  source,
PropertyBag targetbag 
) const
inlinevirtual

Definition at line 161 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
boost::shared_ptr<PrimitiveTypeInfo<T, use_ostream> > RTT::types::PrimitiveTypeInfo< T, use_ostream >::getSharedPtr ( )
inline

Definition at line 100 of file PrimitiveTypeInfo.hpp.

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

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 122 of file PrimitiveTypeInfo.hpp.

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

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 126 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::installTypeInfoObject ( TypeInfo ti)
inlinevirtual

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< std::string, has_ostream >, RTT::types::TemplateTypeInfo< bool, true >, RTT::types::TemplateTypeInfo< rt_string, has_ostream >, RTT::types::TemplateTypeInfo< std::vector< double >, has_ostream >, RTT::types::TemplateTypeInfo< T, true >, RTT::types::TemplateTypeInfo< std::vector< T >, has_ostream >, RTT::types::TemplateTypeInfo< T, false >, RTT::types::MatrixTypeInfo< T, has_ostream >, RTT::types::StructTypeInfo< T, has_ostream >, RTT::types::SequenceTypeInfo< T, has_ostream >, RTT::types::SequenceTypeInfo< rt_string, true >, RTT::types::SequenceTypeInfo< std::string, true >, RTT::types::SequenceTypeInfo< std::vector< double >, true >, and RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream >.

Definition at line 106 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
virtual bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::isStreamable ( ) const
inlinevirtual

Returns true if this type is directly streamable using read()/write() or toString()/fromString().

Implements RTT::types::StreamFactory.

Reimplemented in RTT::types::BoolTypeInfo.

Definition at line 145 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
virtual std::istream& RTT::types::PrimitiveTypeInfo< T, use_ostream >::read ( std::istream &  os,
base::DataSourceBase::shared_ptr  out 
) const
inlinevirtual

Read a new value for this datasource from a human readable string. The default does nothing.

Implements RTT::types::StreamFactory.

Reimplemented in RTT::types::BoolTypeInfo.

Definition at line 136 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
virtual std::ostream& RTT::types::PrimitiveTypeInfo< T, use_ostream >::write ( std::ostream &  os,
base::DataSourceBase::shared_ptr  in 
) const
inlinevirtual

Output this datasource as a human readable string. The default just writes the type name in parentheses to os.

Implements RTT::types::StreamFactory.

Reimplemented in RTT::types::BoolTypeInfo.

Definition at line 128 of file PrimitiveTypeInfo.hpp.

Member Data Documentation

template<typename T, bool use_ostream = false>
boost::shared_ptr<PrimitiveTypeInfo<T, use_ostream> > RTT::types::PrimitiveTypeInfo< T, use_ostream >::mshared
protected

Definition at line 77 of file PrimitiveTypeInfo.hpp.

template<typename T, bool use_ostream = false>
const std::string RTT::types::PrimitiveTypeInfo< T, use_ostream >::tname
protected

Definition at line 76 of file PrimitiveTypeInfo.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:48