qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Base class for all events in the actor system. More...

#include <Event.h>

Inheritance diagram for qb::Event:

Public Types

using id_handler_type = ActorId
using id_type = const char *

Public Member Functions

bool is_alive () const noexcept
 Check if the event is still alive and can be processed.
id_type getID () const noexcept
 Get the event's type ID for event routing and handling.
uint8_t getQOS () const noexcept
 Get the event's quality of service level.
id_handler_type getDestination () const noexcept
 Get the destination actor ID.
id_handler_type getSource () const noexcept
 Get the source actor ID.
std::size_t getSize () const noexcept
 Get the size of the event in bytes.

Static Public Member Functions

template<typename T>
static constexpr id_type type_to_id ()
 Get the type identifier at runtime.

Detailed Description

Base class for all events in the actor system.

Event provides the base functionality for event identification, routing, and quality of service. It is the foundation for all event types in the actor system.

Member Function Documentation

◆ type_to_id()

template<typename T>
constexpr id_type qb::Event::type_to_id ( )
inlinestaticnodiscardconstexpr

Get the type identifier at runtime.

Template Parameters
TType to get the ID for
Returns
Type identifier as string for the specified type

◆ is_alive()

bool qb::Event::is_alive ( ) const
inlinenodiscardnoexcept

Check if the event is still alive and can be processed.

Returns
true if the event is alive and ready for processing, false otherwise

◆ getID()

id_type qb::Event::getID ( ) const
inlinenodiscardnoexcept

Get the event's type ID for event routing and handling.

Returns
Type identifier of this event

◆ getQOS()

uint8_t qb::Event::getQOS ( ) const
inlinenodiscardnoexcept

Get the event's quality of service level.

Returns
QoS level (0-2) where higher values indicate higher priority

◆ getDestination()

id_handler_type qb::Event::getDestination ( ) const
inlinenodiscardnoexcept

Get the destination actor ID.

Returns
ID of the destination actor that should receive this event

◆ getSource()

id_handler_type qb::Event::getSource ( ) const
inlinenodiscardnoexcept

Get the source actor ID.

Returns
ID of the source actor that sent this event

◆ getSize()

std::size_t qb::Event::getSize ( ) const
inlinenodiscardnoexcept

Get the size of the event in bytes.

Returns
Total size of the event in memory