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

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

#include <rtt/types/SequenceTypeInfo.hpp>

Inheritance diagram for RTT::types::SequenceTypeInfo< T, has_ostream >:
RTT::types::TemplateTypeInfo< T, has_ostream > RTT::types::SequenceTypeInfoBase< T > RTT::types::PrimitiveTypeInfo< T, use_ostream > RTT::types::TypeInfoGenerator

List of all members.

Public Types

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

Public Member Functions

 SequenceTypeInfo (std::string name)
bool installTypeInfoObject (TypeInfo *ti)
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
virtual
base::ChannelElementBase::shared_ptr 
buildRemoteChannelOutput (base::OutputPortInterface &output_port, types::TypeInfo const *type_info, base::InputPortInterface &input, const ConnPolicy &policy)
boost::shared_ptr
< PrimitiveTypeInfo< T,
use_ostream > > 
getSharedPtr ()
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 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
base::InputPortInterfaceinputPort (std::string const &name) const
base::OutputPortInterfaceoutputPort (std::string const &name) const
base::ChannelElementBase::shared_ptr buildDataStorage (ConnPolicy const &policy) const
base::ChannelElementBase::shared_ptr buildChannelOutput (base::InputPortInterface &port) const
base::ChannelElementBase::shared_ptr buildChannelInput (base::OutputPortInterface &port) const
virtual bool composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const
 User, implement this function in case you want to control reading the XML data format.
virtual bool decomposeTypeImpl (typename internal::AssignableDataSource< T >::const_reference_t source, PropertyBag &targetbag) const
 User, implement this function in case you want to control writing the XML data format.
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.
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.
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 bool getMember (internal::Reference *ref, base::DataSourceBase::shared_ptr item, const std::string &name) const
 Stores a reference to a member of a struct identified by its name.

Static Public Member Functions

template<typename T >
static base::ChannelElementBasebuildDataStorage (ConnPolicy const &policy, const T &initial_value=T())
 This method creates the connection element that will store data inside the connection, based on the given policy.
template<typename T >
static
base::ChannelElementBase::shared_ptr 
buildChannelOutput (InputPort< T > &port, ConnID *conn_id)
 During the process of building a connection between two ports, this method builds the output part of the channel, that is the half that is connected to the input port.
template<typename T >
static
base::ChannelElementBase::shared_ptr 
buildChannelInput (OutputPort< T > &port, ConnID *conn_id, base::ChannelElementBase::shared_ptr output_channel)
 During the process of building a connection between two ports, this method builds the input half (starting from the OutputPort).
template<typename T >
static
base::ChannelElementBase::shared_ptr 
buildBufferedChannelInput (OutputPort< T > &port, ConnID *conn_id, ConnPolicy const &policy, base::ChannelElementBase::shared_ptr output_channel)
 Extended version of buildChannelInput that also installs a buffer after the channel input endpoint, according to a policy.
template<typename T >
static
base::ChannelElementBase::shared_ptr 
buildBufferedChannelOutput (InputPort< T > &port, ConnID *conn_id, ConnPolicy const &policy, T const &initial_value=T())
 Extended version of buildChannelOutput that also installs a buffer before the channel output endpoint, according to a policy.
template<typename T >
static bool createConnection (OutputPort< T > &output_port, base::InputPortInterface &input_port, ConnPolicy const &policy)
 Creates a connection from a local output_port to a local or remote input_port.
template<class T >
static bool createStream (OutputPort< T > &output_port, ConnPolicy const &policy)
 Creates, attaches and checks an outbound stream to an Output port.
template<class T >
static bool createStream (InputPort< T > &input_port, ConnPolicy const &policy)
 Creates, attaches and checks an inbound stream to an Input port.
static bool createAndCheckStream (base::OutputPortInterface &output_port, ConnPolicy const &policy, base::ChannelElementBase::shared_ptr chan, StreamConnID *conn_id)

Static Protected Member Functions

