REFERENCE MANUAL
#include <hps.h>
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 |
Type | ObjectType () const |
bool | operator!= (EventDispatcher const &in_that) const |
EventDispatcher & | operator= (EventDispatcher &&in_that) |
EventDispatcher & | operator= (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 |
![]() | |
virtual bool | Empty () const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
bool | HasType (Type in_mask) const |
Object (Object &&in_that) | |
Object & | operator= (Object const &other_object) |
Object & | operator= (Object &&in_that) |
Type | Type () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
The EventDispatcher class is used for injecting any events and dealing with event handlers which handle those events.
EventDispatcher::EventDispatcher | ( | ) |
The default constructor creates an uninitialized EventDispatcher object which cannot be subscribed to.
EventDispatcher::EventDispatcher | ( | EventDispatcher const & | in_that | ) |
The copy constructor creates an EventDispatcher object that points to the same underlying impl as the source EventDispatcher.
in_that | The source EventHandler to point to. |
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.
in_that | An rvalue reference to a EventDispatcher to take the impl from. |
bool EventDispatcher::Equals | ( | EventDispatcher const & | in_that | ) | const |
Check if the source EventDispatcher is equivalent to this object.
in_that | The source EventDispatcher to compare to this object. |
bool EventDispatcher::InjectEvent | ( | Event const & | in_event | ) | const |
Inject the specified event and propagate it to all subscribed handlers in the order of subscription.
in_event | Event to inject and propagate. |
EventNotifier 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.
in_event | Event to inject and propagate. |
bool EventDispatcher::IsShutdown | ( | ) | const |
Query whether the asynchronous shutdown has completed.
|
inlinevirtual |
This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.
Reimplemented from Object.
bool EventDispatcher::operator!= | ( | EventDispatcher const & | in_that | ) | const |
Check if the source EventDispatcher is not equivalent to this object.
in_that | The source EventDispatcher to compare to this object. |
EventDispatcher& EventDispatcher::operator= | ( | EventDispatcher && | in_that | ) |
The move assignment operator transfers the underlying impl of the rvalue reference to this EventDispatcher thereby avoiding a copy.
in_that | An rvalue reference to an EventDispatcher to take the impl from. |
EventDispatcher& EventDispatcher::operator= | ( | EventDispatcher const & | in_that | ) |
Associate this EventDispatcher with the same underlying impl as the source EventDispatcher.
in_that | The source EventDispatcher for the assignment. |
bool EventDispatcher::operator== | ( | EventDispatcher const & | in_that | ) | const |
Check if the source EventDispatcher is equivalent to this object.
in_that | The source EventDispatcher to compare to this object. |
void EventDispatcher::SetName | ( | char const * | in_name | ) | const |
Sets the EventDispatcher's name
in_name | Name to set. |
void EventDispatcher::ShowName | ( | UTF8 & | out_name | ) | const |
Shows the EventDispatcher's name
out_name | Current name of this EventDispatcher. |
void 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 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.
in_handler | Event handler to add to the subscriber list for events of the given type. |
in_type | Type of event to add the handler for. |
bool 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.
in_handler | Event handler to remove from the subscriber list for events of the given type. |
in_type | Type of event to remove the handler for. |
bool 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.
in_handler | Event handler to remove from the subscriber list for events of the given type. |
in_type | Type of event to remove the handler for. |
bool 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.
in_handler | Event handler to remove from the subscriber list for events of the given type. |
in_type | Type of event to remove the handler for. |