Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BackCaller Class Reference

Class prototype which provides functions to handle callbackable classes. More...

#include <backcaller.h>

Inheritance diagram for BackCaller:

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

Detailed Description

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

Member Typedef Documentation

typedef unsigned long CallbackableType

Constructor & Destructor Documentation

~BackCaller ( )
virtual

Member Function Documentation

void addCallbackable ( Callbackable callbackableInstance,
CallbackableType  type = BackCaller::DEFAULT_CALLBACKABLE_TYPE 
)
virtual

Adds a Callbackable instance to this caller instance.

Parameters
typethe desired CallbackableType of the Callbackable class.
callbackableInstancethe instance to add
void callBack ( CallbackableType  type = BackCaller::DEFAULT_CALLBACKABLE_TYPE)
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.

Parameters
typethe CallbackableType of the Callbackable classes.
void callBackQMP ( CallbackableType  type = BackCaller::DEFAULT_CALLBACKABLE_TYPE)
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.

Parameters
typethe CallbackableType of the Callbackable classes.
void removeAllCallbackables ( CallbackableType  type)
virtual

Removes all Callbackable instances from this caller instance.

Parameters
typethe CallbackableType of the Callbackable class to be removed.
void removeCallbackable ( Callbackable callbackableInstance,
CallbackableType  type = BackCaller::DEFAULT_CALLBACKABLE_TYPE 
)
virtual

Removes a Callbackable instance from this caller instance.

Parameters
typethe CallbackableType of the Callbackable class.
callbackableInstance

Member Data Documentation

const CallbackableType DEFAULT_CALLBACKABLE_TYPE = 0
static

This is the default Callbackable type.

If you derive from BackCaller, just define your own CallbackableTypes.


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