Orocos Real-Time Toolkit
2.6.0
|
Proxy for a remote input port. More...
#include <rtt/transports/corba/RemotePorts.hpp>
Public Member Functions | |
RemoteInputPort (types::TypeInfo const *type_info, CDataFlowInterface_ptr dataflow, std::string const &name, PortableServer::POA_ptr poa) | |
base::ChannelElementBase::shared_ptr | buildRemoteChannelOutput (base::OutputPortInterface &output_port, types::TypeInfo const *type, base::InputPortInterface &reader_, ConnPolicy const &policy) |
This method will do more than just building the output half, it will create the two crucial ChannelElements on both sides of the CORBA connection to marshal/demarshal the channel data. | |
base::PortInterface * | clone () const |
Create a local clone of this port with the same name. | |
base::PortInterface * | antiClone () const |
Create a local clone of this port with the same name. | |
base::DataSourceBase * | getDataSource () |
Returns a DataSourceBase interface to read this port. | |
virtual bool | channelReady (base::ChannelElementBase::shared_ptr channel) |
For remote input port objects, this is forwarded to the other end over the Data Flow Interface. | |
PortableServer::POA_ptr | _default_POA () |
CDataFlowInterface_ptr | getDataFlowInterface () const |
internal::ConnID * | getPortID () const |
Returns the identity of this port in a ConnID object. | |
types::TypeInfo const * | getTypeInfo () const |
Returns the types::TypeInfo object for the port's type. | |
int | serverProtocol () const |
Returns the protocol over which this port can be accessed. | |
bool | connected () const |
Returns true if this port is connected. | |
bool | createStream (const ConnPolicy &policy) |
Creates a data stream from or to this port using connection-less transports. | |
void | disconnect () |
Removes any connection that either go to or come from this port *and* removes all callbacks and cleans up the NewDataOnPortEvent. | |
bool | disconnect (base::PortInterface *p) |
Removes the channel that connects this port to port . | |
void | clear () |
Clears the connection. | |
ConnPolicy | getDefaultPolicy () const |
virtual bool | removeConnection (internal::ConnID *cid) |
Removes the input channel. | |
virtual FlowStatus | read (DataSourceBase::shared_ptr source, bool copy_old_data=true) |
Reads the port and updates the value hold by the given data source. | |
void | signalInterface (bool true_false) |
When called with true, will signal the DataFlowInterface when new data is available. | |
virtual bool | connectTo (PortInterface *other, ConnPolicy const &policy) |
Connects this port with other, using the given policy. | |
virtual bool | connectTo (PortInterface *other) |
Connects this port with other, using the default policy of the input. | |
virtual const internal::ConnectionManager * | getManager () const |
Returns the connection manager of this port (if any). | |
const std::string & | getName () const |
Get the name of this Port. | |
bool | setName (const std::string &name) |
Change the name of this unconnected Port. | |
const std::string & | getDescription () const |
Get the documentation of this port. | |
PortInterface & | doc (const std::string &desc) |
Set the documentation of this port. | |
virtual bool | isLocal () const |
Returns true if this port is located on this process, and false otherwise. | |
virtual Service * | createPortObject () |
Create accessor Object for this Port, for addition to a TaskContext Object interface. | |
void | setInterface (DataFlowInterface *iface) |
Once a port is added to a DataFlowInterface, it gets a pointer to that interface. | |
DataFlowInterface * | getInterface () const |
Returns the DataFlowInterface this port belongs to or null if it was not added to such an interface. | |
Protected Member Functions | |
virtual bool | addConnection (internal::ConnID *port_id, base::ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy) |
The ConnectionFactory calls this. | |
bool | connectionAdded (base::ChannelElementBase::shared_ptr channel, ConnPolicy const &policy) |
void | signal () |
The ConnOutputEndpoint signals that new data is available. | |
Protected Attributes | |
types::TypeInfo const * | type_info |
CDataFlowInterface_var | dataflow |
PortableServer::POA_var | mpoa |
internal::ConnectionManager | cmanager |
ConnPolicy | default_policy |
bool | msignal_interface |
DataFlowInterface * | iface |
Proxy for a remote input port.
Since it inherits from ConnFactory, it also allows for building an output endpoint. You can not access its datasource.
Definition at line 123 of file RemotePorts.hpp.
virtual bool RTT::corba::RemoteInputPort::addConnection | ( | internal::ConnID * | port_id, |
base::ChannelElementBase::shared_ptr | channel_input, | ||
ConnPolicy const & | policy | ||
) | [inline, protected, virtual] |
The ConnectionFactory calls this.
Overload to do nothing when dealing with remote ports.
port_id | |
channel_input | |
policy |
Reimplemented from RTT::corba::RemotePort< base::InputPortInterface >.
Definition at line 136 of file RemotePorts.hpp.
RTT::base::PortInterface * RemoteInputPort::antiClone | ( | ) | const [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.
Implements RTT::base::PortInterface.
Definition at line 200 of file RemotePorts.cpp.
References RTT::base::PortInterface::getName(), and RTT::types::TypeInfo::outputPort().
RTT::base::ChannelElementBase::shared_ptr RemoteInputPort::buildRemoteChannelOutput | ( | base::OutputPortInterface & | output_port, |
types::TypeInfo const * | type, | ||
base::InputPortInterface & | reader_, | ||
RTT::ConnPolicy const & | policy | ||
) | [virtual] |
This method will do more than just building the output half, it will create the two crucial ChannelElements on both sides of the CORBA connection to marshal/demarshal the channel data.
The policy is used to determine if storage must be allocated remotely or (has been allocated) locally. reader_ is ignored and must be this.
output_port | The local port that will be sending data to the remote channel. |
type | The type of data to transport |
reader_ | Ignored. Must be this. |
policy | The policy for the ConnFactory. |
Reimplemented from RTT::base::InputPortInterface.
Definition at line 120 of file RemotePorts.cpp.
References RTT::types::TypeInfo::buildDataStorage(), RTT::types::TypeTransporter::createStream(), RTT::base::PortInterface::getInterface(), RTT::base::PortInterface::getName(), RTT::types::TypeInfo::getProtocol(), RTT::types::TypeInfo::getTypeName(), RTT::ConnPolicy::name_id, RTT::ConnPolicy::pull, and RTT::ConnPolicy::transport.
bool RemoteInputPort::channelReady | ( | base::ChannelElementBase::shared_ptr | channel | ) | [virtual] |
For remote input port objects, this is forwarded to the other end over the Data Flow Interface.
The given channel must be the output endpoint of a connection, which was built using buildRemoteChannelOutput. So channel->getOutputEndpoint() == channel
Reimplemented from RTT::base::InputPortInterface.
Definition at line 204 of file RemotePorts.cpp.
References RTT::base::PortInterface::getName().
void InputPortInterface::clear | ( | ) | [inherited] |
Clears the connection.
After call to read() will return false after clear() has been called
Definition at line 145 of file InputPortInterface.cpp.
References RTT::internal::ConnectionManager::clear().
RTT::base::PortInterface * RemoteInputPort::clone | ( | ) | const [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.
Implements RTT::base::PortInterface.
Definition at line 197 of file RemotePorts.cpp.
References RTT::base::PortInterface::getName(), and RTT::types::TypeInfo::inputPort().
bool InputPortInterface::connectTo | ( | PortInterface * | other, |
ConnPolicy const & | policy | ||
) | [virtual, inherited] |
Connects this port with other, using the given policy.
Unlike OutputPortInterface::createConnection, other can be the write port and this
the read port.
Implements RTT::base::PortInterface.
Definition at line 84 of file InputPortInterface.cpp.
References RTT::base::OutputPortInterface::createConnection(), and RTT::base::PortInterface::getName().
Referenced by RTT::base::InputPortInterface::connectTo().
bool InputPortInterface::connectTo | ( | PortInterface * | other | ) | [virtual, inherited] |
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.
Implements RTT::base::PortInterface.
Definition at line 94 of file InputPortInterface.cpp.
References RTT::base::InputPortInterface::connectTo().
bool RTT::corba::RemotePort< base::InputPortInterface >::createStream | ( | const ConnPolicy & | policy | ) | [virtual, inherited] |
Implements RTT::base::PortInterface.
bool RTT::corba::RemotePort< base::InputPortInterface >::disconnect | ( | base::PortInterface * | port | ) | [virtual, inherited] |
Reimplemented from RTT::base::InputPortInterface.
PortInterface & PortInterface::doc | ( | const std::string & | desc | ) | [inherited] |
Set the documentation of this port.
desc | The description of the port |
Definition at line 59 of file PortInterface.cpp.
References RTT::DataFlowInterface::setPortDescription().
Referenced by RTT::InputPort< T >::createPortObject().
RTT::base::DataSourceBase * RemoteInputPort::getDataSource | ( | ) | [virtual] |
Returns a DataSourceBase interface to read this port.
The returned data source is always a new object.
Implements RTT::base::InputPortInterface.
Definition at line 117 of file RemotePorts.cpp.
const std::string& RTT::base::PortInterface::getDescription | ( | ) | const [inline, inherited] |
Get the documentation of this port.
Definition at line 91 of file PortInterface.hpp.
virtual const internal::ConnectionManager* RTT::base::InputPortInterface::getManager | ( | ) | const [inline, virtual, inherited] |
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.
Implements RTT::base::PortInterface.
Definition at line 159 of file InputPortInterface.hpp.
FlowStatus InputPortInterface::read | ( | DataSourceBase::shared_ptr | source, |
bool | copy_old_data = true |
||
) | [virtual, inherited] |
Reads the port and updates the value hold by the given data source.
This is only valid for local ports.
source has to be an assignable data source
Reimplemented in RTT::InputPort< T >.
Definition at line 139 of file InputPortInterface.cpp.
bool InputPortInterface::removeConnection | ( | internal::ConnID * | cid | ) | [virtual, inherited] |
Removes the input channel.
Returns true if the provided channel was actually a channel of this port, and false otherwise.
You should usually not use this directly. Use disconnect() instead.
Implements RTT::base::PortInterface.
Definition at line 123 of file InputPortInterface.cpp.
Referenced by RTT::internal::ConnFactory::createStream(), and RTT::internal::ConnOutputEndpoint< T >::disconnect().
void PortInterface::setInterface | ( | DataFlowInterface * | iface | ) | [inherited] |
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 90 of file PortInterface.cpp.
Referenced by RTT::DataFlowInterface::addLocalPort().
bool PortInterface::setName | ( | const std::string & | name | ) | [inherited] |
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 50 of file PortInterface.cpp.
References RTT::base::PortInterface::connected().
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::TaskContext::addEventPort(), RTT::DataFlowInterface::addPort(), and RTT::TaskContext::addPort().