44 if (deviceName.size() < 3) {
46 "short to be a complete device "
50 std::string normalized = (deviceName[0] == getPathSeparatorCharacter())
54 auto plugin = device.getParent();
55 if (plugin ==
nullptr || plugin->isRoot()) {
58 "Given device name did not include both a "
59 "plugin component and a device "
67 while (plugin->getParent() !=
nullptr &&
68 !plugin->getParent()->isRoot()) {
69 plugin = plugin->getParent();
A tree representation, with path/url syntax, of the known OSVR system.
::osvr::util::TreeNode< PathElement > PathNode
The specific tree node type that contains a path element.
Thrown when attempting to add an invalid device name to the tree.
The element type corresponding to a plugin.
PathNode & addDevice(PathTree &tree, std::string const &deviceName, elements::DeviceElement dev=elements::DeviceElement())
Adds/updates nodes for the basic path to a device.
The element type corresponding to a device, which implements 0 or more interfaces.
PathNode & getNodeByPath(std::string const &path)
Returns the node indicated by the path, which must be absolute (begin with a /). Any non-existent nod...
void ifNullReplaceWith(PathElement &dest, PathElement const &src)
If dest is a NullElement, replace it with the provided src element.
const char * getPathSeparator()
Gets the path separator - a slash - as a null-terminated string.