Robot Simulator of the Robotics Group for Self-Organization of Control: BackCaller Class Reference

# BackCaller Class Reference

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

`#include <backcaller.h>`

Inherited by BackCallerVector< _Tp, _Alloc >, BackCallerVector< OdeAgent * >, Configurable, and ConfigurableList.

List of all members.

## Classes
struct | CallbackableTypeHash
## 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.
virtual void | removeCallbackable (Callbackable *callbackableInstance, CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE)
| Removes a Callbackable instance from this caller instance.
virtual void | removeAllCallbackables (CallbackableType type)
| Removes all Callbackable instances from this caller instance.
virtual void | callBack (CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE)
| Calls all registered callbackable classes of the determined type.
virtual void | callBackQMP (CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE)
| Calls all registered callbackable classes of the determined type.
## Static Public Attributes
static const CallbackableType | DEFAULT_CALLBACKABLE_TYPE = 0
| This is the default Callbackable type.

## 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 | ( |  | ) |

~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:

  | type | the desired CallbackableType of the Callbackable class.
  | callbackableInstance | the 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:

  | type | the 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:

  | type | the CallbackableType of the Callbackable classes.

void removeAllCallbackables | ( | CallbackableType | type | ) | `[virtual]`

Removes all Callbackable instances from this caller instance.

Parameters:

  | type | the 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:

  | type | the 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:

- backcaller.h
- backcaller.cpp