HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_EventEmitter Class Referenceabstract

#include <PDG_EventEmitter.h>

+ Inheritance diagram for PDG_EventEmitter:

Public Member Functions

 PDG_EventEmitter (PDG_EventQueue *event_queue, bool block_destruction)
 
virtual ~PDG_EventEmitter ()
 
virtual const PDG_EventFiltersupportedEventTypes () const =0
 Returns the list of supported event types for this emitter. More...
 
int64 getMemoryUsage (bool inclusive) const
 Returns memory usage for this event emitter instance. More...
 
bool addEventHandler (PDG_EventHandler *handler)
 Adds an event handlers that listens for all types of events. More...
 
bool addEventHandler (PDG_EventHandler *handler, PDG_EventType event)
 Adds an event handlers that listens for a specific event. More...
 
bool addEventHandler (PDG_EventHandler *handler, const PDG_EventFilter &filter)
 
void removeEventHandler (PDG_EventHandler *handler)
 Removes an event handler from this emitter. More...
 
void removeAllEventHandlers (bool user_handler_only=false)
 
void emitEvent (const PDG_Event &event, bool immediate=false) const
 Emit an event to all handlers. More...
 
void eventHandlers (PDG_EventHandlerArray &handlers) const
 
void setEventQueue (PDG_EventQueue *event_queue)
 
void clearEventQueue ()
 
bool shouldEmit (const PDG_Event &event) const
 

Friends

class PDG_EventQueue
 

Detailed Description

Definition at line 22 of file PDG_EventEmitter.h.

Constructor & Destructor Documentation

PDG_EventEmitter::PDG_EventEmitter ( PDG_EventQueue event_queue,
bool  block_destruction 
)
virtual PDG_EventEmitter::~PDG_EventEmitter ( )
virtual

Member Function Documentation

bool PDG_EventEmitter::addEventHandler ( PDG_EventHandler handler)

Adds an event handlers that listens for all types of events.

bool PDG_EventEmitter::addEventHandler ( PDG_EventHandler handler,
PDG_EventType  event 
)

Adds an event handlers that listens for a specific event.

bool PDG_EventEmitter::addEventHandler ( PDG_EventHandler handler,
const PDG_EventFilter filter 
)

Adds an event handler with a filter, so that it only listens for events in the specified list

void PDG_EventEmitter::clearEventQueue ( )

Clears the emitter's event queue without running any registration or deregistration logic

void PDG_EventEmitter::emitEvent ( const PDG_Event event,
bool  immediate = false 
) const

Emit an event to all handlers.

void PDG_EventEmitter::eventHandlers ( PDG_EventHandlerArray handlers) const

Safely makes a copy of the list of handlers. If this emitter is currently being destroyed, the resulting array is empty

int64 PDG_EventEmitter::getMemoryUsage ( bool  inclusive) const

Returns memory usage for this event emitter instance.

void PDG_EventEmitter::removeAllEventHandlers ( bool  user_handler_only = false)

Removes all event handlers from this emitter. If user_handler_only is true, only user-added event handlers are removed.

void PDG_EventEmitter::removeEventHandler ( PDG_EventHandler handler)

Removes an event handler from this emitter.

void PDG_EventEmitter::setEventQueue ( PDG_EventQueue event_queue)

Sets the event queue associated with this event emitter. This method will also register the emitter with the queue, and unregister it with the old queue. If the queue is being destroyed then the clearEventQueue method should be called instead

bool PDG_EventEmitter::shouldEmit ( const PDG_Event event) const

Returns true if the emitter should handle the specified event, and false if no handler is assigned for it

virtual const PDG_EventFilter& PDG_EventEmitter::supportedEventTypes ( ) const
pure virtual

Returns the list of supported event types for this emitter.

Implemented in PDG_Scheduler, PDG_Node, PDG_GraphContext, PDG_WorkItem, and PDG_ServiceManager.

Friends And Related Function Documentation

friend class PDG_EventQueue
friend

Definition at line 86 of file PDG_EventEmitter.h.


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