The HEventManager class dispatches arbitrary events. More...

#include <HEventManager.h>

Public Member Functions

HEventListenerGetEventListenerManager (const char *eventtype)
 
HEventListenerGetEventListenerManager (HEventListenerType eventtype)
 
 HEventManager ()
 
void RegisterHandler (HEventListener *listener, const char *eventtype, int priority)
 
void RegisterHandler (HEventListener *listener, HEventListenerType eventtype, int priority)
 
bool UnRegisterHandler (HEventListener *listener, const char *eventtype)
 
bool UnRegisterHandler (HEventListener *listener, HEventListenerType eventtype)
 
void UnRegisterHandler (HEventListener *listener)
 

Protected Attributes

struct vhash_s * m_pEventListenerListHash
 
struct vhash_s * m_pEventListenerListHashString
 

Detailed Description

The HEventManager class dispatches arbitrary events.

By registering with the HEventManager, any class that subclasses from HEventListener can receive events from arbitrary sender. Each event type can have any number of recipients

Constructor & Destructor Documentation

◆ HEventManager()

HEventManager::HEventManager ( )

Constructs an HEventManager object.

Member Function Documentation

◆ GetEventListenerManager() [1/2]

HEventListener* HEventManager::GetEventListenerManager ( const char *  eventtype)

Get event listener manager for specified user-defined event type.

Parameters
eventtypeA user-defined event type.
Returns
Event Listener Manager

◆ GetEventListenerManager() [2/2]

HEventListener* HEventManager::GetEventListenerManager ( HEventListenerType  eventtype)

Get event listener manager for specified event type.

Parameters
eventtypeOne of the enumerations from HEventListenerType.
Returns
A pointer to the associatend event listener manager.

◆ RegisterHandler() [1/2]

void HEventManager::RegisterHandler ( HEventListener listener,
const char *  eventtype,
int  priority 
)

Register handler for a user-defined event type.

Parameters
listenerEvent listener to receive event
eventtypeA user-defined event type.
priorityEvent Priority

◆ RegisterHandler() [2/2]

void HEventManager::RegisterHandler ( HEventListener listener,
HEventListenerType  eventtype,
int  priority 
)

Register handler for an event type.

Parameters
listenerEvent listener to receive event
eventtypeOne of the enumerations from HEventListenerType.
priorityEvent Priority

◆ UnRegisterHandler() [1/3]

bool HEventManager::UnRegisterHandler ( HEventListener listener,
const char *  eventtype 
)

Unregister specified event listener from the event manager for the specified user-defined event type.

Parameters
listenerEvent Listener
eventtypeA user-defined event type.

◆ UnRegisterHandler() [2/3]

bool HEventManager::UnRegisterHandler ( HEventListener listener,
HEventListenerType  eventtype 
)

Unregister specified event listener from Event Manager.

Parameters
listenerEvent Listener
eventtypeOne of the enumerations from HEventListenerType.

◆ UnRegisterHandler() [3/3]

void HEventManager::UnRegisterHandler ( HEventListener listener)

Unregister specified event listener from Event Manager for all event types.

Parameters
listenerEvent Listener

Member Data Documentation

◆ m_pEventListenerListHash

struct vhash_s* HEventManager::m_pEventListenerListHash
protected

Event Listener Hash for event types defined in HEventListenerType.

◆ m_pEventListenerListHashString

struct vhash_s* HEventManager::m_pEventListenerListHashString
protected

Event Listener Hash for user-defined event types.


The documentation for this class was generated from the following file: