The Interface of a TaskContext which exposes its data-flow ports. More...
#include <rtt/DataFlowInterface.hpp>
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 Ports & | getEventPorts () 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. | |
PortInterface * | getPort (const std::string &name) const |
Get an added port. | |
std::string | getPortDescription (const std::string &name) const |
Get the description of an added Port. | |
OperationInterface * | createPortObject (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 |
OperationInterface * | mparent |
The Interface of a TaskContext which exposes its data-flow ports.
Definition at line 55 of file DataFlowInterface.hpp.
RTT::DataFlowInterface::DataFlowInterface | ( | OperationInterface * | parent = 0 |
) |
Construct the DataFlow interface of a TaskContext.
parent | If not null, a TaskObject will be added to parent for each port added to this interface. |
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.
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.
port | The port to add. |
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.
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.
port | The port to add. |
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.
name | The port name |
PortNames RTT::DataFlowInterface::getNames | ( | ) | const |
Get all port names of this interface.
PortInterface* RTT::DataFlowInterface::getPort | ( | const std::string & | name | ) | const |
Get an added port.
name | The port name |
std::string RTT::DataFlowInterface::getPortDescription | ( | const std::string & | name | ) | const |
Get the description of an added Port.
name | The port name |
PortNames RTT::DataFlowInterface::getPortNames | ( | ) | const |
Get all port names of this interface.
Ports RTT::DataFlowInterface::getPorts | ( | ) | const |
Get all ports of this interface.
void RTT::DataFlowInterface::removePort | ( | const std::string & | name | ) |
Remove a Port from this interface.
port | The port to remove. |