Orocos Real-Time Toolkit  2.5.0
Public Types | Public Member Functions | Protected Types | Protected Attributes
RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream > Class Template Reference

New-style SequenceTypeInfo which offers type info for sequences which can NOT be sent over flow ports. More...

#include <rtt/types/PrimitiveSequenceTypeInfo.hpp>

Inheritance diagram for RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >:
RTT::types::PrimitiveTypeInfo< T, has_ostream > RTT::types::SequenceTypeInfoBase< T > RTT::types::TypeInfo

List of all members.

Public Types

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

Public Member Functions

 PrimitiveSequenceTypeInfo (std::string name)
base::AttributeBasebuildVariable (std::string name, int size) const
virtual bool composeType (base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const
 Specialize to resize result given the size of source.
virtual bool resize (base::DataSourceBase::shared_ptr arg, int size) const
virtual
base::DataSourceBase::shared_ptr 
decomposeType (base::DataSourceBase::shared_ptr source) const
 Use getMember() for decomposition...
virtual std::vector< std::string > getMemberNames () const
virtual
base::DataSourceBase::shared_ptr 
getMember (base::DataSourceBase::shared_ptr item, const std::string &name) const
virtual
base::DataSourceBase::shared_ptr 
getMember (base::DataSourceBase::shared_ptr item, base::DataSourceBase::shared_ptr id) const
bool installTypeInfoObject ()
 Installs the type info object in the global data source type info handler.
base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const
 Build a non modifyable instance of this type.
base::AttributeBasebuildVariable (std::string name) const
 Build a non modifyable instance of this type.
base::AttributeBasebuildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const
 Build an Attribute of this type.
base::AttributeBasebuildAlias (std::string name, base::DataSourceBase::shared_ptr in) const
 build an alias with b as the value.
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.
virtual const std::string & getTypeName () const
 Return unique the type name.
virtual base::PropertyBasebuildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
 Build a Property of this type.
virtual
base::DataSourceBase::shared_ptr 
buildValue () const
 Build a internal::ValueDataSource of this type.
virtual
base::DataSourceBase::shared_ptr 
buildReference (void *ptr) const
 Build a internal::ReferenceDataSource of this type, pointing to the given pointer.
virtual std::ostream & write (std::ostream &os, base::DataSourceBase::shared_ptr in) const
 Output this datasource as a human readable string.
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.
virtual bool isStreamable () const
 Returns true if this type is directly streamable using read()/write() or toString()/fromString().
virtual bool decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const
TypeInfo::TypeId getTypeId () const
 Register a protocol for data transport over a network.
const char * getTypeIdName () const
 Register a protocol for data transport over a network.
base::InputPortInterfaceinputPort (std::string const &name) const
 Returns a new InputPort<T> object where T is the type represented by this TypeInfo object.
base::OutputPortInterfaceoutputPort (std::string const &name) const
 Returns a new OutputPort<T> object where T is the type represented by this TypeInfo object.
base::ChannelElementBase::shared_ptr buildDataStorage (ConnPolicy const &policy) const
 Creates single data or buffered storage for this type.
base::ChannelElementBase::shared_ptr buildChannelOutput (base::InputPortInterface &port) const
 Register a protocol for data transport over a network.
base::ChannelElementBase::shared_ptr buildChannelInput (base::OutputPortInterface &port) const
 Register a protocol for data transport over a network.
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::DataSourceBase::shared_ptr 
construct (const std::vector< base::DataSourceBase::shared_ptr > &args) const
 Constructor syntax: construct a internal::DataSource which returns an instance of data depending on the given arguments.
virtual
base::DataSourceBase::shared_ptr 
convert (base::DataSourceBase::shared_ptr arg) const
 Automatic conversion: convert a internal::DataSource to this type.
virtual void addConstructor (TypeBuilder *tb)
 Add a constructor/convertor object.
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.
Inspecting data structures.

Used to write a complex type to an external representation, like XML.

virtual
base::DataSourceBase::shared_ptr 
convertType (base::DataSourceBase::shared_ptr source) const
 Specialize this function to return an alternate type which represents this one in a compatible way.

Protected Types

typedef std::vector
< TypeBuilder * > 
Constructors
typedef std::vector
< TypeTransporter * > 
Transporters

Protected Attributes

const std::string tname
Constructors constructors
Transporters transporters

Distribution of objects

Used to transport data over a network.

bool addProtocol (int protocol_id, TypeTransporter *tt)
 Register a protocol for data transport over a network.
TypeTransportergetProtocol (int protocol_id) const
 Returns this type's transport for a given protocol.
bool hasProtocol (int protocol_id) const
 Check if this type is transporable over a given protocol.
std::vector< int > getTransportNames () const
 Return a list of protocols that have transporters.
typedef const std::type_info * TypeId
 Register a protocol for data transport over a network.
void migrateProtocols (TypeInfo *orig)
 Migrates all protocols present in orig to this type info object.

Detailed Description

template<class T, bool has_ostream = false>
class RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >

New-style SequenceTypeInfo which offers type info for sequences which can NOT be sent over flow ports.

This has huge code size reduction, while still being able to use these sequences in structs which are sent over flow ports.

Definition at line 18 of file PrimitiveSequenceTypeInfo.hpp.


Member Function Documentation

base::DataSourceBase::shared_ptr RTT::types::PrimitiveTypeInfo< T, use_ostream >::buildActionAlias ( base::ActionInterface action,
base::DataSourceBase::shared_ptr  source 
) const [inline, virtual, inherited]

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::TypeInfo.

Definition at line 129 of file PrimitiveTypeInfo.hpp.

base::AttributeBase* RTT::types::PrimitiveTypeInfo< T, use_ostream >::buildAlias ( std::string  name,
base::DataSourceBase::shared_ptr  b 
) const [inline, virtual, inherited]

build an alias with b as the value.

If b is of the wrong type, 0 will be returned..

Implements RTT::types::TypeInfo.

Definition at line 121 of file PrimitiveTypeInfo.hpp.

base::AttributeBase* RTT::types::PrimitiveTypeInfo< T, use_ostream >::buildConstant ( std::string  name,
base::DataSourceBase::shared_ptr   
) const [inline, virtual, inherited]

Build a non modifyable instance of this type.

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

Implements RTT::types::TypeInfo.

Definition at line 87 of file PrimitiveTypeInfo.hpp.

AttributeBase * RTT::TypeInfo::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 63 of file TypeInfo.cpp.

base::ChannelElementBase::shared_ptr RTT::types::PrimitiveTypeInfo< T, use_ostream >::buildDataStorage ( ConnPolicy const &  policy) const [inline, virtual, inherited]

Creates single data or buffered storage for this type.

Parameters:
policyDescribes the kind of storage requested by the user
Returns:
a storage element.

Implements RTT::types::TypeInfo.

Definition at line 212 of file PrimitiveTypeInfo.hpp.

base::AttributeBase* RTT::types::PrimitiveTypeInfo< T, use_ostream >::buildVariable ( std::string  name) const [inline, virtual, inherited]

Build a non modifyable instance of this type.

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

Implements RTT::types::TypeInfo.

Definition at line 100 of file PrimitiveTypeInfo.hpp.

DataSourceBase::shared_ptr RTT::TypeInfo::construct ( const std::vector< base::DataSourceBase::shared_ptr > &  args) const [virtual, inherited]

Constructor syntax: construct a internal::DataSource which returns an instance of data depending on the given arguments.

When args is empty, the default 'variable' is returned.

Reimplemented in RTT::types::EmptyTypeInfo.

Definition at line 79 of file TypeInfo.cpp.

References RTT::base::AttributeBase::getDataSource().

Automatic conversion: convert a internal::DataSource to this type.

For example, for converting float -> double. If no valid conversion was found, returns arg again, otherwise, a new data source.

Definition at line 110 of file TypeInfo.cpp.

Referenced by RTT::types::CArrayTypeInfo< T, has_ostream >::getMember(), RTT::internal::AssignableDataSource< T >::update(), and RTT::internal::AssignableDataSource< T >::updateAction().

Specialize this function to return an alternate type which represents this one in a compatible way.

For example, a short converts to an long or an enum to an int or a string.

Returns:
null if this type is not convertible to anything else.
Deprecated:
by decomposeType. We want to rename convertType to decomposeType. This function is left here for transitional purposes.

Definition at line 134 of file TypeInfo.cpp.

TypeTransporter * RTT::TypeInfo::getProtocol ( int  protocol_id) const [inherited]
bool RTT::types::PrimitiveTypeInfo< T, use_ostream >::installTypeInfoObject ( ) [inline, virtual, inherited]

Installs the type info object in the global data source type info handler.

This will be called by the TypeInfoRepository, prior to registering this type. If installation fails the TypeInfoRepository will delete this object, and all its associated constructors.

Return values:
trueinstallation succeeded. This object should not be deleted during the execution of the current process.
falseinstallation failed. This object is not used and may be deleted.

Implements RTT::types::TypeInfo.

Definition at line 62 of file PrimitiveTypeInfo.hpp.

void RTT::TypeInfo::migrateProtocols ( TypeInfo orig) [protected, inherited]

Migrates all protocols present in orig to this type info object.

It is meant as a helper when a type info object is replaced by a new instance.

Precondition:
This type has no transports registered yet, ie, it is newly constructed.

Definition at line 190 of file TypeInfo.cpp.

Referenced by RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >::installTypeInfoObject(), and RTT::types::TypeInfoName< T >::installTypeInfoObject().

virtual std::istream& RTT::types::PrimitiveTypeInfo< T, use_ostream >::read ( std::istream &  os,
base::DataSourceBase::shared_ptr  out 
) const [inline, virtual, inherited]

Read a new value for this datasource from a human readable string.

The default does nothing.

Implements RTT::types::TypeInfo.

Definition at line 177 of file PrimitiveTypeInfo.hpp.

virtual std::ostream& RTT::types::PrimitiveTypeInfo< T, use_ostream >::write ( std::ostream &  os,
base::DataSourceBase::shared_ptr  in 
) const [inline, virtual, inherited]

Output this datasource as a human readable string.

The default just writes the type name in parentheses to os.

Implements RTT::types::TypeInfo.

Definition at line 163 of file PrimitiveTypeInfo.hpp.


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