Orocos Real-Time Toolkit  2.8.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTT::corba::RemoteInputPort Class Reference

Proxy for a remote input port. More...

#include <rtt/transports/corba/RemotePorts.hpp>

Inheritance diagram for RTT::corba::RemoteInputPort:
RTT::corba::RemotePort< base::InputPortInterface > RTT::base::InputPortInterface RTT::base::PortInterface

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. More...
 
base::PortInterfaceclone () const
 Create a local clone of this port with the same name. More...
 
base::PortInterfaceantiClone () const
 Create a local clone of this port with the same name. More...
 
virtual bool disconnect (PortInterface *port)
 Removes the channel that connects this port to port. More...
 
base::DataSourceBasegetDataSource ()
 Returns a DataSourceBase interface to read this port. More...
 
virtual bool channelReady (base::ChannelElementBase::shared_ptr channel, ConnPolicy const &policy)
 For remote input port objects, this is forwarded to the other end over the Data Flow Interface. More...
 
PortableServer::POA_ptr _default_POA ()
 
CDataFlowInterface_ptr getDataFlowInterface () const
 
internal::ConnIDgetPortID () const
 
types::TypeInfo const * getTypeInfo () const
 
int serverProtocol () const
 
bool connected () const
 
bool createStream (const ConnPolicy &policy)
 
virtual void disconnect ()
 
void clear ()
 Clears the connection. More...
 
ConnPolicy getDefaultPolicy () const
 
virtual bool removeConnection (internal::ConnID *cid)
 Removes the input channel. More...
 
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. More...
 
void signalInterface (bool true_false)
 When called with true, will signal the DataFlowInterface when new data is available. More...
 
virtual bool connectTo (PortInterface *other, ConnPolicy const &policy)
 Connects this port with other, using the given policy. More...
 
virtual bool connectTo (PortInterface *other)
 Connects this port with other, using the default policy of the input. More...
 
virtual const internal::ConnectionManagergetManager () const
 Returns the connection manager of this port (if any). 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...
 
PortInterfacedoc (const std::string &desc)
 Set the documentation of this port. More...
 
virtual bool isLocal () const
 Returns true if this port is located on this process, and false otherwise. More...
 
virtual ServicecreatePortObject ()
 Create accessor Object for this Port, for addition to a TaskContext Object interface. More...
 
void setInterface (DataFlowInterface *iface)
 Once a port is added to a DataFlowInterface, it gets a pointer to that interface. More...
 
DataFlowInterfacegetInterface () const
 Returns the DataFlowInterface this port belongs to or null if it was not added to such an interface. More...
 

Protected Member Functions

virtual bool addConnection (internal::ConnID *port_id, base::ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy)
 The ConnectionFactory calls this. More...
 
bool connectionAdded (base::ChannelElementBase::shared_ptr channel, ConnPolicy const &policy)
 
void signal ()
 The ConnOutputEndpoint signals that new data is available. More...
 

Protected Attributes

types::TypeInfo const * type_info
 
CDataFlowInterface_var dataflow
 
PortableServer::POA_var mpoa
 
internal::ConnectionManager cmanager
 
ConnPolicy default_policy
 
bool msignal_interface
 
DataFlowInterfaceiface
 

Detailed Description

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 126 of file RemotePorts.hpp.

Constructor & Destructor Documentation

RemoteInputPort::RemoteInputPort ( types::TypeInfo const *  type_info,
CDataFlowInterface_ptr  dataflow,
std::string const &  name,
PortableServer::POA_ptr  poa 
)

Definition at line 105 of file RemotePorts.cpp.

Member Function Documentation

PortableServer::POA_ptr RTT::corba::RemotePort< base::InputPortInterface >::_default_POA ( )
inherited
virtual bool RTT::corba::RemoteInputPort::addConnection ( internal::ConnID port_id,
base::ChannelElementBase::shared_ptr  channel_input,
ConnPolicy const &  policy 
)
inlineprotectedvirtual

The ConnectionFactory calls this.

Overload to do nothing when dealing with remote ports.

Parameters
port_id
channel_input
policy
Returns

Reimplemented from RTT::corba::RemotePort< base::InputPortInterface >.

Definition at line 139 of file RemotePorts.hpp.

References RTT::corba::RemotePort< PortClass >::dataflow, RTT::corba::RemotePort< PortClass >::disconnect(), and RTT::corba::RemotePort< PortClass >::type_info.

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(), RTT::types::TypeInfo::outputPort(), and RTT::corba::RemotePort< base::InputPortInterface >::type_info.

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.

