API Search || Global Search
HPS::EventDispatcher Class Reference

#include <hps.h>

Inheritance diagram for HPS::EventDispatcher:
HPS::Object

Public Member Functions

bool Equals (EventDispatcher const &in_that) const
 
 EventDispatcher ()
 
 EventDispatcher (EventDispatcher const &in_that)
 
 EventDispatcher (EventDispatcher &&in_that)
 
bool InjectEvent (Event const &in_event) const
 
EventNotifier InjectEventWithNotifier (Event const &in_event) const
 
bool IsShutdown () const
 
HPS::Type ObjectType () const
 
bool operator!= (EventDispatcher const &in_that) const
 
EventDispatcheroperator= (EventDispatcher &&in_that)
 
EventDispatcheroperator= (EventDispatcher const &in_that)
 
bool operator== (EventDispatcher const &in_that) const
 
void SetName (char const *in_name) const
 
void ShowName (UTF8 &out_name) const
 
void Shutdown () const
 
bool Subscribe (EventHandler const &in_handler, intptr_t in_type) const
 
bool UnSubscribe (EventHandler const &in_handler, intptr_t in_type) const
 
bool UnSubscribe (EventHandler const &in_handler) const
 
bool UnSubscribe (intptr_t in_type) const
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual HPS::Type Type () const
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::EventDispatcher
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Detailed Description

The EventDispatcher class is used for injecting any events and dealing with event handlers which handle those events.

Constructor & Destructor Documentation

HPS::EventDispatcher::EventDispatcher ( )

The default constructor creates an uninitialized EventDispatcher object which cannot be subscribed to.

See also
Database::CreateEventDispatcher()
HPS::EventDispatcher::EventDispatcher ( EventDispatcher const &  in_that)

The copy constructor creates an EventDispatcher object that points to the same underlying impl as the source EventDispatcher.

Parameters
in_thatThe source EventHandler to point to.
HPS::EventDispatcher::EventDispatcher ( EventDispatcher &&  in_that)

The move constructor creates a EventDispatcher by transferring the underlying impl of the rvalue reference to this EventDispatcher thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a EventDispatcher to take the impl from.

Member Function Documentation

bool HPS::EventDispatcher::Equals ( EventDispatcher const &  in_that) const

Check if the source EventDispatcher is equivalent to this object.

Parameters
in_thatThe source EventDispatcher to compare to this object.
Returns
true if the objects are equivalent, false otherwise.
bool HPS::EventDispatcher::InjectEvent ( Event const &  in_event) const

Inject the specified event and propagate it to all subscribed handlers in the order of subscription.

Parameters
in_eventEvent to inject and propagate.
Returns
true if the event injection was successful, false otherwise.
EventNotifier HPS::EventDispatcher::InjectEventWithNotifier ( Event const &  in_event) const

Inject the specified event and propagate it to all subscribed handlers in the order of subscription and return an EventNotifier associated with the injected event.

Parameters
in_eventEvent to inject and propagate.
Returns
An event notifier associated with the injected event.
bool HPS::EventDispatcher::IsShutdown ( ) const

Query whether the asynchronous shutdown has completed.

Returns
true if the event dispatcher has shutdown, false otherwise.
bool HPS::EventDispatcher::operator!= ( EventDispatcher const &  in_that) const

Check if the source EventDispatcher is not equivalent to this object.

Parameters
in_thatThe source EventDispatcher to compare to this object.
Returns
true if the objects are not equivalent, false otherwise.
EventDispatcher& HPS::EventDispatcher::operator= ( EventDispatcher &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this EventDispatcher thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to an EventDispatcher to take the impl from.
Returns
A reference to this EventDispatcher.
EventDispatcher& HPS::EventDispatcher::operator= ( EventDispatcher const &  in_that)

Associate this EventDispatcher with the same underlying impl as the source EventDispatcher.

Parameters
in_thatThe source EventDispatcher for the assignment.
Returns
A reference to this EventDispatcher.
bool HPS::EventDispatcher::operator== ( EventDispatcher const &  in_that) const

Check if the source EventDispatcher is equivalent to this object.

Parameters
in_thatThe source EventDispatcher to compare to this object.
Returns
true if the objects are equivalent, false otherwise.
void HPS::EventDispatcher::SetName ( char const *  in_name) const

Sets the EventDispatcher's name

Parameters
in_nameName to set.
void HPS::EventDispatcher::ShowName ( UTF8 out_name) const

Shows the EventDispatcher's name

Parameters
out_nameCurrent name of this EventDispatcher.
void HPS::EventDispatcher::Shutdown ( ) const

Shutdown this EventDispatcher asynchronously. Any pending events injected into this EventDispatcher will be processed prior to shutdown, but no new events can be injected.

bool HPS::EventDispatcher::Subscribe ( EventHandler const &  in_handler,
intptr_t  in_type 
) const

Add the specified event handler to the list of subscribers for events of the specified type on this EventDispatcher.

Parameters
in_handlerEvent handler to add to the subscriber list for events of the given type.
in_typeType of event to add the handler for.
Returns
true if the subscription was successful, false otherwise.
bool HPS::EventDispatcher::UnSubscribe ( EventHandler const &  in_handler,
intptr_t  in_type 
) const

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Parameters
in_handlerEvent handler to remove from the subscriber list for events of the given type.
in_typeType of event to remove the handler for.
Returns
true if the unsubscription was successful, false otherwise.
bool HPS::EventDispatcher::UnSubscribe ( EventHandler const &  in_handler) const

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Parameters
in_handlerEvent handler to remove from the subscriber list for events of the given type.
in_typeType of event to remove the handler for.
Returns
true if the unsubscription was successful, false otherwise.
bool HPS::EventDispatcher::UnSubscribe ( intptr_t  in_type) const

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Parameters
in_typeType of event to remove the handler for.
Returns
true if the unsubscription was successful, false otherwise.

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