ot::CallbackNode Class Reference
[Common Classes]

#include <CallbackNode.h>

Inheritance diagram for ot::CallbackNode:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements a simple node that stores a function pointer and calls it every time an event it received. The event passed to the can be changed by the function and the changes will propagate to the parent node. Furthermore it passes the event on to its single child.
Author:
Gerhard Reitmayr


Public Member Functions

virtual int isEventGenerator ()
virtual void onEventGenerated (Event &event, Node &generator)
const std::string & getCallbackName (void) const

Public Attributes

std::string name
OTCallbackFunctionfunction
 callback function
void * data
 data pointer
Event event
 the event passed to the function and the parent
mutex_type eventmutex
 mutex to protect the event
CallbackModulecbmodule
 pointer to creating module CallbackModule

Protected Member Functions

 CallbackNode (const std::string &name_)

Friends

class CallbackModule


Constructor & Destructor Documentation

ot::CallbackNode::CallbackNode const std::string &  name_  )  [inline, protected]
 

constructor method,sets commend member

Parameters:
name_ the name of the Callback node


Member Function Documentation

const std::string& ot::CallbackNode::getCallbackName void   )  const [inline]
 

This method returns the value set by the name attribute of the CallbackNode. This is a different value then the one returned by getName() which is the value set by the attribute DEF.

Returns:
reference to the name string.

virtual int ot::CallbackNode::isEventGenerator  )  [inline, virtual]
 

tests for EventGenerator interface being present. Is overriden to return 1 always.

Returns:
always 1

Reimplemented from ot::Node.

void ot::CallbackNode::onEventGenerated Event event,
Node generator
[virtual]
 

This method notifies the object that a new event was generated.

Parameters:
event reference to the new event.
generator reference to the EventGenerator object that notified the EventObserver.

Reimplemented from ot::Node.


Friends And Related Function Documentation

friend class CallbackModule [friend]
 


Member Data Documentation

CallbackModule* ot::CallbackNode::cbmodule
 

pointer to creating module CallbackModule

void* ot::CallbackNode::data
 

data pointer

Event ot::CallbackNode::event
 

the event passed to the function and the parent

mutex_type ot::CallbackNode::eventmutex
 

mutex to protect the event

OTCallbackFunction* ot::CallbackNode::function
 

callback function

std::string ot::CallbackNode::name
 

name of the CallbackNode for retrieving it from the module. Note that this is not the name returned by getName(), rather the value set by the attribute name.

Reimplemented from ot::Node.


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