Orocos Real-Time Toolkit
2.8.3
|
The base class of every data flow port. More...
#include <rtt/base/PortInterface.hpp>
Public Member Functions | |
virtual | ~PortInterface () |
virtual internal::ConnID * | getPortID () const |
Returns the identity of this port in a ConnID object. More... | |
const std::string & | getName () const |
Get the name of this Port. More... | |
bool | setName (const std::string &name) |
Change the name of this unconnected Port. More... | |
const std::string & | getDescription () const |
Get the documentation of this port. More... | |
PortInterface & | doc (const std::string &desc) |
Set the documentation of this port. More... | |
virtual bool | connected () const =0 |
Returns true if this port is connected. More... | |
virtual const types::TypeInfo * | getTypeInfo () const =0 |
Returns the types::TypeInfo object for the port's type. More... | |
virtual void | disconnect ()=0 |
Removes any connection that either go to or come from this port. More... | |
virtual bool | disconnect (PortInterface *port)=0 |
Removes the connection that links this port and the given port. More... | |
virtual bool | isLocal () const |
Returns true if this port is located on this process, and false otherwise. More... | |
virtual int | serverProtocol () const |
Returns the protocol over which this port can be accessed. More... | |
virtual PortInterface * | clone () const =0 |
Create a local clone of this port with the same name. More... | |
virtual PortInterface * | antiClone () const =0 |
Create a local clone of this port with the same name. More... | |
virtual Service * | createPortObject () |
Create accessor Object for this Port, for addition to a TaskContext Object interface. More... | |
virtual bool | connectTo (PortInterface *other, ConnPolicy const &policy)=0 |
Connects this port with other, using the given policy. More... | |
virtual bool | connectTo (PortInterface *other)=0 |
Connects this port with other, using the default policy of the input. More... | |
virtual bool | createStream (ConnPolicy const &policy)=0 |
Creates a data stream from or to this port using connection-less transports. More... | |
virtual bool | addConnection (internal::ConnID *cid, ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy=ConnPolicy())=0 |
Adds a user created connection to this port. More... | |
virtual bool | removeConnection (internal::ConnID *cid)=0 |
Removes a user created connection from this port. More... | |
void | setInterface (DataFlowInterface *iface) |
Once a port is added to a DataFlowInterface, it gets a pointer to that interface. More... | |
DataFlowInterface * | getInterface () const |
Returns the DataFlowInterface this port belongs to or null if it was not added to such an interface. More... | |
virtual const internal::ConnectionManager * | getManager () const =0 |
Returns the connection manager of this port (if any). More... | |
Protected Member Functions | |
PortInterface (const std::string &name) | |
Protected Attributes | |
DataFlowInterface * | iface |
The base class of every data flow port.
Definition at line 57 of file PortInterface.hpp.
|
protected |
Definition at line 48 of file PortInterface.cpp.
|
inlinevirtual |
Definition at line 67 of file PortInterface.hpp.
|
pure virtual |
Adds a user created connection to this port.
This is an advanced method, prefer to use connectTo and createStream.
Implemented in RTT::corba::RemoteInputPort, RTT::base::InputPortInterface, RTT::corba::RemotePort< base::InputPortInterface >, RTT::corba::RemotePort< base::OutputPortInterface >, and RTT::base::OutputPortInterface.
|
pure virtual |
Create a local clone of this port with the same name.
If this port is a local port, this is an object of the inverse direction (read for write and write for read), and same name. If this object is a remote port, then it is a local port of the inverse direction and with the same name.
Implemented in RTT::OutputPort< T >, RTT::InputPort< T >, RTT::corba::RemoteInputPort, and RTT::corba::RemoteOutputPort.
|
pure virtual |
Create a local clone of this port with the same name.
If this port is a local port, this is an object of the same type and same name. If this object is a remote port, then it is a local port of the same type and same name.
Implemented in RTT::OutputPort< T >, RTT::InputPort< T >, RTT::corba::RemoteInputPort, and RTT::corba::RemoteOutputPort.
|
pure virtual |
Returns true if this port is connected.
Implemented in RTT::base::InputPortInterface, RTT::base::OutputPortInterface, RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Referenced by RTT::corba::CDataFlowInterface_i::_default_POA(), createPortObject(), and setName().
|
pure virtual |
Connects this port with other, using the given policy.
Unlike OutputPortInterface::createConnection, other can be the write port and this
the read port.
Implemented in RTT::base::InputPortInterface, and RTT::base::OutputPortInterface.
|
pure virtual |
Connects this port with other, using the default policy of the input.
Unlike OutputPortInterface::createConnection, other can be the write port and this
the read port.
Implemented in RTT::base::InputPortInterface, and RTT::base::OutputPortInterface.
|
virtual |
Create accessor Object for this Port, for addition to a TaskContext Object interface.
Reimplemented in RTT::OutputPort< T >, and RTT::InputPort< T >.
Definition at line 75 of file PortInterface.cpp.
References RTT::Service::addSynchronousOperation(), connected(), disconnect(), getName(), RTT::DataFlowInterface::getOwner(), and iface.
Referenced by RTT::InputPort< T >::createPortObject(), RTT::DataFlowInterface::createPortObject(), and RTT::OutputPort< T >::createPortObject().
|
pure virtual |
Creates a data stream from or to this port using connection-less transports.
Typically, policy.transport and policy.name_id must be properly filled in such that the data stream can be set up and input and output port can find each other. You need to call this method on two ports (input and output) using the same transport and (probably) same name_id.
policy | The connection policy describing how the stream must be set up. |
Implemented in RTT::OutputPort< T >, RTT::InputPort< T >, RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Referenced by RTT::corba::CDataFlowInterface_i::deregisterChannel().
|
pure virtual |
Removes any connection that either go to or come from this port.
Implemented in RTT::base::InputPortInterface, RTT::base::OutputPortInterface, RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Referenced by createPortObject(), RTT::corba::CDataFlowInterface_i::deregisterChannel(), and RTT::corba::RemoteInputPort::disconnect().
|
pure virtual |
Removes the connection that links this port and the given port.
Returns true if there was such a connection, false otherwise
Implemented in RTT::corba::RemoteInputPort, RTT::base::OutputPortInterface, RTT::base::InputPortInterface, and RTT::corba::RemoteOutputPort.
PortInterface & PortInterface::doc | ( | const std::string & | desc | ) |
Set the documentation of this port.
desc | The description of the port |
Definition at line 60 of file PortInterface.cpp.
References iface, and RTT::DataFlowInterface::setPortDescription().
Referenced by RTT::InputPort< T >::createPortObject().
|
inline |
Get the documentation of this port.
Definition at line 91 of file PortInterface.hpp.
DataFlowInterface * PortInterface::getInterface | ( | ) | const |
Returns the DataFlowInterface this port belongs to or null if it was not added to such an interface.
Definition at line 95 of file PortInterface.cpp.
References iface.
Referenced by RTT::corba::RemoteInputPort::buildRemoteChannelOutput(), RTT::corba::RemoteOutputPort::createConnection(), and RTT::mqueue::MQSendRecv::setupStream().
|
pure virtual |
Returns the connection manager of this port (if any).
This method provides access to the internals of this port in order to allow connection introspection.
Implemented in RTT::base::InputPortInterface, and RTT::base::OutputPortInterface.
|
inline |
Get the name of this Port.
Definition at line 77 of file PortInterface.hpp.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addLocalEventPort(), RTT::DataFlowInterface::addLocalPort(), RTT::DataFlowInterface::addPort(), RTT::corba::RemoteOutputPort::antiClone(), RTT::corba::RemoteInputPort::antiClone(), RTT::InputPort< T >::antiClone(), RTT::OutputPort< T >::antiClone(), RTT::corba::CorbaFallBackProtocol::buildChannelInput(), RTT::corba::CorbaFallBackProtocol::buildChannelOutput(), RTT::corba::RemoteInputPort::buildRemoteChannelOutput(), RTT::corba::RemoteInputPort::channelReady(), RTT::corba::RemoteOutputPort::clone(), RTT::corba::RemoteInputPort::clone(), RTT::InputPort< T >::clone(), RTT::OutputPort< T >::clone(), RTT::TaskContext::connectPorts(), RTT::base::InputPortInterface::connectTo(), RTT::internal::ConnFactory::createAndCheckConnection(), RTT::internal::ConnFactory::createAndCheckOutOfBandConnection(), RTT::internal::ConnFactory::createAndCheckStream(), RTT::corba::RemoteOutputPort::createConnection(), RTT::internal::ConnFactory::createConnection(), createPortObject(), RTT::internal::ConnFactory::createRemoteConnection(), RTT::corba::CorbaFallBackProtocol::createStream(), RTT::corba::CDataFlowInterface_i::deregisterChannel(), RTT::corba::RemoteOutputPort::disconnect(), and RTT::mqueue::MQSendRecv::setupStream().
|
virtual |
Returns the identity of this port in a ConnID object.
Reimplemented in RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Definition at line 72 of file PortInterface.cpp.
Referenced by RTT::internal::ConnFactory::createAndCheckConnection(), RTT::internal::ConnFactory::createConnection(), and RTT::internal::ConnectionManager::disconnect().
|
pure virtual |
Returns the types::TypeInfo object for the port's type.
Implemented in RTT::OutputPort< T >, RTT::InputPort< T >, RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Referenced by RTT::corba::CDataFlowInterface_i::_default_POA(), RTT::internal::ConnFactory::createAndCheckOutOfBandConnection(), RTT::internal::ConnFactory::createAndCheckStream(), RTT::internal::ConnFactory::createRemoteConnection(), and RTT::corba::CDataFlowInterface_i::deregisterChannel().
|
virtual |
Returns true if this port is located on this process, and false otherwise.
Definition at line 67 of file PortInterface.cpp.
References serverProtocol().
Referenced by RTT::internal::ConnFactory::createAndCheckOutOfBandConnection(), and RTT::internal::ConnFactory::createConnection().
|
pure virtual |
Removes a user created connection from this port.
This is an advanced method, prefer to use disconnect() or a method from a subclass of PortInterface.
Implemented in RTT::base::OutputPortInterface, and RTT::base::InputPortInterface.
Referenced by RTT::corba::CDataFlowInterface_i::deregisterChannel().
|
virtual |
Returns the protocol over which this port can be accessed.
Reimplemented in RTT::corba::RemotePort< base::InputPortInterface >, and RTT::corba::RemotePort< base::OutputPortInterface >.
Definition at line 69 of file PortInterface.cpp.
Referenced by RTT::internal::ConnFactory::createRemoteConnection(), and isLocal().
void PortInterface::setInterface | ( | DataFlowInterface * | iface | ) |
Once a port is added to a DataFlowInterface, it gets a pointer to that interface.
This allows advanced ports to track back to which component they belong.
Definition at line 91 of file PortInterface.cpp.
References iface.
Referenced by RTT::DataFlowInterface::addLocalPort(), and RTT::corba::CDataFlowInterface_i::deregisterChannel().
bool PortInterface::setName | ( | const std::string & | name | ) |
Change the name of this unconnected Port.
One can only change the name when it is not yet connected.
true | if !this->connected(), the name has changed. |
false | if this->connected(), the name has not been changed. |
Definition at line 51 of file PortInterface.cpp.
References connected().
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::TaskContext::addEventPort(), RTT::DataFlowInterface::addPort(), and RTT::TaskContext::addPort().
|
protected |
Definition at line 62 of file PortInterface.hpp.
Referenced by createPortObject(), doc(), getInterface(), and setInterface().