A tree representation, with path/url syntax, of the known OSVR system. More...
#include <osvr/Common/PathTree.h>
Public Member Functions | |
| PathTree () | |
| Constructor. | |
| PathNode & | getNodeByPath (std::string const &path) |
| Returns the node indicated by the path, which must be absolute (begin with a /). Any non-existent nodes will be created with values of NullElement. More... | |
| PathNode const & | getNodeByPath (std::string const &path) const |
| Returns the node indicated by the path, which must be absolute (begin with a /). More... | |
| PathNode & | getNodeByPath (std::string const &path, PathElement const &finalComponentDefault) |
| void | reset () |
| Reset the path tree to a new, empty root node. | |
| PathNode & | getRoot () |
| PathNode const & | getRoot () const |
| template<typename F > | |
| void | visitTree (F &functor) |
| Visitation. More... | |
| template<typename F > | |
| void | visitConstTree (F &functor) const |
| Visit the tree, with const nodes, starting at the root, with the given functor. | |
Related Functions | |
(Note that these are not member functions.) | |
| bool | addAlias (PathNode &node, std::string const &source, AliasPriority priority=ALIASPRIORITY_MANUAL) |
| Make node an alias pointing to source, with the given priority, if it needs updating. More... | |
| bool | addAliasFromRoute (PathNode &node, std::string const &route, AliasPriority priority=ALIASPRIORITY_MANUAL) |
| Parse an old-style route object (with source and destination), and use the given node as a entry point into the tree, and add an aliases based on that route. More... | |
| void | clonePathTree (PathTree const &src, PathTree &dest) |
| Clones a path tree. More... | |
A tree representation, with path/url syntax, of the known OSVR system.
Definition at line 43 of file PathTree.h.
|
inline |
Visitation.
Visit the tree, starting at the root, with the given functor.
Definition at line 51 of file PathTree.h.
| PathNode & osvr::common::PathTree::getNodeByPath | ( | std::string const & | path | ) |
Returns the node indicated by the path, which must be absolute (begin with a /). Any non-existent nodes will be created with values of NullElement.
Definition at line 47 of file PathTree.cpp.
| PathNode const & osvr::common::PathTree::getNodeByPath | ( | std::string const & | path | ) | const |
Returns the node indicated by the path, which must be absolute (begin with a /).
| exceptions::PathNotAbsolute,exceptions::EmptyPath,exceptions::EmptyPathComponent,util::tree::NoSuchChild |
Definition at line 60 of file PathTree.cpp.
| PathNode & osvr::common::PathTree::getNodeByPath | ( | std::string const & | path, |
| PathElement const & | finalComponentDefault | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Same as above but a non-existent final component node will be initialized from the provided element rather than NullElement.
Definition at line 51 of file PathTree.cpp.
|
related |
Make node an alias pointing to source, with the given priority, if it needs updating.
Definition at line 103 of file PathTree.cpp.
|
related |
Parse an old-style route object (with source and destination), and use the given node as a entry point into the tree, and add an aliases based on that route.
Can also handle normal alias descriptions without complaint.
Definition at line 120 of file PathTree.cpp.
Clones a path tree.
Definition at line 155 of file PathTree.cpp.