RTT::DataFlowInterface Class Reference
[Data Transfer Ports]

The Interface of a TaskContext which exposes its data-flow ports. More...

#include <rtt/DataFlowInterface.hpp>

List of all members.

Public Types

typedef std::vector
< PortInterface * > 
Ports
 A sequence of pointers to ports.
typedef std::vector< std::string > PortNames
 A sequence of names of ports.

Public Member Functions

 DataFlowInterface (OperationInterface *parent=0)
 Construct the DataFlow interface of a TaskContext.
bool addPort (PortInterface *port)
 Add a Port to this task.
bool addEventPort (PortInterface *port, PortInterface::NewDataOnPortEvent::SlotFunction callback=PortInterface::NewDataOnPortEvent::SlotFunction())
 Add an Event triggering Port to this task.
const PortsgetEventPorts () const
 Returns the list of all ports emitting events when new data arrives.
bool addPort (PortInterface *port, std::string description)
 Add a Port to the interface of this task.
bool addEventPort (PortInterface *port, std::string description, PortInterface::NewDataOnPortEvent::SlotFunction callback=PortInterface::NewDataOnPortEvent::SlotFunction())
 Add an Event triggering Port to the interface of this task.
void removePort (const std::string &name)
 Remove a Port from this interface.
Ports getPorts () const
 Get all ports of this interface.
PortNames getPortNames () const
 Get all port names of this interface.
PortNames getNames () const
 Get all port names of this interface.
PortInterfacegetPort (const std::string &name) const
 Get an added port.
std::string getPortDescription (const std::string &name) const
 Get the description of an added Port.
OperationInterfacecreatePortObject (const std::string &name)
 Create a Task Object through which one can access a Port.
template<class Type >
Type * getPortType (const std::string &name)
 Get a port of a specific type.
void clear ()
 Remove all added ports from this interface and all associated TaskObjects.

Protected Types

typedef std::vector< std::pair
< PortInterface *, std::string > > 
PortStore

Protected Attributes

Ports eports
PortStore mports
OperationInterfacemparent

Detailed Description

The Interface of a TaskContext which exposes its data-flow ports.

Definition at line 55 of file DataFlowInterface.hpp.


Constructor & Destructor Documentation

RTT::DataFlowInterface::DataFlowInterface ( OperationInterface parent = 0  ) 

Construct the DataFlow interface of a TaskContext.

Parameters:
parent If not null, a TaskObject will be added to parent for each port added to this interface.

Member Function Documentation

bool RTT::DataFlowInterface::addEventPort ( PortInterface port,
std::string  description,
PortInterface::NewDataOnPortEvent::SlotFunction  callback = PortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to the interface of this task.

It is added to both the C++ interface and the scripting interface.

Parameters:
port The port to add.
description A user readable description of this port.
callback (Optional) provide a function which will be called asynchronously when new data arrives on this port. You can add more functions by using the port directly using PortInterface::getNewDataOnPort().
bool RTT::DataFlowInterface::addEventPort ( PortInterface port,
PortInterface::NewDataOnPortEvent::SlotFunction  callback = PortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to this task.

It is only added to the C++ interface and can not be used in scripting.

Parameters:
port The port to add.
Returns:
true if the port could be added, false if already added.
Parameters:
callback (Optional) provide a function which will be called asynchronously when new data arrives on this port. You can add more functions by using the port directly using PortInterface::getNewDataOnPort().
bool RTT::DataFlowInterface::addPort ( PortInterface port,
std::string  description 
)

Add a Port to the interface of this task.

It is added to both the C++ interface and the scripting interface.

Parameters:
port The port to add.
description A user readable description of this port.
bool RTT::DataFlowInterface::addPort ( PortInterface port  ) 

Add a Port to this task.

It is only added to the C++ interface and can not be used in scripting.

Parameters:
port The port to add.
Returns:
true if the port could be added, false if already added.
OperationInterface* RTT::DataFlowInterface::createPortObject ( const std::string &  name  ) 

Create a Task Object through which one can access a Port.

This is required to access ports from the scripting interface.

Parameters:
name The port name
Deprecated:
Do not use this function. It is no longer required., the objects are directly added to the parent TaskContext in addPort.
PortNames RTT::DataFlowInterface::getNames (  )  const

Get all port names of this interface.

Returns:
A sequence of strings containing the port names.
PortInterface* RTT::DataFlowInterface::getPort ( const std::string &  name  )  const

Get an added port.

Parameters:
name The port name
Returns:
a pointer to a port or null if it does not exist.
std::string RTT::DataFlowInterface::getPortDescription ( const std::string &  name  )  const

Get the description of an added Port.

Parameters:
name The port name
Returns:
The description or "" if it does not exist.
PortNames RTT::DataFlowInterface::getPortNames (  )  const

Get all port names of this interface.

Returns:
A sequence of strings containing the port names.
Deprecated:
by getNames()
Ports RTT::DataFlowInterface::getPorts (  )  const

Get all ports of this interface.

Returns:
A sequence of pointers to ports.
void RTT::DataFlowInterface::removePort ( const std::string &  name  ) 

Remove a Port from this interface.

Parameters:
port The port to remove.

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