RTT::DataFlowInterface Class Reference
[Data Flow PortsService InterfaceTask Context Interface]

#include <DataFlowInterface.hpp>

Inheritance diagram for RTT::DataFlowInterface:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::vector< std::string > PortNames
typedef std::vector< std::string > PortNames
typedef std::vector
< base::PortInterface * > 
Ports
typedef std::vector
< base::PortInterface * > 
Ports

Public Member Functions

base::InputPortInterfaceaddEventPort (base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::InputPortInterfaceaddEventPort (const std::string &name, base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::InputPortInterfaceaddEventPort (base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::InputPortInterfaceaddEventPort (const std::string &name, base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::InputPortInterfaceaddLocalEventPort (base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::InputPortInterfaceaddLocalEventPort (base::InputPortInterface &port, base::InputPortInterface::NewDataOnPortEvent::SlotFunction callback=base::InputPortInterface::NewDataOnPortEvent::SlotFunction())
base::PortInterfaceaddLocalPort (base::PortInterface &port)
base::PortInterfaceaddLocalPort (base::PortInterface &port)
base::PortInterfaceaddPort (base::PortInterface &port)
base::PortInterfaceaddPort (const std::string &name, base::PortInterface &port)
base::PortInterfaceaddPort (base::PortInterface &port)
base::PortInterfaceaddPort (const std::string &name, base::PortInterface &port)
void cleanupHandles ()
void cleanupHandles ()
void clear ()
void clear ()
 DataFlowInterface (Service *parent=0)
 DataFlowInterface (Service *parent=0)
TaskContextgetOwner () const
TaskContextgetOwner () const
base::PortInterfacegetPort (const std::string &name) const
base::PortInterfacegetPort (const std::string &name) const
std::string getPortDescription (const std::string &name) const
std::string getPortDescription (const std::string &name) const
PortNames getPortNames () const
PortNames getPortNames () const
Ports getPorts () const
Ports getPorts () const
template<class Type >
Type * getPortType (const std::string &name)
template<class Type >
Type * getPortType (const std::string &name)
ServicegetService () const
ServicegetService () const
void removePort (const std::string &name)
void removePort (const std::string &name)
bool setPortDescription (const std::string &name, const std::string description)
bool setPortDescription (const std::string &name, const std::string description)
void setupHandles ()
void setupHandles ()
 ~DataFlowInterface ()
 ~DataFlowInterface ()

Protected Types

typedef std::vector< HandleHandles
typedef std::vector< HandleHandles

Protected Member Functions

ServicecreatePortObject (const std::string &name)
ServicecreatePortObject (const std::string &name)

Protected Attributes

Handles handles
Ports mports
Servicemservice

Detailed Description

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

Definition at line 55 of file install/include/rtt/DataFlowInterface.hpp.


Member Typedef Documentation

typedef std::vector< Handle > RTT::DataFlowInterface::Handles [protected]

These handles contain the links from an event port's signal to the TaskContext::dataOnPort method.

Definition at line 254 of file rtt/DataFlowInterface.hpp.

typedef std::vector< Handle > RTT::DataFlowInterface::Handles [protected]

These handles contain the links from an event port's signal to the TaskContext::dataOnPort method.

Definition at line 242 of file install/include/rtt/DataFlowInterface.hpp.

typedef std::vector<std::string> RTT::DataFlowInterface::PortNames

A sequence of names of ports.

Definition at line 69 of file rtt/DataFlowInterface.hpp.

typedef std::vector<std::string> RTT::DataFlowInterface::PortNames

A sequence of names of ports.

Definition at line 57 of file install/include/rtt/DataFlowInterface.hpp.

A sequence of pointers to ports.

Definition at line 64 of file rtt/DataFlowInterface.hpp.

A sequence of pointers to ports.

Definition at line 52 of file install/include/rtt/DataFlowInterface.hpp.


Constructor & Destructor Documentation

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

Construct the DataFlow interface of a Service.

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

Definition at line 46 of file DataFlowInterface.cpp.

RTT::DataFlowInterface::~DataFlowInterface (  ) 

Definition at line 50 of file DataFlowInterface.cpp.

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

Construct the DataFlow interface of a Service.

Parameters:
parent If not null, a Service will be added to parent for each port added to this interface.
RTT::DataFlowInterface::~DataFlowInterface (  ) 

Member Function Documentation

base::InputPortInterface& RTT::DataFlowInterface::addEventPort ( base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to the interface of this task and add a Service with the same name of the port. When data arrives on this port your TaskContext will be woken up and updateHook will be executed.

Parameters:
port The port to add.
callback (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port.
Returns:
port
base::InputPortInterface& RTT::DataFlowInterface::addEventPort ( const std::string &  name,
base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
) [inline]

Name and add an Event triggering Port to the interface of this task and add a Service with the same name of the port.

Parameters:
name The name to give to the port.
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 base::PortInterface::getNewDataOnPort().

Definition at line 110 of file rtt/DataFlowInterface.hpp.

base::InputPortInterface& RTT::DataFlowInterface::addEventPort ( base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to the interface of this task and add a Service with the same name of the port. When data arrives on this port your TaskContext will be woken up and updateHook will be executed.

Parameters:
port The port to add.
callback (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port.
Returns:
port
base::InputPortInterface& RTT::DataFlowInterface::addEventPort ( const std::string &  name,
base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
) [inline]

Name and add an Event triggering Port to the interface of this task and add a Service with the same name of the port.

Parameters:
name The name to give to the port.
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 base::PortInterface::getNewDataOnPort().

Definition at line 98 of file install/include/rtt/DataFlowInterface.hpp.

base::InputPortInterface& RTT::DataFlowInterface::addLocalEventPort ( base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to this task without registering a service for it. When data arrives on this port your TaskContext will be woken up and updateHook will be executed.

Parameters:
port The port to add.
callback (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port.
Returns:
port
base::InputPortInterface& RTT::DataFlowInterface::addLocalEventPort ( base::InputPortInterface port,
base::InputPortInterface::NewDataOnPortEvent::SlotFunction  callback = base::InputPortInterface::NewDataOnPortEvent::SlotFunction() 
)

Add an Event triggering Port to this task without registering a service for it. When data arrives on this port your TaskContext will be woken up and updateHook will be executed.

Parameters:
port The port to add.
callback (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port.
Returns:
port
base::PortInterface& RTT::DataFlowInterface::addLocalPort ( base::PortInterface port  ) 

Add a Port to this task without registering a service for it. If a port with the same name already exists, addPort will replace it with port and log a warning.

Returns:
port
PortInterface & RTT::DataFlowInterface::addLocalPort ( base::PortInterface port  ) 

Add a Port to this task without registering a service for it. If a port with the same name already exists, addPort will replace it with port and log a warning.

Returns:
port

Definition at line 75 of file DataFlowInterface.cpp.

base::PortInterface& RTT::DataFlowInterface::addPort ( base::PortInterface port  ) 

Add a Port to the interface of this task and add a Service with the same name of the port. If a port or service with the name already exists, addPort will replace them with port and log a warning.

Parameters:
port The port to add.
Returns:
port
base::PortInterface& RTT::DataFlowInterface::addPort ( const std::string &  name,
base::PortInterface port 
) [inline]

Name and add a Port to the interface of this task and add a Service with the same name of the port.

Parameters:
name The name to give to the port.
port The port to add.

Definition at line 86 of file rtt/DataFlowInterface.hpp.

PortInterface & RTT::DataFlowInterface::addPort ( base::PortInterface port  ) 

Add a Port to the interface of this task and add a Service with the same name of the port. If a port or service with the name already exists, addPort will replace them with port and log a warning.

Parameters:
port The port to add.
Returns:
port

Definition at line 57 of file DataFlowInterface.cpp.

base::PortInterface& RTT::DataFlowInterface::addPort ( const std::string &  name,
base::PortInterface port 
) [inline]

Name and add a Port to the interface of this task and add a Service with the same name of the port.

Parameters:
name The name to give to the port.
port The port to add.

Definition at line 74 of file install/include/rtt/DataFlowInterface.hpp.

void RTT::DataFlowInterface::cleanupHandles (  ) 

Called by TaskContext::stop() to remove all triggers of EventPorts.

void RTT::DataFlowInterface::cleanupHandles (  ) 

Called by TaskContext::stop() to remove all triggers of EventPorts.

Definition at line 112 of file DataFlowInterface.cpp.

void RTT::DataFlowInterface::clear (  ) 

Remove all added ports from this interface and all associated TaskObjects.

Reimplemented in RTT::scripting::ScriptingService, RTT::Service, RTT::scripting::ScriptingService, and RTT::Service.

void RTT::DataFlowInterface::clear (  ) 

Remove all added ports from this interface and all associated TaskObjects.

Reimplemented in RTT::scripting::ScriptingService, RTT::Service, RTT::scripting::ScriptingService, and RTT::Service.

Definition at line 210 of file DataFlowInterface.cpp.

Service* RTT::DataFlowInterface::createPortObject ( const std::string &  name  )  [protected]

Create a Service through which one can access a Port.

Parameters:
name The port name
Service * RTT::DataFlowInterface::createPortObject ( const std::string &  name  )  [protected]

Create a Service through which one can access a Port.

Parameters:
name The port name

Definition at line 195 of file DataFlowInterface.cpp.

TaskContext* RTT::DataFlowInterface::getOwner (  )  const

Returns the component this interface belongs to.

Reimplemented in RTT::Service, and RTT::Service.

TaskContext * RTT::DataFlowInterface::getOwner (  )  const

Returns the component this interface belongs to.

Reimplemented in RTT::Service, and RTT::Service.

Definition at line 53 of file DataFlowInterface.cpp.

base::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.
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.

Definition at line 168 of file DataFlowInterface.cpp.

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.
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.

Definition at line 177 of file DataFlowInterface.cpp.

PortNames RTT::DataFlowInterface::getPortNames (  )  const

Get all port names of this interface.

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

Get all port names of this interface.

Returns:
A sequence of strings containing the port names.
Deprecated:
by getNames()

Definition at line 159 of file DataFlowInterface.cpp.

Ports RTT::DataFlowInterface::getPorts (  )  const

Get all ports of this interface.

Returns:
A sequence of pointers to ports.
DataFlowInterface::Ports RTT::DataFlowInterface::getPorts (  )  const

Get all ports of this interface.

Returns:
A sequence of pointers to ports.

Definition at line 155 of file DataFlowInterface.cpp.

template<class Type >
Type* RTT::DataFlowInterface::getPortType ( const std::string &  name  )  [inline]

Get a port of a specific type.

Definition at line 217 of file rtt/DataFlowInterface.hpp.

template<class Type >
Type* RTT::DataFlowInterface::getPortType ( const std::string &  name  )  [inline]

Get a port of a specific type.

Definition at line 205 of file install/include/rtt/DataFlowInterface.hpp.

Service* RTT::DataFlowInterface::getService (  )  const [inline]

Returns the service this interface belongs to. The returned service is a service living in the component returned by getOwner() or in one of its sub-services.

Definition at line 188 of file rtt/DataFlowInterface.hpp.

Service* RTT::DataFlowInterface::getService (  )  const [inline]

Returns the service this interface belongs to. The returned service is a service living in the component returned by getOwner() or in one of its sub-services.

Definition at line 176 of file install/include/rtt/DataFlowInterface.hpp.

void RTT::DataFlowInterface::removePort ( const std::string &  name  ) 

Remove a Port from this interface. This will remove all connections and callbacks assosiated with this port.

Parameters:
port The port to remove.
void RTT::DataFlowInterface::removePort ( const std::string &  name  ) 

Remove a Port from this interface. This will remove all connections and callbacks assosiated with this port.

Parameters:
port The port to remove.

Definition at line 139 of file DataFlowInterface.cpp.

bool RTT::DataFlowInterface::setPortDescription ( const std::string &  name,
const std::string  description 
)

Sets the description for the service of an added port. It's prefered to use getPort(name)->doc(description) instead of this method, since this function only updates the documentation of the service representing this port, and not the documentation stored in the port.

Parameters:
name The port name
description The new description for this port's service
Returns:
true if the port was found and the description was set, false otherwise.
bool RTT::DataFlowInterface::setPortDescription ( const std::string &  name,
const std::string  description 
)

Sets the description for the service of an added port. It's prefered to use getPort(name)->doc(description) instead of this method, since this function only updates the documentation of the service representing this port, and not the documentation stored in the port.

Parameters:
name The port name
description The new description for this port's service
Returns:
true if the port was found and the description was set, false otherwise.

Definition at line 186 of file DataFlowInterface.cpp.

void RTT::DataFlowInterface::setupHandles (  ) 

Called by TaskContext::start() to setup all triggers of EventPorts.

void RTT::DataFlowInterface::setupHandles (  ) 

Called by TaskContext::start() to setup all triggers of EventPorts.

Definition at line 108 of file DataFlowInterface.cpp.


Member Data Documentation

Definition at line 243 of file install/include/rtt/DataFlowInterface.hpp.

All our ports.

Definition at line 233 of file install/include/rtt/DataFlowInterface.hpp.

The parent Service. May be null in exceptional cases.

Definition at line 237 of file install/include/rtt/DataFlowInterface.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:47 2013