|
Robot Raconteur Core C++ Library
|
NodeID UUID storage and generation. More...
#include <NodeID.h>
Public Member Functions | |
| NodeID () | |
| Construct a new NodeID with "any" node UUID. | |
| NodeID (boost::array< uint8_t, 16 > id) | |
| Construct a new NodeID with the specified UUID bytes. | |
| NodeID (boost::uuids::uuid id) | |
| Construct a new NodeID with the specified boost::uuids::uuid. | |
| NodeID (const NodeID &id) | |
| Copy construct a new NodeID. | |
| NodeID (boost::string_ref id) | |
| Construct a new NodeID parsing a string UUID. | |
| const boost::array< uint8_t, 16 > | ToByteArray () const |
| Convert the NodeID UUID to bytes. | |
| virtual std::string | ToString () const |
| Convert the NodeID UUID to string with "B" format. | |
| virtual std::string | ToString (boost::string_ref format) const |
| Convert the NodeID UUID to specified format. | |
| bool | operator== (const NodeID &id2) const |
| Test if NodeID is equal. | |
| bool | operator!= (const NodeID &id2) const |
| Test if NodeID is not equal. | |
| NodeID & | operator= (const NodeID &id) |
| Assignment operator. | |
| bool | IsAnyNode () const |
| Is the NodeID UUID all zeros. | |
| RR_OVIRTUAL std::string | RRType () RR_OVERRIDE |
| Gets the type of the object as a string. This string is in C++ format, using two colons to separate namespaces instead of dots. | |
Static Public Member Functions | |
| static NodeID | NewUniqueID () |
| Generate a new random NodeID UUID. | |
| static NodeID | GetAny () |
| Get the "any" NodeId. | |
NodeID UUID storage and generation.
Robot Raconteur uses NodeID and NodeName to uniquely identify a node. NodeID is a UUID (Universally Unique ID), while NodeName is a string. The NodeID is expected to be unique, while the NodeName is set by the user and may not be unique. The NodeID class represents the UUID NodeID.
A UUID is a 128-bit randomly generated number that is statistically guaranteed to be unique to a very high probability. NodeID uses the Boost.UUID library to generate, manage, and store the UUID.
The UUID can be loaded from a string, bytes, or generated randomly at runtime. It can be converted to a string.
The LocalTransport and ServerNodeSetup classes will automatically assign a NodeID to a node when the local transport is started with a specified node name. The generated NodeID is stored on the local system, and is associated with the node name. It will be loaded when a node is started with the same NodeName.
NodeID with all zeros is considered "any" node.
| RobotRaconteur::NodeID::NodeID | ( | boost::array< uint8_t, 16 > | id | ) |
Construct a new NodeID with the specified UUID bytes.
| id | The UUID bytes |
| RobotRaconteur::NodeID::NodeID | ( | boost::uuids::uuid | id | ) |
Construct a new NodeID with the specified boost::uuids::uuid.
| id | The UUID |
| RobotRaconteur::NodeID::NodeID | ( | boost::string_ref | id | ) |
Construct a new NodeID parsing a string UUID.
| id | The UUID as a string |
|
static |
| bool RobotRaconteur::NodeID::IsAnyNode | ( | ) | const |
|
static |
|
inlinevirtual |
Gets the type of the object as a string. This string is in C++ format, using two colons to separate namespaces instead of dots.
Implements RobotRaconteur::RRObject.
| const boost::array< uint8_t, 16 > RobotRaconteur::NodeID::ToByteArray | ( | ) | const |
Convert the NodeID UUID to bytes.
|
virtual |
Convert the NodeID UUID to string with "B" format.
Convert the UUID string to 8-4-4-4-12 "B" format (with brackets)
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
|
virtual |
Convert the NodeID UUID to specified format.
Format may either be "B" for the 8-4-4-4-12 UUID with brackets, "D" for the 8-4-4-4-12 UUID without brackets, or "N" for 32 UUID format with no dashes or brackets
"B" format:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
"D" format:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
"N" format:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| format | "B", "D", or "N" for the format |