C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::node_id Class Reference

A node ID is an opaque value for representing CAF instances in the network. More...

#include <node_id.hpp>

Public Types

using default_data = hashed_node_id
 

Public Member Functions

 node_id (hashed_node_id data)
 
 node_id (uri data)
 
node_idoperator= (const none_t &)
 
 operator bool () const noexcept
 Queries whether this node is not default-constructed.
 
bool operator! () const noexcept
 Queries whether this node is default-constructed.
 
int compare (const node_id &other) const noexcept
 Compares this instance to other.
 
void swap (node_id &other) noexcept
 Exchanges the value of this object with other.
 

Static Public Member Functions

static bool can_parse (std::string_view str) noexcept
 Returns whether parse would produce a valid node ID.
 

Friends

template<class Inspector >
bool inspect (Inspector &f, node_id &x)
 

Related Symbols

(Note that these are not member symbols.)

bool wraps_uri (const node_id &x) noexcept
 Returns whether x contains an URI.
 
bool operator== (const node_id &x, const node_id &y) noexcept
 
bool operator!= (const node_id &x, const node_id &y) noexcept
 
bool operator< (const node_id &x, const node_id &y) noexcept
 
bool operator<= (const node_id &x, const node_id &y) noexcept
 
bool operator> (const node_id &x, const node_id &y) noexcept
 
bool operator>= (const node_id &x, const node_id &y) noexcept
 
bool operator== (const node_id &x, const none_t &) noexcept
 
bool operator== (const none_t &, const node_id &x) noexcept
 
bool operator!= (const node_id &x, const none_t &) noexcept
 
bool operator!= (const none_t &, const node_id &x) noexcept
 
CAF_CORE_EXPORT void append_to_string (std::string &str, const node_id &x)
 Appends x in human-readable string representation to str.
 
CAF_CORE_EXPORT std::string to_string (const node_id &x)
 Converts x into a human-readable string representation.
 
CAF_CORE_EXPORT node_id make_node_id (uri from)
 Creates a node ID from the URI from.
 
CAF_CORE_EXPORT node_id make_node_id (uint32_t process_id, const node_id::default_data::host_id_type &host_id)
 Creates a node ID from process_id and host_id.
 
CAF_CORE_EXPORT std::optional< node_idmake_node_id (uint32_t process_id, std::string_view host_hash)
 Creates a node ID from process_id and host_hash.
 
CAF_CORE_EXPORT error parse (std::string_view str, node_id &dest)
 

Detailed Description

A node ID is an opaque value for representing CAF instances in the network.

Member Function Documentation

◆ compare()

int caf::node_id::compare ( const node_id & other) const
noexcept

Compares this instance to other.

Returns
-1 if *this < other, 0 if *this == other, and 1 otherwise.

Friends And Related Symbol Documentation

◆ make_node_id() [1/2]

CAF_CORE_EXPORT node_id make_node_id ( uint32_t process_id,
const node_id::default_data::host_id_type & host_id )
related

Creates a node ID from process_id and host_id.

Parameters
process_idSystem-wide unique process identifier.
host_idUnique hash value representing a single CAF node.

◆ make_node_id() [2/2]

CAF_CORE_EXPORT std::optional< node_id > make_node_id ( uint32_t process_id,
std::string_view host_hash )
related

Creates a node ID from process_id and host_hash.

Parameters
process_idSystem-wide unique process identifier.
host_hashUnique node ID as hexadecimal string representation.

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