CFugue
|
#include <EventHandler.h>
Inherits OIL::CEventSource, and OIL::CEventT< const CEventSource, TEventHandlerArgs >.
Public Member Functions | |
void | RaiseEvent (TEventHandlerArgs *pArgs) |
Public Member Functions inherited from OIL::CEventT< const CEventSource, TEventHandlerArgs > | |
void | Subscribe (TEventReceiver *pReceiver, void(TEventReceiver::*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | Subscribe (void(*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | UnSubscribe (void(*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | UnSubscribe (TReceiverClass *pReceiver) |
void | UnSubscribeAll () |
size_t | SubscriberCount () const |
Additional Inherited Members | |
Protected Member Functions inherited from OIL::CEventSource | |
template<typename TEventSource , typename TEventHandlerArgs > | |
void | RaiseEvent (CEventT< TEventSource, TEventHandlerArgs > *pEvent, TEventHandlerArgs *pArgs) |
template<typename TEventSource , typename TEventHandlerArgs > | |
void | RaiseEvent (CEventT< TEventSource, const TEventHandlerArgs > *pEvent, const TEventHandlerArgs *pArgs) |
Protected Member Functions inherited from OIL::CEventT< const CEventSource, TEventHandlerArgs > | |
void | Subscribe (TEventReceiver *pReceiver, void(TEventReceiver::*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | Subscribe (void(*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | UnSubscribe (void(*lpfnHandler)(const CEventSource *, TEventHandlerArgs *)) |
void | UnSubscribe (TReceiverClass *pReceiver) |
void | UnSubscribeAll () |
size_t | SubscriberCount () const |
An event that can be invoked by itself.
A CEventT event can only be used from within a class. To use events outside classes, you need to use CInvokableEventT.
Just declare the variable of CInvokableEventT anywhere in your code, and use its RaiseEvent() method to invoke it.
Use its subscribe() methods to subscribe either static metods or class based methods.
Note that in this case the EventSource is same as the event object itself, which means the handler prototype will be always of the form
where T is the template argument passed while declaring the CInvokableEventT variable.
Following Snippet demonstrates sample usage.
Summary> Default form of CInvokableEventT that uses
as the Event handler procedure /Summary>
Definition at line 404 of file EventHandler.h.
CFugue, the C++ Music Programming Library | © Copyright 2009 Cenacle Research India Private Limited | Gopalakrishna Palem |