static bool createAndCheckStream (base::InputPortInterface &input_port, ConnPolicy const &policy, base::ChannelElementBase::shared_ptr outhalf, StreamConnID *conn_id)
static bool createAndCheckConnection (base::OutputPortInterface &output_port, base::InputPortInterface &input_port, base::ChannelElementBase::shared_ptr channel_input, ConnPolicy policy)
static
base::ChannelElementBase::shared_ptr 
createRemoteConnection (base::OutputPortInterface &output_port, base::InputPortInterface &input_port, ConnPolicy const &policy)
template<class T >
static
base::ChannelElementBase::shared_ptr 
createOutOfBandConnection (OutputPort< T > &output_port, InputPort< T > &input_port, ConnPolicy const &policy)
 This code is for setting up an in-process out-of-band connection.
static
base::ChannelElementBase::shared_ptr 
createAndCheckOutOfBandConnection (base::OutputPortInterface &output_port, base::InputPortInterface &input_port, ConnPolicy const &policy, base::ChannelElementBase::shared_ptr output_half, StreamConnID *conn_id)

Protected Attributes

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

Detailed Description

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

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

Definition at line 17 of file SequenceTypeInfo.hpp.


Member Function Documentation

template<typename T >
static base::ChannelElementBase::shared_ptr RTT::internal::ConnFactory::buildBufferedChannelInput ( OutputPort< T > &  port,
ConnID conn_id,
ConnPolicy const &  policy,
base::ChannelElementBase::shared_ptr  output_channel 
) [inline, static, inherited]

Extended version of buildChannelInput that also installs a buffer after the channel input endpoint, according to a policy.

Parameters:
portThe output port to which the connection will be added by client code.
conn_idA unique connection id which identifies this connection
policyThe policy dictating which kind of buffer must be installed. The transport and other parameters are ignored.
output_channelOptional. If present, the buffer will be connected to this element.

Definition at line 219 of file ConnFactory.hpp.

References RTT::base::ChannelElementBase::setOutput().

template<typename T >
static base::ChannelElementBase::shared_ptr RTT::internal::ConnFactory::buildBufferedChannelOutput ( InputPort< T > &  port,
ConnID conn_id,
ConnPolicy const &  policy,
T const &  initial_value = T() 
) [inline, static, inherited]

Extended version of buildChannelOutput that also installs a buffer before the channel output endpoint, according to a policy.

Parameters:
portThe input port to which the connection is added.
conn_idA unique connection id which identifies this connection
policyThe policy dictating which kind of buffer must be installed. The transport and other parameters are ignored.
initial_valueThe value to use to initialize the connection's storage buffer.

Definition at line 255 of file ConnFactory.hpp.

References RTT::base::ChannelElementBase::setOutput().

template<typename T >
static base::ChannelElementBase::shared_ptr RTT::internal::ConnFactory::buildChannelInput ( OutputPort< T > &  port,
ConnID conn_id,
base::ChannelElementBase::shared_ptr  output_channel 
) [inline, static, inherited]

During the process of building a connection between two ports, this method builds the input half (starting from the OutputPort).

The output_channel argument is the connection element that has been returned by buildChannelOutput.

See also:
buildChannelOutput

Definition at line 199 of file ConnFactory.hpp.

References RTT::base::ChannelElementBase::setOutput().

template<typename T >
static base::ChannelElementBase::shared_ptr RTT::internal::ConnFactory::buildChannelOutput ( InputPort< T > &  port,
ConnID conn_id 
) [inline, static, inherited]

During the process of building a connection between two ports, this method builds the output part of the channel, that is the half that is connected to the input port.

The returned value is the connection element that should be connected to the end of the input-half.

See also:
buildChannelInput

Definition at line 238 of file ConnFactory.hpp.

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.

template<typename T >
static base::ChannelElementBase* RTT::internal::ConnFactory::buildDataStorage ( ConnPolicy const &  policy,
const T &  initial_value = T() 
) [inline, static, inherited]

This method creates the connection element that will store data inside the connection, based on the given policy.

Todo:
: shouldn't this belong in the template type info ? This allows the type lib to choose which locked/lockfree algorithms are implemented and leaves out 4x code generation for each alternative in each compilation unit.

Contra: needs T in typelib.

Todo:
: since setDataSample, initial_value is no longer needed.

Definition at line 139 of file ConnFactory.hpp.

References RTT::ConnPolicy::lock_policy, RTT::ConnPolicy::size, and RTT::ConnPolicy::type.

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 6 of file CompositionFactory.cpp.

bool ConnFactory::createAndCheckStream ( base::OutputPortInterface output_port,
ConnPolicy const &  policy,
base::ChannelElementBase::shared_ptr  chan,
StreamConnID conn_id 
) [static, inherited]
template<typename T >
static bool RTT::internal::ConnFactory::createConnection ( OutputPort< T > &  output_port,
base::InputPortInterface input_port,
ConnPolicy const &  policy 
) [inline, static, inherited]

Creates a connection from a local output_port to a local or remote input_port.

This function contains all logic to decide on how connections must be created to local or remote input ports.

In order to set up out-of-band communication between input_port and output_port, use a different transport number in the policy parameter than the transport of the input port.

Definition at line 274 of file ConnFactory.hpp.

References RTT::OutputPort< T >::getLastWrittenValue(), RTT::base::PortInterface::getName(), RTT::base::PortInterface::getPortID(), RTT::base::PortInterface::isLocal(), and RTT::ConnPolicy::transport.

template<class T >
static base::ChannelElementBase::shared_ptr RTT::internal::ConnFactory::createOutOfBandConnection ( OutputPort< T > &  output_port,
InputPort< T > &  input_port,
ConnPolicy const &  policy 
) [inline, static, protected, inherited]

This code is for setting up an in-process out-of-band connection.

This means that both input and output port are present in the same process. This function is used when the policy dictates a transport protocol, but both ports are local.

Returns:
a channel element chain with a channel output endpoint, but no channel input endpoint.

Definition at line 370 of file ConnFactory.hpp.

References RTT::ConnPolicy::name_id.

template<class T >
static bool RTT::internal::ConnFactory::createStream ( OutputPort< T > &  output_port,
ConnPolicy const &  policy 
) [inline, static, inherited]

Creates, attaches and checks an outbound stream to an Output port.

Parameters:
output_portThe port to connect the stream to.
policyThe policy dictating which transport to use.
Returns:
true if the stream could be created and connected to output_port.

Definition at line 327 of file ConnFactory.hpp.

References RTT::ConnPolicy::name_id.

template<class T >
static bool RTT::internal::ConnFactory::createStream ( InputPort< T > &  input_port,
ConnPolicy const &  policy 
) [inline, static, inherited]

Creates, attaches and checks an inbound stream to an Input port.

Parameters:
input_portThe port to connect the stream to.
policyThe policy dictating which transport to use.
Returns:
true if the stream could be created and connected to input_port.

Definition at line 345 of file ConnFactory.hpp.

References RTT::ConnPolicy::name_id, and RTT::base::InputPortInterface::removeConnection().

template<typename T>
virtual bool RTT::types::TemplateCompositionFactory< T >::decomposeTypeImpl ( typename internal::AssignableDataSource< T >::const_reference_t  source,
PropertyBag targetbag 
) const [inline, virtual, inherited]

User, implement this function in case you want to control writing the XML data format.

Add the structural elements of source to targetbag.

Definition at line 69 of file TemplateCompositionFactory.hpp.

virtual bool RTT::types::MemberFactory::getMember ( internal::Reference ref,
base::DataSourceBase::shared_ptr  item,
const std::string &  name 
) const [virtual, inherited]

Stores a reference to a member of a struct identified by its name.

This method does not allocate memory when item is assignable..

Parameters:
refThe reference object in which to store the reference.
itemThe item of which to return a reference to a member. It must be assignable, otherwise, a reference to a copy of item will be returned. This copy will allocate memory.
nameThe name of a member within item.
Returns:
false if no such member exists, true if ref got filled in otherwise.
template<typename T, bool use_ostream = false>
TypeInfo* RTT::types::PrimitiveTypeInfo< T, use_ostream >::getTypeInfoObject ( ) const [inline, virtual, inherited]

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, inherited]

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().


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