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

Unique identifier for actors. More...

#include <ActorId.h>

Inheritance diagram for qb::ActorId:

Public Member Functions

 ActorId () noexcept
 operator uint32_t () const noexcept
 Conversion operator to uint32_t.
ServiceId sid () const noexcept
 Get the service identifier component of this ActorId.
CoreId index () const noexcept
 Get the core identifier component of this ActorId.
bool is_broadcast () const noexcept
 Check if this ActorId represents a broadcast identifier.
bool is_valid () const noexcept
 Check if this ActorId is valid (not NotFound)

Static Public Attributes

static constexpr uint32_t NotFound = 0
static constexpr ServiceId BroadcastSid = (std::numeric_limits<ServiceId>::max)()

Protected Member Functions

 ActorId (ServiceId id, CoreId index) noexcept

Detailed Description

Unique identifier for actors.

ActorId combines a service/actor identifier with a core identifier to form a unique identifier for an actor within the actor system. It provides methods for creating, comparing, and validating actor IDs.

Constructor & Destructor Documentation

◆ ActorId()

qb::ActorId::ActorId ( )
noexcept

ActorId() == ActorId::NotFound

Member Function Documentation

◆ operator uint32_t()

qb::ActorId::operator uint32_t ( ) const
nodiscardnoexcept

Conversion operator to uint32_t.

Returns
The ActorId as a 32-bit unsigned integer

◆ sid()

ServiceId qb::ActorId::sid ( ) const
nodiscardnoexcept

Get the service identifier component of this ActorId.

Returns
Service identifier

◆ index()

CoreId qb::ActorId::index ( ) const
nodiscardnoexcept

Get the core identifier component of this ActorId.

Returns
VirtualCore identifier

◆ is_broadcast()

bool qb::ActorId::is_broadcast ( ) const
nodiscardnoexcept

Check if this ActorId represents a broadcast identifier.

Returns
true if ActorId is a Core broadcast id, false otherwise

◆ is_valid()

bool qb::ActorId::is_valid ( ) const
nodiscardnoexcept

Check if this ActorId is valid (not NotFound)

Returns
true if ActorId is valid, false otherwise