Orocos Real-Time Toolkit
2.8.3
|
This template class allows primitive types, which are not sent over ports, to be added to Orocos. More...
#include <rtt/types/PrimitiveTypeInfo.hpp>
Public Types | |
typedef T | DataType |
The given T parameter is the type of the DataSources. More... | |
Public Member Functions | |
PrimitiveTypeInfo (std::string name) | |
Setup Type Information for type name. More... | |
virtual | ~PrimitiveTypeInfo () |
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. More... | |
TypeInfo * | getTypeInfoObject () const |
Returns the TypeInfo object of this type, or null if none exists yet. More... | |
virtual const std::string & | getTypeName () const |
Return the type name for which this generator generates type info features. More... | |
virtual std::ostream & | write (std::ostream &os, base::DataSourceBase::shared_ptr in) const |
Output this datasource as a human readable string. More... | |
virtual std::istream & | read (std::istream &os, base::DataSourceBase::shared_ptr out) const |
Read a new value for this datasource from a human readable string. More... | |
virtual bool | isStreamable () const |
Returns true if this type is directly streamable using read()/write() or toString()/fromString(). More... | |
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. More... | |
virtual bool | decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const |
base::AttributeBase * | buildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const |
Build a non modifyable instance of this type. More... | |
base::AttributeBase * | buildVariable (std::string name) const |
Build a non modifyable instance of this type. More... | |
base::AttributeBase * | buildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const |
Build an Attribute of this type. More... | |
base::AttributeBase * | buildAlias (std::string name, base::DataSourceBase::shared_ptr in) const |
build an alias with b as the value. More... | |
base::DataSourceBase::shared_ptr | buildActionAlias (base::ActionInterface *action, base::DataSourceBase::shared_ptr in) const |
Returns a DataSource that first executes an action and returns the result of another data source. More... | |
virtual base::PropertyBase * | buildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const |
Build a Property of this type. More... | |
virtual base::DataSourceBase::shared_ptr | buildValue () const |
Build a internal::ValueDataSource of this type. More... | |
virtual base::DataSourceBase::shared_ptr | buildReference (void *ptr) const |
Build a internal::ReferenceDataSource of this type, pointing to the given pointer. More... | |
Type building/factory functions | |
Used to create objects that hold data of a certain type. | |
virtual base::AttributeBase * | buildConstant (std::string name, base::DataSourceBase::shared_ptr, int sizehint) const |
Build a non modifyable instance of this type. More... | |
virtual base::AttributeBase * | buildVariable (std::string name, int sizehint) const |
Build a modifyable instance of this type. More... | |
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. More... | |
virtual bool | fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const |
Usability function which converts a string to data. More... | |
Protected Attributes | |
const std::string | tname |
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > | mshared |
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.
T | The user class type. |
use_ostream | When 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. |
Definition at line 32 of file PrimitiveTypeInfo.hpp.
typedef T RTT::types::PrimitiveTypeInfo< T, use_ostream >::DataType |
The given T parameter is the type of the DataSources.
Definition at line 44 of file PrimitiveTypeInfo.hpp.
|
inline |
Setup Type Information for type name.
This causes a switch from 'unknown' type to basic type information for type T.
name | the 'Orocos' type name. |
Definition at line 53 of file PrimitiveTypeInfo.hpp.
|
inlinevirtual |
Definition at line 58 of file PrimitiveTypeInfo.hpp.
|
inlinevirtualinherited |
Returns a DataSource that first executes an action and returns the result of another data source.
If source is an AssignableDataSource, an AssignableDataSource is returned of the same type, otherwise, a plain DataSource is returned.
Implements RTT::types::ValueFactory.
Definition at line 62 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
build an alias with b as the value.
If b is of the wrong type, 0 will be returned..
Implements RTT::types::ValueFactory.
Definition at line 54 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
Build an Attribute of this type.
Implements RTT::types::ValueFactory.
Definition at line 40 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Implements RTT::types::ValueFactory.
Definition at line 20 of file TemplateValueFactory.hpp.
|
virtualinherited |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Definition at line 14 of file ValueFactory.cpp.
|
inlinevirtualinherited |
Build a Property of this type.
Implements RTT::types::ValueFactory.
Definition at line 74 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
Build a internal::ReferenceDataSource of this type, pointing to the given pointer.
Implements RTT::types::ValueFactory.
Definition at line 90 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
Build a internal::ValueDataSource of this type.
Implements RTT::types::ValueFactory.
Definition at line 87 of file TemplateValueFactory.hpp.
|
inlinevirtualinherited |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Implements RTT::types::ValueFactory.
Definition at line 33 of file TemplateValueFactory.hpp.
|
virtualinherited |
Build a modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Reimplemented in RTT::types::CArrayTypeInfo< T, has_ostream >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::PrimitiveSequenceTypeInfo< 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 10 of file ValueFactory.cpp.
|
inlinevirtual |
Reimplemented in RTT::types::CArrayTypeInfo< T, has_ostream >, RTT::types::BoostArrayTypeInfo< T, has_ostream >, RTT::types::EnumTypeInfo< T >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::StdTypeInfo< T >, RTT::types::StdTypeInfo< bool >, RTT::types::StdVectorTemplateTypeInfo< T, has_ostream >, RTT::types::StdVectorTypeInfo, RTT::types::PrimitiveSequenceTypeInfo< 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 111 of file PrimitiveTypeInfo.hpp.
|
inlinevirtual |
A primitive type is decomposed into itself.
Reimplemented in RTT::types::CArrayTypeInfo< T, has_ostream >, RTT::types::BoostArrayTypeInfo< T, has_ostream >, RTT::types::EnumTypeInfo< T >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::StdTypeInfo< T >, RTT::types::StdTypeInfo< bool >, RTT::types::PrimitiveSequenceTypeInfo< 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 118 of file PrimitiveTypeInfo.hpp.
|
inlinevirtual |
Definition at line 123 of file PrimitiveTypeInfo.hpp.
|
virtualinherited |
Usability function which converts a string to data.
Definition at line 23 of file StreamFactory.cpp.
|
inline |
Definition at line 62 of file PrimitiveTypeInfo.hpp.
Referenced by RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream >::installTypeInfoObject(), RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >::installTypeInfoObject(), RTT::types::StructTypeInfo< T, has_ostream >::installTypeInfoObject(), and RTT::types::TemplateTypeInfo< T, false >::installTypeInfoObject().
|
inlinevirtual |
Returns the TypeInfo object of this type, or null if none exists yet.
Implements RTT::types::TypeInfoGenerator.
Definition at line 84 of file PrimitiveTypeInfo.hpp.
|
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 88 of file PrimitiveTypeInfo.hpp.
Referenced by RTT::types::StructTypeInfo< T, has_ostream >::getMember().
|
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.
ti | A valid TypeInfo object into which new features may be installed |
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::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 68 of file PrimitiveTypeInfo.hpp.
Referenced by RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::installTypeInfoObject(), RTT::types::CArrayTypeInfo< T, has_ostream >::installTypeInfoObject(), RTT::types::BoostArrayTypeInfo< T, has_ostream >::installTypeInfoObject(), and RTT::types::TemplateTypeInfo< T, false >::installTypeInfoObject().
|
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 107 of file PrimitiveTypeInfo.hpp.
|
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 98 of file PrimitiveTypeInfo.hpp.
|
virtualinherited |
Usability function which converts data to a string.
Definition at line 12 of file StreamFactory.cpp.
|
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 90 of file PrimitiveTypeInfo.hpp.
|
protected |
Definition at line 39 of file PrimitiveTypeInfo.hpp.
Referenced by RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >::getSharedPtr().
|
protected |
Definition at line 38 of file PrimitiveTypeInfo.hpp.
Referenced by RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >::getTypeName().