Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
|
Class prototype which provides functions to handle callbackable classes. More...
#include <backcaller.h>
Public Types | |
typedef unsigned long | CallbackableType |
Public Member Functions | |
BackCaller () | |
virtual | ~BackCaller () |
virtual void | addCallbackable (Callbackable *callbackableInstance, CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE) |
Adds a Callbackable instance to this caller instance. More... | |
virtual void | removeCallbackable (Callbackable *callbackableInstance, CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE) |
Removes a Callbackable instance from this caller instance. More... | |
virtual void | removeAllCallbackables (CallbackableType type) |
Removes all Callbackable instances from this caller instance. More... | |
virtual void | callBack (CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE) |
Calls all registered callbackable classes of the determined type. More... | |
virtual void | callBackQMP (CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE) |
Calls all registered callbackable classes of the determined type. More... | |
Static Public Attributes | |
static const CallbackableType | DEFAULT_CALLBACKABLE_TYPE = 0 |
This is the default Callbackable type. More... | |
Class prototype which provides functions to handle callbackable classes.
If a class implements this class, just use the function callBack which calls all registered callbackable classes. If you use different callbackable pools, just use the overloaded functions callBack(CallbackableType type), addCallbackable(CallbackableType, Callbackable* cb) and removeCallbackable(CallbackableType, Callbackable* cb).
typedef unsigned long CallbackableType |
BackCaller | ( | ) |
|
virtual |
|
virtual |
Adds a Callbackable instance to this caller instance.
type | the desired CallbackableType of the Callbackable class. |
callbackableInstance | the instance to add |
|
virtual |
Calls all registered callbackable classes of the determined type.
This is done by Callbackable::doOnCallback(CallbackableType type). You can make this function private/protected if you like.
type | the CallbackableType of the Callbackable classes. |
|
virtual |
Calls all registered callbackable classes of the determined type.
This is done by Callbackable::doOnCallback(CallbackableType type). This function uses QUICKMP in order to parallelise the callbacks. Remember that there is only shared the used CallbackableList. So if you have other variables/objects to share, implement your own version. You can make this function private/protected if you like.
type | the CallbackableType of the Callbackable classes. |
|
virtual |
Removes all Callbackable instances from this caller instance.
type | the CallbackableType of the Callbackable class to be removed. |
|
virtual |
Removes a Callbackable instance from this caller instance.
type | the CallbackableType of the Callbackable class. |
callbackableInstance |
|
static |
This is the default Callbackable type.
If you derive from BackCaller, just define your own CallbackableTypes.