OpenRTM-aist-Python 2.0.0
Public Member Functions | List of all members
OpenRTM_aist.ConnectorListener.ConnectorListener Class Reference

More...

Inheritance diagram for OpenRTM_aist.ConnectorListener.ConnectorListener:
OpenRTM_aist.EventPort.EventConnListener OpenRTM_aist.EventPort_pyfsm.EventConnListener

Public Member Functions

def toString (status)
 

Detailed Description

ConnectorListener class

This class is abstract base class for listener classes that realize callbacks for various events in the data port's connectors.

Callbacks can be hooked to the various kind of events which occur throgh OutPort side data write action to InPort side data-read action. Two types listener classes exist. One is ConnectorDataListener which receives valid data-port's data value at that time such as buffer-full event, data-send event, and so on. Other is ConnectorListener which does not receive any data such as buffer-empty event, buffer-read-timeout event and so on.

If you want to hook related actions by ConnectorListener, a class which inherits this class should be defined, and the functor should receive a connector information as an argument. And then, the defined class must be set to data-port object through its member function, as follows.

 class MyListener
   : public ConnectorListener
 {
 public:
   MyListener(const char* name) : m_name(name) {}
   virtual ~MyListener() {}
   virtual ReturnCode operator()(ConnectorInfo& info)
   {
     std::cout << "Data Listener: " << m_name       << std::endl;
     std::cout << "Profile::name: " << info.name    << std::endl;
     std::cout << "Profile::id:   " << info.id      << std::endl;
     std::cout << "Profile::properties: "           << std::endl;
     std::cout << info.properties;
   };
   std::string m_name;
 };
 

The listener class defained as above can be attached to a data-port as follows.

 RTC::ReturnCode_t ConsoleIn::onInitialize()
 {
     m_outOut.
         addConnectorListener(ON_BUFFER_EMPTY,
                              new MyDataListener("ON_BUFFER_EMPTY"));
    :
 

The first argument "ON_BUFFER_EMPTY" specifies hook point of callback, and the following values are available. Data-port can be specified some properties such as interface-type, dataflow-type, subscription type and so on. Available hook points vary by the those settings. The following hook points are available when interface type is CORBA CDR type.

OutPort:

This class manages one ore more instances of ConnectorListener class.

Member Function Documentation

◆ toString()

def OpenRTM_aist.ConnectorListener.ConnectorListener.toString (   status)

Convert ConnectorListenerType into the string.

Convert ConnectorListenerType into the string.

Parameters
typeThe target ConnectorListenerType for transformation
Returns
Trnasformation result of string representation

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