C++ Actor Framework  0.18
Public Types | Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
caf::node_id Class Reference

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

#include <node_id.hpp>

Collaboration diagram for caf::node_id:
Collaboration graph

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. More...
 
void swap (node_id &other) noexcept
 Exchanges the value of this object with other.
 

Static Public Member Functions

static bool can_parse (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 Functions

(Note that these are not member functions.)

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. More...
 
CAF_CORE_EXPORT optional< node_idmake_node_id (uint32_t process_id, string_view host_hash)
 Creates a node ID from process_id and host_hash. More...
 
CAF_CORE_EXPORT error parse (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 Function 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 optional< node_id > make_node_id ( uint32_t  process_id,
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.

◆ operator!=() [1/3]

bool operator!= ( const node_id x,
const node_id y 
)
related

◆ operator!=() [2/3]

bool operator!= ( const node_id x,
const none_t  
)
related

◆ operator!=() [3/3]

bool operator!= ( const none_t ,
const node_id x 
)
related

◆ operator<()

bool operator< ( const node_id x,
const node_id y 
)
related

◆ operator<=()

bool operator<= ( const node_id x,
const node_id y 
)
related

◆ operator==() [1/3]

bool operator== ( const node_id x,
const node_id y 
)
related

◆ operator==() [2/3]

bool operator== ( const node_id x,
const none_t  
)
related

◆ operator==() [3/3]

bool operator== ( const none_t ,
const node_id x 
)
related

◆ operator>()

bool operator> ( const node_id x,
const node_id y 
)
related

◆ operator>=()

bool operator>= ( const node_id x,
const node_id y 
)
related

◆ parse()

CAF_CORE_EXPORT error parse ( string_view  str,
node_id dest 
)
related

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