Orocos Real-Time Toolkit
2.8.3
|
This class provides the basic tools to create channels that represent connections between two ports. More...
#include <rtt/internal/ConnFactory.hpp>
Public Member Functions | |
virtual | ~ConnFactory () |
virtual base::InputPortInterface * | inputPort (std::string const &name) const =0 |
Returns a new InputPort<T> object where T is the type represented by this TypeInfo object. More... | |
virtual base::OutputPortInterface * | outputPort (std::string const &name) const =0 |
Returns a new OutputPort<T> object where T is the type represented by this TypeInfo object. More... | |
virtual base::ChannelElementBase::shared_ptr | buildDataStorage (ConnPolicy const &policy) const =0 |
Creates single data or buffered storage for this type. More... | |
virtual base::ChannelElementBase::shared_ptr | buildChannelOutput (base::InputPortInterface &port) const =0 |
Creates the output endpoint of a communication channel and adds it to an InputPort. More... | |
virtual base::ChannelElementBase::shared_ptr | buildChannelInput (base::OutputPortInterface &port) const =0 |
Creates the input endpoint (starting point) of a communication channel and adds it to an OutputPort. More... | |
Static Public Member Functions | |
template<typename T > | |
static base::ChannelElementBase * | buildDataStorage (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. More... | |
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). More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
template<class T > | |
static bool | createStream (OutputPort< T > &output_port, ConnPolicy const &policy) |
Creates, attaches and checks an outbound stream to an Output port. More... | |
static bool | createAndCheckStream (base::OutputPortInterface &output_port, ConnPolicy const &policy, base::ChannelElementBase::shared_ptr chan, StreamConnID *conn_id) |
template<class T > | |
static bool | createStream (InputPort< T > &input_port, ConnPolicy const &policy) |
Creates, attaches and checks an inbound stream to an Input port. More... | |
This class provides the basic tools to create channels that represent connections between two ports.
The ports and type transports use these functions to setup connections. The interface may change as the needs of these 'users' change.
Definition at line 91 of file ConnFactory.hpp.
|
inlinevirtual |
Definition at line 94 of file ConnFactory.hpp.
|
inlinestatic |
Extended version of buildChannelInput that also installs a buffer after the channel input endpoint, according to a policy.
port | The output port to which the connection will be added by client code. |
conn_id | A unique connection id which identifies this connection |
policy | The policy dictating which kind of buffer must be installed. The transport and other parameters are ignored. |
output_channel | Optional. If present, the buffer will be connected to this element. |
Definition at line 219 of file ConnFactory.hpp.
References RTT::base::ChannelElementBase::setOutput().
|
inlinestatic |
Extended version of buildChannelOutput that also installs a buffer before the channel output endpoint, according to a policy.
port | The input port to which the connection is added. |
conn_id | A unique connection id which identifies this connection |
policy | The policy dictating which kind of buffer must be installed. The transport and other parameters are ignored. |
initial_value | The value to use to initialize the connection's storage buffer. |
Definition at line 255 of file ConnFactory.hpp.
References RTT::base::ChannelElementBase::setOutput().
|
pure virtual |
Creates the input endpoint (starting point) of a communication channel and adds it to an OutputPort.
port | The output port to connect the channel's input end to. |
Referenced by RTT::types::TemplateConnFactory< bool >::buildChannelInput().
|
inlinestatic |
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.
Definition at line 199 of file ConnFactory.hpp.
References RTT::base::ChannelElementBase::setOutput().
|
pure virtual |
Creates the output endpoint of a communication channel and adds it to an InputPort.
port | The input port to connect the channel's output end to. |
Referenced by RTT::types::TemplateConnFactory< bool >::buildChannelOutput().
|
inlinestatic |
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.
Definition at line 238 of file ConnFactory.hpp.
|
pure virtual |
Creates single data or buffered storage for this type.
policy | Describes the kind of storage requested by the user |
|
inlinestatic |
This method creates the connection element that will store data inside the connection, based on the given policy.
Contra: needs T in typelib.
Definition at line 139 of file ConnFactory.hpp.
References RTT::ConnPolicy::BUFFER, RTT::ConnPolicy::CIRCULAR_BUFFER, RTT::ConnPolicy::DATA, RTT::ConnPolicy::LOCK_FREE, RTT::ConnPolicy::lock_policy, RTT::ConnPolicy::LOCKED, RTT::ConnPolicy::size, RTT::ConnPolicy::type, RTT::ConnPolicy::UNSYNC, and RTT::Warning.
|
staticprotected |
Definition at line 100 of file ConnFactory.cpp.
References RTT::base::OutputPortInterface::addConnection(), RTT::base::InputPortInterface::channelReady(), RTT::Debug, RTT::base::OutputPortInterface::disconnect(), RTT::Error, RTT::base::PortInterface::getName(), and RTT::base::PortInterface::getPortID().
|
staticprotected |
Definition at line 191 of file ConnFactory.cpp.
References RTT::types::TypeTransporter::createStream(), RTT::ConnPolicy::data_size, RTT::Debug, RTT::Error, RTT::base::OutputPortInterface::getDataSource(), RTT::base::PortInterface::getName(), RTT::types::TypeInfo::getProtocol(), RTT::types::TypeMarshaller::getSampleSize(), RTT::base::PortInterface::getTypeInfo(), RTT::types::TypeInfo::getTypeName(), RTT::Info, RTT::base::PortInterface::isLocal(), RTT::internal::StreamConnID::name_id, RTT::ConnPolicy::name_id, RTT::ConnPolicy::pull, and RTT::ConnPolicy::transport.
|
static |
Definition at line 122 of file ConnFactory.cpp.
References RTT::base::OutputPortInterface::addConnection(), RTT::types::TypeTransporter::createStream(), RTT::ConnPolicy::data_size, RTT::Debug, RTT::Error, RTT::base::OutputPortInterface::getDataSource(), RTT::base::PortInterface::getName(), RTT::types::TypeInfo::getProtocol(), RTT::types::TypeMarshaller::getSampleSize(), RTT::base::PortInterface::getTypeInfo(), RTT::types::TypeInfo::getTypeName(), RTT::Info, RTT::ConnPolicy::name_id, and RTT::ConnPolicy::transport.
|
staticprotected |
Definition at line 157 of file ConnFactory.cpp.
References RTT::base::InputPortInterface::channelReady(), RTT::types::TypeTransporter::createStream(), RTT::Error, RTT::base::PortInterface::getName(), RTT::types::TypeInfo::getProtocol(), RTT::base::PortInterface::getTypeInfo(), RTT::types::TypeInfo::getTypeName(), RTT::Info, RTT::internal::StreamConnID::name_id, RTT::ConnPolicy::name_id, and RTT::ConnPolicy::transport.
|
inlinestatic |
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::Error, RTT::OutputPort< T >::getLastWrittenValue(), RTT::base::PortInterface::getName(), RTT::base::PortInterface::getPortID(), RTT::base::PortInterface::isLocal(), and RTT::ConnPolicy::transport.
Referenced by RTT::OutputPort< T >::createConnection().
|
inlinestaticprotected |
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.
Definition at line 370 of file ConnFactory.hpp.
References RTT::ConnPolicy::name_id.
|
staticprotected |
|
inlinestatic |
Creates, attaches and checks an outbound stream to an Output port.
output_port | The port to connect the stream to. |
policy | The policy dictating which transport to use. |
Definition at line 327 of file ConnFactory.hpp.
References RTT::ConnPolicy::name_id.
Referenced by RTT::InputPort< T >::createStream(), and RTT::OutputPort< T >::createStream().
|
inlinestatic |
Creates, attaches and checks an inbound stream to an Input port.
input_port | The port to connect the stream to. |
policy | The policy dictating which transport to use. |
Definition at line 345 of file ConnFactory.hpp.
References RTT::ConnPolicy::name_id, and RTT::base::InputPortInterface::removeConnection().
|
pure virtual |
Returns a new InputPort<T> object where T is the type represented by this TypeInfo object.
|
pure virtual |
Returns a new OutputPort<T> object where T is the type represented by this TypeInfo object.