COROIO: NNet::NActors::TActorId Class Reference
COROIO
 
Loading...
Searching...
No Matches
NNet::NActors::TActorId Class Reference

Globally unique identifier for actors across a distributed system. More...

#include <actorid.hpp>

Public Member Functions

 TActorId ()=default
 Default constructor creates an invalid actor ID.
 
 operator bool () const
 Check if the actor ID is valid.
 
TNodeId NodeId () const
 Get the node ID component.
 
TLocalActorId ActorId () const
 Get the local actor ID component.
 
TCookie Cookie () const
 Get the cookie component.
 
std::string ToString () const
 Convert actor ID to a human-readable string.
 
 TActorId (TNodeId nodeId, TLocalActorId actorId, TCookie cookie)
 Construct actor ID with specific components.
 

Detailed Description

Globally unique identifier for actors across a distributed system.

Combines a 16-bit NodeId, a 32-bit local ActorId, and a 16-bit Cookie into a compact, copyable handle. The cookie increments each time a slot is reused, preventing stale messages from reaching a newly spawned actor that occupies the same local slot as a terminated one.

A default-constructed TActorId (all zeros) is invalid; operator bool() returns false for it.

Constructor & Destructor Documentation

◆ TActorId()

NNet::NActors::TActorId::TActorId ( TNodeId  nodeId,
TLocalActorId  actorId,
TCookie  cookie 
)
inline

Construct actor ID with specific components.

Parameters
nodeIdNode identifier
actorIdLocal actor identifier
cookieCookie for versioning

Member Function Documentation

◆ operator bool()

NNet::NActors::TActorId::operator bool ( ) const
inline

Check if the actor ID is valid.

Returns
true if the actor ID is valid (not all zeros)

◆ ToString()

std::string NNet::NActors::TActorId::ToString ( ) const
inline

Convert actor ID to a human-readable string.

Returns
String in format "ActorId:<NodeId>:<LocalActorId>:<Cookie>"

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