libcaf  0.13.2
Classes | Public Types | Public Member Functions | Static Public Attributes | Related Functions | List of all members
caf::node_id Class Reference

A node ID consists of a host ID and process ID. More...

#include <node_id.hpp>

Inherits comparable< node_id >, and comparable< node_id, invalid_node_id_t >.

Classes

class  data
 A reference counted container for host ID and process ID. More...
 

Public Types

using host_id_type = std::array< uint8_t, host_id_size >
 Represents a 160 bit hash.
 

Public Member Functions

 node_id (const invalid_node_id_t &)
 
node_idoperator= (const node_id &)=default
 
node_idoperator= (const invalid_node_id_t &)
 
 node_id (const node_id &)
 
 node_id (uint32_t process_id, const std::string &hash)
 Creates this from process_id and hash. More...
 
 node_id (uint32_t process_id, const host_id_type &node_id)
 Creates this from process_id and hash. More...
 
uint32_t process_id () const
 Identifies the running process. More...
 
const host_id_typehost_id () const
 Identifies the host system. More...
 

Static Public Attributes

static constexpr size_t host_id_size = 20
 A 160 bit hash (20 bytes).
 

Related Functions

(Note that these are not member functions.)

constexpr invalid_node_id_t invalid_node_id = invalid_node_id_t{}
 Identifies an invalid node_id.
 
std::string to_string (const node_id &what)
 

Detailed Description

A node ID consists of a host ID and process ID.

The host ID identifies the physical machine in the network, whereas the process ID identifies the running system-level process on that machine.

Constructor & Destructor Documentation

caf::node_id::node_id ( uint32_t  process_id,
const std::string &  hash 
)

Creates this from process_id and hash.

Parameters
process_idSystem-wide unique process identifier.
hashUnique node id as hexadecimal string representation.
caf::node_id::node_id ( uint32_t  process_id,
const host_id_type node_id 
)

Creates this from process_id and hash.

Parameters
process_idSystem-wide unique process identifier.
node_idUnique node id.

Member Function Documentation

const host_id_type& caf::node_id::host_id ( ) const

Identifies the host system.

Returns
A hash build from the MAC address of the first network device and the UUID of the root partition (mounted in "/" or "C:").
uint32_t caf::node_id::process_id ( ) const

Identifies the running process.

Returns
A system-wide unique process identifier.

Friends And Related Function Documentation

std::string to_string ( const node_id what)
related

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