#include <OpenGUI_EventHandler.h>
Inheritance diagram for OpenGUI::EventDelegate:

This delegate class is capable of binding to either C-style function pointers or object specific member function pointers. It performs the smoke and magic through an abstract interface class system, and the use of a very light template in the specific case of member function callbacks.
Public Member Functions | |
| EventDelegate (EventCallbackFunc *C_funcPtr) | |
| Create the delegate from a C function pointer. | |
| template<class CLASS, class ARGS_TYPE> | |
| EventDelegate (CLASS *classObjPtr, void(CLASS::*memberFunc)(Object *, ARGS_TYPE &)) | |
| Create the delegate from an object bound member function pointer. | |
| virtual void | onEvent (Object *sender, EventArgs &args) |
| Calls the function/member given at EventDelegate creation on event trigger. | |
| virtual void | onEventDestruction () |
| Automatically deletes self on event destruction. | |
|
|
Create the delegate from a C function pointer.
|
|
||||||||||||||||
|
Create the delegate from an object bound member function pointer.
obj is a pointer to a valid Object, desiredEvent is a valid event for that Object, and myClassObj is a valid pointer to an instance of MyClass. obj->getEvents()["desiredEvent"].add( new EventDelegate(myClassObj, &MyClass::myMethod) );
|
|
||||||||||||
|
Calls the function/member given at EventDelegate creation on event trigger.
Implements OpenGUI::EventHandler. |
|
|
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. |