ot::CallbackModule Class Reference
[Common Classes]

#include <CallbackModule.h>

Inheritance diagram for ot::CallbackModule:

Inheritance graph
[legend]
Collaboration diagram for ot::CallbackModule:

Collaboration graph
[legend]
List of all members.

Detailed Description

The module and factory to drive the callback nodes. It constructs CallbackNode nodes via the NodeFactory interface and registers callbacks with them after parsing
Author:
Gerhard Reitmayr


Public Member Functions

 CallbackModule ()
virtual ~CallbackModule ()
virtual NodecreateNode (const std::string &name, StringTable &attributes)
void getLocalCallbackMap (fctmap_type &fmap)
void setCallback (const std::string &name, OTCallbackFunction *function, void *data=NULL)
void setGlobalCallback (OTGlobalCallbackFunction *function, void *data=NULL)
OTGlobalCallbackFunctiongetGlobalCallbackFunction () const
void * getGlobalCallbackData () const

Protected Attributes

NodeMap nodes
 map of strings onto nodes
OTGlobalCallbackFunctiongcbfunction
 global callback function pointer
void * gcbdata
 data passed to global callback function
fctmap_type lcbmap


Constructor & Destructor Documentation

ot::CallbackModule::CallbackModule  )  [inline]
 

constructor method.

virtual ot::CallbackModule::~CallbackModule  )  [inline, virtual]
 

Destructor method, clears nodes member.


Member Function Documentation

Node * ot::CallbackModule::createNode const std::string &  name,
StringTable attributes
[virtual]
 

This method is called to construct a new Node. It compares name to the TestSource element name, and if it matches creates a new TestSource node.

Parameters:
name reference to string containing element name refenrence to StringMap containing attribute values
Returns:
pointer to new Node or NULL. The new Node must be allocated with new !

Implements ot::NodeFactory.

void * ot::CallbackModule::getGlobalCallbackData  )  const
 

returns the global callback function data

OTGlobalCallbackFunction * ot::CallbackModule::getGlobalCallbackFunction  )  const
 

returns the global callback function

void ot::CallbackModule::getLocalCallbackMap fctmap_type fmap  ) 
 

This method can be used to setup a map of the existing per node callback functions and data registered in all nodes of the module regardless of their current existance. This function is internally used to keep registered callback functions alive, when the context is newly set up or copied

void ot::CallbackModule::setCallback const std::string &  name,
OTCallbackFunction function,
void *  data = NULL
 

sets a callback on a certain node. The node is identified by its unique name. Any present callback function in the node is overwritten by the new one.

Parameters:
name the unique name of the callback node
function the new callback function to set on the node
data pointer to data that is passed to the callback function

void ot::CallbackModule::setGlobalCallback OTGlobalCallbackFunction function,
void *  data = NULL
 

sets a global callback. Any present global callback function in the module is overwritten by the new one.

Parameters:
function the new callback function to set on the module
data pointer to data that is passed to the callback function


Member Data Documentation

void* ot::CallbackModule::gcbdata [protected]
 

data passed to global callback function

OTGlobalCallbackFunction* ot::CallbackModule::gcbfunction [protected]
 

global callback function pointer

fctmap_type ot::CallbackModule::lcbmap [protected]
 

map storing all local callbacks -> even if the nodes are not there Thus Callbacks are bound when the node is created later on

NodeMap ot::CallbackModule::nodes [protected]
 

map of strings onto nodes


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:27:49 2007 for NaviTrack by  doxygen 1.4.6