39 #ifndef ORO_CONN_FACTORY_HPP 40 #define ORO_CONN_FACTORY_HPP 46 #include "../base/PortInterface.hpp" 47 #include "../base/InputPortInterface.hpp" 48 #include "../base/OutputPortInterface.hpp" 49 #include "../DataFlowInterface.hpp" 51 #include "../base/DataObject.hpp" 52 #include "../base/DataObjectUnSync.hpp" 53 #include "../base/Buffer.hpp" 54 #include "../base/BufferUnSync.hpp" 55 #include "../Logger.hpp" 146 #ifndef OROBLD_OS_NO_ASM 152 RTT::log(
Warning) <<
"lock free connection policy is unavailable on this system, defaulting to LOCKED" << RTT::endlog();
170 #ifndef OROBLD_OS_NO_ASM 176 RTT::log(
Warning) <<
"lock free connection policy is unavailable on this system, defaulting to LOCKED" << RTT::endlog();
276 if ( !output_port.
isLocal() ) {
277 log(
Error) <<
"Need a local OutputPort to create connections." <<endlog();
290 log(
Error) <<
"Port " << input_port.
getName() <<
" is not compatible with " << output_port.
getName() << endlog();
303 output_half = createRemoteConnection( output_port, input_port, policy);
305 output_half = createOutOfBandConnection<T>( output_port, *input_p, policy);
314 buildChannelInput<T>(output_port, input_port.
getPortID(), output_half);
316 return createAndCheckConnection(output_port, input_port, channel_input, policy );
331 return createAndCheckStream(output_port, policy, chan, sid);
349 if ( createAndCheckStream(input_port, policy, outhalf, sid) )
373 return createAndCheckOutOfBandConnection( output_port, input_port, policy, output_half, conn_id);
This class provides the basic tools to create channels that represent connections between two ports...
base::PortInterface const * ptr
A Lock-free buffer implementation to read and write data of type T in a FIFO way. ...
virtual bool isLocal() const
Returns true if this port is located on this process, and false otherwise.
virtual ConnID * clone() const
boost::shared_ptr< DataObjectInterface< T > > shared_ptr
Used for shared_ptr management.
This is a channel element that represents the output endpoint of a connection, i.e.
static const int CIRCULAR_BUFFER
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...
Represents a Stream connection created by the ConnFactory.
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 ...
A Buffer is an object which is used to store (Push) and retrieve (Pop) values from.
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 (sta...
int lock_policy
This is the locking policy on the connection.
A connection element that can store a fixed number of data samples.
const std::string & getName() const
Get the name of this Port.
virtual bool isSameID(ConnID const &id) const
int type
DATA, BUFFER or CIRCULAR_BUFFER.
A connection policy object describes how a given connection should behave.
A class which provides unprotected (not thread-safe) access to one typed element of data...
The base class of each OutputPort.
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...
boost::shared_ptr< ConnFactory > ConnFactoryPtr
int size
If the connection is a buffered connection, the size of the buffer.
Implements a not threadsafe buffer.
Represents a local connection created by the ConnFactory.
StreamConnID(const std::string &name)
static bool createStream(InputPort< T > &input_port, ConnPolicy const &policy)
Creates, attaches and checks an inbound stream to an Input port.
This DataObject is a Lock-Free implementation, such that reads and writes can happen concurrently wit...
static bool createStream(OutputPort< T > &output_port, ConnPolicy const &policy)
Creates, attaches and checks an outbound stream to an Output port.
void setOutput(shared_ptr output)
Sets the output of this channel element to output and sets the input of output to this...
static const int LOCK_FREE
boost::intrusive_ptr< ChannelElementBase > shared_ptr
Implements a very simple blocking thread-safe buffer, using mutexes (locks).
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.
A class which provides locked/protected access to one typed element of data.
A connection element that stores a single data sample.
int transport
The prefered transport used.
LocalConnID(base::PortInterface const *obj)
A component's data output port.
virtual internal::ConnID * getPortID() const
Returns the identity of this port in a ConnID object.
This class is used in places where a permanent representation of a reference to a connection is neede...
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.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
In the data flow implementation, a channel is created by chaining ChannelElementBase objects...
The base class of every data flow port.
std::string name_id
The name of this connection.
T getLastWrittenValue() const
Returns the last written value written to this port, in case it is kept by this port, otherwise, returns a default 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.
boost::shared_ptr< BufferInterface< T > > shared_ptr