RTT::Corba::CorbaPort Class Reference

A port used by ControlTaskProxy objects to connect a corba data or buffer channel as an Orocos Port. More...

#include <rtt/corba/CorbaPort.hpp>

Inheritance diagram for RTT::Corba::CorbaPort:
RTT::PortInterface

List of all members.

Public Types

enum  PortType { ReadPort, WritePort, ReadWritePort }
 

This enum classifies if a port is inbound outbound or both.


enum  ConnectionModel { Buffered, Data }
 

This enum classifies the kind of data connections that are available through ports: buffered or data.


typedef Event< void(PortInterface *) NewDataOnPortEvent )

Public Member Functions

 CorbaPort (const std::string &name, DataFlowInterface_ptr dflow, PortableServer::POA_ptr)
 CorbaPort (const std::string &name, DataFlowInterface_ptr dflow, AssignableExpression_ptr datachannel, PortableServer::POA_ptr)
 CorbaPort (const std::string &name, DataFlowInterface_ptr dflow, BufferChannel_ptr bufchannel, PortableServer::POA_ptr)
AssignableExpression_ptr getDataChannel ()
BufferChannel_ptr getBufferChannel ()
virtual ConnectionModel getConnectionModel () const
 Get the ConnectionModel of this port.
virtual PortType getPortType () const
 Get the PortType of this port.
virtual const TypeInfogetTypeInfo () const
 Get the data type of this port.
virtual bool connected () const
 Inspect if this Port is currently connected with another Port.
virtual
RTT::ConnectionInterface::shared_ptr 
connection () const
 Returns the connection in which this Port currently participates.
virtual bool connectTo (RTT::ConnectionInterface::shared_ptr conn)
 Connect this port to a Connection.
virtual void disconnect ()
 No longer participate in a connection.
virtual PortInterfaceclone () const
 Create a clone of this port with the same name.
virtual PortInterfaceantiClone () const
 Create the anti-clone (inverse port) of this port with the same name A port for reading will return a new port for writing and vice versa.
virtual
RTT::ConnectionInterface::shared_ptr 
createConnection (ConnectionTypes::ConnectionType con_type=ConnectionTypes::lockfree)
 Create a remote server to which one can connect to.
virtual
RTT::ConnectionInterface::shared_ptr 
createConnection (BufferBase::shared_ptr buf)
 Create a new connection object using a buffered connection implementation.
virtual
RTT::ConnectionInterface::shared_ptr 
createConnection (DataSourceBase::shared_ptr data)
 Create a new connection object using a data connection implementation.
virtual int serverProtocol () const
 Returns the protocol over which this port can be accessed.
const std::string & getName () const
 Get the name of this Port.
bool setName (const std::string &name)
 Change the name of this unconnected Port.
bool ready () const
 Returns true if this Port is ready to be used.
void signal ()
 Call this method to signal that new data is available on this port.
NewDataOnPortEvent * getNewDataOnPortEvent ()
 Returns an Event object which is triggered every time new data is made available on this port.
virtual bool connectTo (PortInterface *other)
 Connect to another Port and create a new connection if necessary.
virtual TaskObjectcreatePortObject ()
 Create accessor Object for this Port, for addition to a TaskContext Object interface.

Protected Member Functions

bool connect (RTT::ConnectionInterface::shared_ptr conn)
 Connects this port to a connection object.

Protected Attributes

AssignableExpression_var mdatachannel
BufferChannel_var mbufchannel
DataFlowInterface_var mdflow
RTT::ConnectionInterface::shared_ptr dc
std::string portname
NewDataOnPortEvent * new_data_on_port_event

Friends

class ConnectionInterface

Detailed Description

A port used by ControlTaskProxy objects to connect a corba data or buffer channel as an Orocos Port.

Definition at line 58 of file CorbaPort.hpp.


Member Function Documentation

bool RTT::Corba::CorbaPort::connect ( RTT::ConnectionInterface::shared_ptr  conn  )  [inline, protected, virtual]

Connects this port to a connection object.

This function must test if this port is compatible with conn.

Returns:
true if a successful connection could be made.

Implements RTT::PortInterface.

Definition at line 59 of file CorbaPort.hpp.

virtual RTT::ConnectionInterface::shared_ptr RTT::Corba::CorbaPort::connection (  )  const [inline, virtual]

Returns the connection in which this Port currently participates.

It is possible that this port is part of a dormant connection, ( the connection object is not in the connected() state), in that case this method will return null, until the dormant connection becomes connected().

Return values:
null if not connected to another Port.

Implements RTT::PortInterface.

Definition at line 163 of file CorbaPort.hpp.

virtual bool RTT::PortInterface::connectTo ( PortInterface other  )  [virtual, inherited]

Connect to another Port and create a new connection if necessary.

  • If this port is already connected, this method returns false.
  • If the other port has a connection, this method is equivalent to 'this->connectTo( other->connection() )'.
  • If the other port is not connected, a new connection is created and both ports are connected.
    Returns:
    true upon success, false otherwise.

Referenced by RTT::ReadBufferPort< T >::antiClone().

virtual bool RTT::Corba::CorbaPort::connectTo ( RTT::ConnectionInterface::shared_ptr  conn  )  [inline, virtual]

Connect this port to a Connection.

If the connection is in the connected() state, this port will participate in that connection, otherwise, the port will become connected once conn becomes connected().

Returns:
true if connection was possible, false otherwise.

Implements RTT::PortInterface.

Definition at line 172 of file CorbaPort.hpp.

virtual RTT::ConnectionInterface::shared_ptr RTT::Corba::CorbaPort::createConnection ( DataSourceBase::shared_ptr  data  )  [inline, virtual]

Create a new connection object using a data connection implementation.

Returns:
null if this->connected() or this->getConnectionModel() != Data else a valid connection object is returned.

Reimplemented from RTT::PortInterface.

Definition at line 250 of file CorbaPort.hpp.

virtual RTT::ConnectionInterface::shared_ptr RTT::Corba::CorbaPort::createConnection ( BufferBase::shared_ptr  buf  )  [inline, virtual]

Create a new connection object using a buffered connection implementation.

Returns:
null if this->connected() or this->getConnectionModel() != Buffered else a valid connection object is returned.

Reimplemented from RTT::PortInterface.

Definition at line 234 of file CorbaPort.hpp.

bool RTT::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:
true if !this->connected(), the name has changed.
false if this->connected(), the name has not been changed.

The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:45 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3