Classes | Public Member Functions | Private Attributes | List of all members
OpenRTM_aist.Timer.Timer Class Reference

Timer class. More...

Classes

class  Task
 

Public Member Functions

def __del__ (self)
 Destructor. More...
 
def __init__ (self, interval)
 Constructor. More...
 
def invoke (self)
 Invoke Timer task. More...
 
def join (self)
 
def registerListener (self, listener, tm)
 Register listener. More...
 
def registerListenerFunc (self, cbf, tm)
 Register listener. More...
 
def registerListenerObj (self, obj, cbf, tm)
 Register listener. More...
 
def run (self)
 Thread execution function for Timer. More...
 
def start (self)
 
def stop (self)
 Stop Timer task. More...
 
def unregisterListener (self, id)
 Unregister listener. More...
 

Private Attributes

 _interval
 
 _running
 
 _runningMutex
 
 _taskMutex
 
 _tasks
 
 _thread
 

Detailed Description

Timer class.

Invoke the callback function of registered listener periodically at the set cycle.

Since
0.4.0

Definition at line 44 of file Timer.py.

Constructor & Destructor Documentation

def OpenRTM_aist.Timer.Timer.__init__ (   self,
  interval 
)

Constructor.

Constructor

Parameters
intervalThe interval of timer

Definition at line 66 of file Timer.py.

def OpenRTM_aist.Timer.Timer.__del__ (   self)

Destructor.

Destructor

Definition at line 88 of file Timer.py.

Member Function Documentation

def OpenRTM_aist.Timer.Timer.invoke (   self)

Invoke Timer task.

Subtract the interval of timer from the waiting time for invocation of each registered listener. If the listener whose waiting time reached 0 exists, invoke the callback function.

Definition at line 199 of file Timer.py.

def OpenRTM_aist.Timer.Timer.join (   self)

Definition at line 96 of file Timer.py.

def OpenRTM_aist.Timer.Timer.registerListener (   self,
  listener,
  tm 
)

Register listener.

Register the listener of callback function invoked from this Timer by specifying the interval. If the same listener has already been regiseterd, the value specified the invocation interval of listener will be updated.

Parameters
listenerListener for the registration
tmThe invocation interval of listener
Returns
ID of the registerd listener

ListenerId registerListener(ListenerBase* listener, TimeValue tm);

Definition at line 241 of file Timer.py.

def OpenRTM_aist.Timer.Timer.registerListenerFunc (   self,
  cbf,
  tm 
)

Register listener.

Register listener by specifying the method for callback and the invocation interval.

Parameters
cbfTarget method for callback
tmThe invocation interval of listener
Returns
ID of the registerd listener

ListenerId registerListenerFunc(void (*cbf)(), TimeValue tm)

Definition at line 315 of file Timer.py.

def OpenRTM_aist.Timer.Timer.registerListenerObj (   self,
  obj,
  cbf,
  tm 
)

Register listener.

Register listener by specifying the object for callback, the method for callback and the invocation interval.

Parameters
objTarget object for callback
cbfTarget method for callback
tmThe invocation interval of listener
Returns
ID of the registerd listener

template <class listenerclass>=""> ListenerId registerListenerObj(ListenerClass* obj, void (ListenerClass::*cbf)(), TimeValue tm)

Definition at line 285 of file Timer.py.

def OpenRTM_aist.Timer.Timer.run (   self)

Thread execution function for Timer.

Thread execution function for Timer. Invoke the callback function of registered listener.

Returns
Execution result

Definition at line 123 of file Timer.py.

def OpenRTM_aist.Timer.Timer.start (   self)

Definition at line 148 of file Timer.py.

def OpenRTM_aist.Timer.Timer.stop (   self)

Stop Timer task.

Stop Timer task.

Definition at line 171 of file Timer.py.

def OpenRTM_aist.Timer.Timer.unregisterListener (   self,
  id 
)

Unregister listener.

Unregister the listener specified by ID. If the listener specified by ID is not registerd, false will be returned.

Parameters
idID of the unregisterd listener
Returns
Unregistration result

bool unregisterListener(ListenerId id);

Definition at line 344 of file Timer.py.

Member Data Documentation

OpenRTM_aist.Timer.Timer._interval
private

Definition at line 67 of file Timer.py.

OpenRTM_aist.Timer.Timer._running
private

Definition at line 68 of file Timer.py.

OpenRTM_aist.Timer.Timer._runningMutex
private

Definition at line 69 of file Timer.py.

OpenRTM_aist.Timer.Timer._taskMutex
private

Definition at line 71 of file Timer.py.

OpenRTM_aist.Timer.Timer._tasks
private

Definition at line 70 of file Timer.py.

OpenRTM_aist.Timer.Timer._thread
private

Definition at line 72 of file Timer.py.


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


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:38