Parameters
output_portThe local port that will be sending data to the remote channel.
typeThe type of data to transport
reader_Ignored. Must be this.
policyThe policy for the ConnFactory.
Returns
The local endpoint for the output.

Reimplemented from RTT::base::InputPortInterface.

Definition at line 114 of file RemotePorts.cpp.

References RTT::types::TypeInfo::buildDataStorage(), CORBA_EXCEPTION_INFO, RTT::types::TypeTransporter::createStream(), RTT::corba::RemotePort< base::InputPortInterface >::dataflow, RTT::Error, RTT::base::PortInterface::getInterface(), RTT::base::PortInterface::getName(), RTT::types::TypeInfo::getProtocol(), RTT::types::TypeInfo::getTypeName(), RTT::Info, RTT::corba::RemotePort< base::InputPortInterface >::mpoa, RTT::ConnPolicy::name_id, ORO_CORBA_PROTOCOL_ID, RTT::ConnPolicy::pull, toCORBA(), toRTT(), and RTT::ConnPolicy::transport.

bool RemoteInputPort::channelReady ( base::ChannelElementBase::shared_ptr  channel,
RTT::ConnPolicy const &  policy 
)
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

Returns

Reimplemented from RTT::base::InputPortInterface.

Definition at line 204 of file RemotePorts.cpp.

References CORBA_EXCEPTION_INFO, RTT::corba::RemotePort< base::InputPortInterface >::dataflow, RTT::Error, RTT::base::PortInterface::getName(), and toCORBA().

void InputPortInterface::clear ( )
inherited

Clears the connection.

After call to read() will return false after clear() has been called

Definition at line 155 of file InputPortInterface.cpp.

Referenced by RTT::InputPort< T >::createPortObject(), and RTT::internal::InputPortSource< T >::reset().

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(), RTT::types::TypeInfo::inputPort(), and RTT::corba::RemotePort< base::InputPortInterface >::type_info.

bool RTT::corba::RemotePort< base::InputPortInterface >::connected ( ) const
virtualinherited

Reimplemented from RTT::base::InputPortInterface.

bool RTT::corba::RemotePort< base::InputPortInterface >::connectionAdded ( base::ChannelElementBase::shared_ptr  channel,
ConnPolicy const &  policy 
)
inlineprotectedinherited

Definition at line 69 of file RemotePorts.hpp.

bool InputPortInterface::connectTo ( PortInterface other,
ConnPolicy const &  policy 
)
virtualinherited

Connects this port with other, using the given policy.

Unlike OutputPortInterface::createConnection, other can be the write port and this the read port.

Returns
true on success, false on failure

Implements RTT::base::PortInterface.

Definition at line 85 of file InputPortInterface.cpp.

References RTT::base::OutputPortInterface::createConnection(), RTT::Error, and RTT::base::PortInterface::getName().

bool InputPortInterface::connectTo ( PortInterface other)
virtualinherited

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.

Returns
true on success, false on failure

Implements RTT::base::PortInterface.

Definition at line 95 of file InputPortInterface.cpp.

Service * PortInterface::createPortObject ( )
virtualinherited
bool RTT::corba::RemotePort< base::InputPortInterface >::createStream ( const ConnPolicy policy)
virtualinherited
virtual void RTT::corba::RemotePort< base::InputPortInterface >::disconnect ( void  )
virtualinherited

Reimplemented from RTT::base::InputPortInterface.

bool RemoteInputPort::disconnect ( PortInterface port)
virtual

Removes the channel that connects this port to port.

All other ports or callbacks remain unaffected.

Reimplemented from RTT::base::InputPortInterface.

Definition at line 191 of file RemotePorts.cpp.

References RTT::base::PortInterface::disconnect().

PortInterface & PortInterface::doc ( const std::string &  desc)
inherited

Set the documentation of this port.

Parameters
descThe description of the port
Returns
a reference to this object.

Definition at line 60 of file PortInterface.cpp.

References RTT::base::PortInterface::iface, and RTT::DataFlowInterface::setPortDescription().

Referenced by RTT::InputPort< T >::createPortObject().

CDataFlowInterface_ptr RTT::corba::RemotePort< base::InputPortInterface >::getDataFlowInterface ( ) const
inherited
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 111 of file RemotePorts.cpp.

ConnPolicy InputPortInterface::getDefaultPolicy ( ) const
inherited
const std::string& RTT::base::PortInterface::getDescription ( ) const
inlineinherited

