Skip to main content

Event Class

Base class for events in the helios framework. More...

Declaration

class helios::event::Event { ... }

Derived Classes

classWindowEvent

Abstract base class for Window related events. More...

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

booloperator== (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_ttag () const

Returns the tag for this event. Will be 0 if none was specified. More...

std::stringtoString () const noexcept=0

Private Member Attributes Index

const helios::util::Guidguid_

The guid uniquely identifying _this_ event. More...

const uint64_ttag_

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()

helios::event::Event::Event ()
inline

Constructs a new event with a unique Guid and a default tag of 0.

Definition at line 48 of file Event.ixx.

48 Event(): guid_(helios::util::Guid::generate()), tag_(0) {}

Referenced by operator== and helios::window::event::WindowEvent::WindowEvent.

Event()

helios::event::Event::Event (uint64_t tag)
inline explicit

Constructs a new event with a unique Guid and the specified default tag.

Parameters
tag

Definition at line 56 of file Event.ixx.

56 explicit Event(uint64_t tag): guid_(helios::util::Guid::generate()), tag_(tag) {}

Reference tag.

Public Destructor

~Event()

virtual helios::event::Event::~Event ()
virtual default

Definition at line 42 of file Event.ixx.

Public Operators

operator==()

bool helios::event::Event::operator== (const Event & e)
inline

Compares two event instances based on their unique Guids.

Parameters
e
Returns

Definition at line 86 of file Event.ixx.

86 bool operator==(const Event& e) const {
87 return guid_ == e.guid();
88 }

Reference Event.

Public Member Functions

guid()

const helios::util::Guid & helios::event::Event::guid ()
inline nodiscard

Returns a const reference to this event's unique Guid.

Returns

Definition at line 64 of file Event.ixx.

64 [[nodiscard]] const helios::util::Guid& guid() const {
65 return guid_;
66 }

tag()

uint64_t helios::event::Event::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.

75 [[nodiscard]] uint64_t tag() const {
76 return tag_;
77 }

Referenced by Event, helios::window::event::FrameBufferResizeEvent::FrameBufferResizeEvent, helios::window::event::FrameBufferResizeEvent::toString and helios::window::event::WindowEvent::WindowEvent.

toString()

virtual std::string helios::event::Event::toString ()
nodiscard noexcept

Definition at line 79 of file Event.ixx.

Private Member Attributes

guid_

const helios::util::Guid helios::event::Event::guid_

The guid uniquely identifying _this_ event.

Definition at line 34 of file Event.ixx.

34 const helios::util::Guid guid_;

tag_

const uint64_t helios::event::Event::tag_

An optional tag for this event. Defaults to 0.

Definition at line 39 of file Event.ixx.

39 const uint64_t tag_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.