Robot Raconteur Core C++ Library
|
Go to the source code of this file.
Classes | |
class | RobotRaconteur::NodeDirectories |
Directories on local system used by the node. More... | |
class | RobotRaconteur::NodeDirectoriesUtil |
Utility functions for working with NodeDirectories. More... | |
class | RobotRaconteur::GetUuidForNameAndLockResult |
Structure to hold result of GetUuidForNameAndLock. More... | |
class | RobotRaconteur::NodeDirectoriesResourceAlreadyInUse |
Exception thrown by GetUuidForNameAndLockResult if the name with the specified scope is currently in use. More... | |
Functions | |
GetUuidForNameAndLockResult | RobotRaconteur::GetUuidForNameAndLock (const NodeDirectories &node_dirs, boost::string_ref name, const std::vector< std::string > &scope) |
Get a saved UUID for a name with a specified scope. More... | |
GetUuidForNameAndLockResult RobotRaconteur::GetUuidForNameAndLock | ( | const NodeDirectories & | node_dirs, |
boost::string_ref | name, | ||
const std::vector< std::string > & | scope | ||
) |
Get a saved UUID for a name with a specified scope.
Robot Raconteur uses "identifiers", which are a combination of a name and a UUID. For nodes, this is a NodeName and NodeID pair. For convenience, the UUIDs can be automatically generated on individual machines, and saved to the system. They can also be pre-specified by creating files in specific locations. The "scope" is a path that separates different types of identifiers. For nodes, the scope is "nodeids". For devices, it is something like ["identifiers","devices"].
The base directory is typically "user_config_dir", except for root users on Unix systems. In those cases, the search will initially look in "user_config_dir" (/etc/robotraconteur), but then fall back to "user_state_dir" (/var/lib/robotraconteur) to save the generated UUID.
The files contain the UUID in text form, and no other characters.
Throws NodeDirectoriesResourceAlreadyInUse if the name is already in use by another node.
node_dirs | Node directory structure returned by RobotRaconteurNode::GetNodeDirectories() |
name | The name to get a UUID |
scope | The scope of the type of identifier |