Get the documentation of this port.

Returns
A description.

Definition at line 91 of file PortInterface.hpp.

DataFlowInterface * PortInterface::getInterface ( ) const
inherited

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 RTT::base::PortInterface::iface.

Referenced by buildRemoteChannelOutput(), RTT::corba::RemoteOutputPort::createConnection(), and RTT::mqueue::MQSendRecv::setupStream().

virtual const internal::ConnectionManager* RTT::base::InputPortInterface::getManager ( ) const
inlinevirtualinherited

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.

Returns
null if no such manager is available, or the manager otherwise.
See also
ConnectionManager::getChannels() for a list of all connections of this port.

Implements RTT::base::PortInterface.

Definition at line 159 of file InputPortInterface.hpp.

const std::string& RTT::base::PortInterface::getName ( ) const
inlineinherited
internal::ConnID* RTT::corba::RemotePort< base::InputPortInterface >::getPortID ( ) const
virtualinherited

Reimplemented from RTT::base::PortInterface.

types::TypeInfo const* RTT::corba::RemotePort< base::InputPortInterface >::getTypeInfo ( ) const
virtualinherited
bool PortInterface::isLocal ( ) const
virtualinherited

Returns true if this port is located on this process, and false otherwise.

Definition at line 67 of file PortInterface.cpp.

References RTT::base::PortInterface::serverProtocol().

Referenced by RTT::internal::ConnFactory::createAndCheckOutOfBandConnection(), and RTT::internal::ConnFactory::createConnection().

FlowStatus InputPortInterface::read ( DataSourceBase::shared_ptr  source,
bool  copy_old_data = true 
)
virtualinherited

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 149 of file InputPortInterface.cpp.

bool InputPortInterface::removeConnection ( internal::ConnID cid)
virtualinherited

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 133 of file InputPortInterface.cpp.

Referenced by RTT::internal::ConnFactory::createStream(), and RTT::internal::ConnOutputEndpoint< T >::disconnect().

int RTT::corba::RemotePort< base::InputPortInterface >::serverProtocol ( ) const
virtualinherited

Reimplemented from RTT::base::PortInterface.

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 91 of file PortInterface.cpp.

References RTT::base::PortInterface::iface.

Referenced by RTT::DataFlowInterface::addLocalPort(), and RTT::corba::CDataFlowInterface_i::deregisterChannel().

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.

Return values
trueif !this->connected(), the name has changed.
falseif this->connected(), the name has not been changed.

Definition at line 51 of file PortInterface.cpp.

References RTT::base::PortInterface::connected().

Referenced by RTT::DataFlowInterface::addEventPort(), RTT::TaskContext::addEventPort(), RTT::DataFlowInterface::addPort(), and RTT::TaskContext::addPort().

void InputPortInterface::signal ( )
protectedinherited

The ConnOutputEndpoint signals that new data is available.

Definition at line 139 of file InputPortInterface.cpp.

Referenced by RTT::internal::ConnOutputEndpoint< T >::signal().

void InputPortInterface::signalInterface ( bool  true_false)
inherited

When called with true, will signal the DataFlowInterface when new data is available.

Definition at line 144 of file InputPortInterface.cpp.

Referenced by RTT::DataFlowInterface::addLocalEventPort().

Member Data Documentation

internal::ConnectionManager RTT::base::InputPortInterface::cmanager
protectedinherited
CDataFlowInterface_var RTT::corba::RemotePort< base::InputPortInterface >::dataflow
protectedinherited

Definition at line 66 of file RemotePorts.hpp.

Referenced by buildRemoteChannelOutput(), and channelReady().

ConnPolicy RTT::base::InputPortInterface::default_policy
protectedinherited

Definition at line 70 of file InputPortInterface.hpp.

DataFlowInterface* RTT::base::PortInterface::iface
protectedinherited
PortableServer::POA_var RTT::corba::RemotePort< base::InputPortInterface >::mpoa
protectedinherited

Definition at line 67 of file RemotePorts.hpp.

Referenced by buildRemoteChannelOutput().

bool RTT::base::InputPortInterface::msignal_interface
protectedinherited

Definition at line 74 of file InputPortInterface.hpp.

types::TypeInfo const* RTT::corba::RemotePort< base::InputPortInterface >::type_info
protectedinherited

Definition at line 65 of file RemotePorts.hpp.

Referenced by antiClone(), and clone().


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