Event Class
Base class for events in the helios framework. More...
Declaration
Derived Classes
| class | WindowEvent |
Public Constructors Index
| Event () | |
|
Constructs a new event with a unique Guid and a default tag of 0. More... | |
| Event (uint64_t tag) | |
|
Constructs a new event with a unique Guid and the specified default tag. More... | |
Public Destructor Index
| ~Event ()=default | |
Public Operators Index
| bool | operator== (const Event &e) const |
|
Compares two event instances based on their unique Guids. More... | |
Public Member Functions Index
| const helios::util::Guid & | guid () const |
|
Returns a const reference to this event's unique Guid. More... | |
| uint64_t | tag () const |
|
Returns the tag for this event. Will be 0 if none was specified. More... | |
| std::string | toString () const noexcept=0 |
Private Member Attributes Index
| const helios::util::Guid | guid_ |
|
The guid uniquely identifying _this_ event. More... | |
| const uint64_t | tag_ |
|
An optional tag for this event. Defaults to 0. More... | |
Description
Base class for events in the helios framework.
`Event` provides a common interface for all application related events. Each event instance is uniquely identified by a `Guid` generated upon construction. An additional tag can be provided to identify groups of events for further categorization or filtering.
Events should be treated as immutable after construction.
- Todo
-
can we reset the value for Guids in between frames, if events are guaranteed to be dispatched and processed in between frames?
Definition at line 29 of file Event.ixx.
Public Constructors
Event()
| inline |
Constructs a new event with a unique Guid and a default tag of 0.
Definition at line 48 of file Event.ixx.
Referenced by operator== and helios::window::event::WindowEvent::WindowEvent.
Event()
Public Member Functions
guid()
| inline nodiscard |
Returns a const reference to this event's unique Guid.
- Returns
tag()
| inline nodiscard |
Returns the tag for this event. Will be 0 if none was specified.
- Returns
Definition at line 75 of file Event.ixx.
Referenced by Event, helios::window::event::FrameBufferResizeEvent::FrameBufferResizeEvent, helios::window::event::FrameBufferResizeEvent::toString and helios::window::event::WindowEvent::WindowEvent.
toString()
Private Member Attributes
guid_
|
The guid uniquely identifying _this_ event.
Definition at line 34 of file Event.ixx.
tag_
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.