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

More...

Public Member Functions

def __init__ (self)
 
def __del__ (self)
 
def __call__ (self, fsmprof)
 
def toString (status)
 

Detailed Description

FsmProfileListener class

FsmProfileListener class is a base class for the listener objects which realize callback to hook FSM Profile related actions. To hook execution just before a FSM profile action, the callback object should be defined as follows, and set to RTObject through appropriate callback set function.

 class MyListener
   : public FsmProfileListener
 {
   std::string m_name;
 public:
   MyListener(const char* name) : m_name(name) {}
   virtual ~MyListener() {}

   virtual void operator()(const ::RTC::FsmProfile& fsmprof)
   {
     std::cout << "Listner name:  " m_name << std::endl;
   };
 };
 

The listener class defined above is set to RTObject as follows.

 RTC::ReturnCode_t ConsoleIn::onInitialize()
 {
     addFsmProfileListener(SET_FSM_PROFILE,
                           new MyListener("prof listener"),
                           true);
    :
 

The first argument "SET_FSM_PROFILE" specifies callback hook point, and the following values are available. Not all the callback points are implemented. It depends on the FSM service implementations.

The second argument is a pointers to the listener object. The third argument is a flag for automatic object destruction. When "true" is given to the third argument, the given object in second argument is automatically destructed with RTObject. In the "false " case, the ownership of the object is left in the caller side, and then destruction of the object must be done by users' responsibility.

It is good for setting "true" as third argument, if the listener object life span is equals to the RTObject's life cycle. On the otehr hand, if callbacks are required to set/unset depending on its situation, the third argument could be "false". In that case, listener objects pointers must be stored to member variables, and set/unset of the listener objects shoud be paerformed throguh addFsmProfileListener()/removeFsmProfileListener() functions.

Constructor & Destructor Documentation

◆ __init__()

def OpenRTM_aist.FsmActionListener.FsmProfileListener.__init__ (   self)

Constructor

◆ __del__()

def OpenRTM_aist.FsmActionListener.FsmProfileListener.__del__ (   self)

Destructor

Member Function Documentation

◆ __call__()

def OpenRTM_aist.FsmActionListener.FsmProfileListener.__call__ (   self,
  fsmprof 
)

Virtual Callback function

This is a the Callback function for FsmProfileListener.

virtual void operator()(const ::RTC::FsmProfile& fsmprof) = 0;

◆ toString()

def OpenRTM_aist.FsmActionListener.FsmProfileListener.toString (   status)

Convert FsmProfileListenerType into the string.

Convert FsmProfileListenerType into the string.

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

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