OpenGUI::EventCallback Class Reference

#include <OpenGUI_EventHandler.h>

Inheritance diagram for OpenGUI::EventCallback:

OpenGUI::EventHandler List of all members.

Detailed Description

Self destroying C-callback style event delegate.

Example usage:
Assume obj is a pointer to a valid Object, and desiredEvent is a valid event for that Object.
        obj->getEvents()["desiredEvent"].add( new EventCallback(&myCallback) );


Public Types

typedef void EventCallbackFunc (Object *sender, EventArgs &args)
 Function signature required for use as C-style event callback.

Public Member Functions

 EventCallback (EventCallbackFunc *C_funcPtr)
 Constructor requires a pointer to a valid C function pointer.
virtual void onEvent (Object *sender, EventArgs &args)
 Calls the function given at event callback creation on event trigger.
virtual void onEventDestruction ()
 Automatically deletes self on event destruction.


Member Typedef Documentation

typedef void OpenGUI::EventCallback::EventCallbackFunc(Object *sender, EventArgs &args)

Function signature required for use as C-style event callback.

 void myCallback( Object* , EventArgs* ); 


Constructor & Destructor Documentation

OpenGUI::EventCallback::EventCallback ( EventCallbackFunc C_funcPtr  )  [inline]

Constructor requires a pointer to a valid C function pointer.


Member Function Documentation

virtual void OpenGUI::EventCallback::onEvent ( Object sender,
EventArgs args 
) [inline, virtual]

Calls the function given at event callback creation on event trigger.

Implements OpenGUI::EventHandler.

virtual void OpenGUI::EventCallback::onEventDestruction (  )  [inline, virtual]

Automatically deletes self on event destruction.

This is so that you do not need to retain a pointer to it. In fact, you probably shouldn't.

Reimplemented from OpenGUI::EventHandler.


The documentation for this class was generated from the following file:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Fri Jan 5 23:05:25 2007