Registry Class Reference

This class maps symbolic callback-names to "real" callbacks and manages animations. More...

#include <Registry.h>

Collaboration diagram for Registry:

List of all members.


Classes

class  Container

Static Public Member Functions

static void registerCallBack (CallBack *callback, const char *symbol)
static void registerCallBack (StaticCallBack callback, const char *symbol)
static void callCallBack (const char *name, const char *value)
static void unregisterCallBack (const char *symbol)
static void registerAnimation (Animation *ani, const char *symbol)
static void callAnimate (MenuObject *obj, const char *symbol)
static void callUnAnimate (MenuObject *obj, const char *symbol)

Static Private Member Functions

static void callback (CallBack *cb)

Static Private Attributes

static ObjectStore< CallBackcallbackStore
static ObjectStore< AnimationanimationStore

Detailed Description

This class maps symbolic callback-names to "real" callbacks and manages animations.

If an application needs a menu, it has to define an XML-file, explaining which widgets are needed and where they should be placed. It is also necessary to define which actions should be invoked by the widget. Because the addresses of callback-methods are unknown at compile time, only symbolic names can be used to describe what should happen, when someone uses a widget. So somehow the symbolic names (short "symbols") must be mapped on real callback-methods. And this is exactly the job of this class.

This class maps callback-methods on symbolic names. These callback-methods can be static methods or methods of objects:

These callbacks can be invoked by the static method Registry::callCallBack(const char* symbol). This method is used by the widgets. They parse the XML-file and store the symbolic names for the callback. If someone uses these widgets, the callback will be performed.

For each callback-invocation also the symbol, which have been used for Registry::callCallBack(const char* symbol) is passed to the called method. This is usefull, if a callback-method is registered serveral times with different symbols.

This class is also used for storing references to Animation -objects. New animations are added by the method Registry::registerAnimation( Animation *ani, const char* symbol). These animations can be triggered using the methods callAnimate( MenuObject *obj, const char* symbol ) and callUnAnimate( MenuObject *obj, const char* symbol ).

Date:
21st of April 2007
Author:
Thomas Weberndorfer

Member Function Documentation

void Registry::callAnimate ( MenuObject obj,
const char *  symbol 
) [static]

This method performs an animation.

Parameters:
obj Perform the animation on this object.
symbol Use the animation, which has been registered with this symbol.

void Registry::callback ( CallBack cb  )  [static, private]

void Registry::callCallBack ( const char *  name,
const char *  value 
) [static]

This method invokes the callback-method, which has been bound to the symbolic name.

Parameters:
name use the name of the calling MenuObject for this parameter
value this indicates the reason for the call

void Registry::callUnAnimate ( MenuObject obj,
const char *  symbol 
) [static]

This method cancels all effects of Registry::callAnimate(MenuObject *obj, const char* symbol), which has to be called before.

Parameters:
obj Undo the animation for this object.
symbol The animation using this symbol will be undone.

void Registry::registerAnimation ( Animation ani,
const char *  symbol 
) [static]

This method registers a new animation. Each Animation -object has to be registered using an unique symbol.

Parameters:
ani referenz to the Animation -object
symbol the symbolic name of the Animation -object

static void Registry::registerCallBack ( StaticCallBack  callback,
const char *  symbol 
) [inline, static]

This method is used for registering a callback with its corresponding symbolic name.

Parameters:
callback reference to a static callback-method
symbol Pass the corresponding symbolic name.

void Registry::registerCallBack ( CallBack callback,
const char *  symbol 
) [static]

This method is used for registering a callback with its corresponding symbolic name.

Parameters:
callback reference to the object with the callback-method
symbol Pass the corresponding symbolic name.

void Registry::unregisterCallBack ( const char *  symbol  )  [static]

This method unregisters a registered callback-method. The typ of the registered method (static or an object) is regarless.

Parameters:
symbol The registered method with this symbol will be unregistered.


Member Data Documentation


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

Generated on Wed Oct 20 16:12:00 2010 for inVRs by doxygen 1.5.8