OSVR-Core
|
A tree representation, with path/url syntax, of the known OSVR system. More...
#include <PathTree.h>
Public Member Functions | |
OSVR_COMMON_EXPORT | PathTree () |
Constructor. | |
OSVR_COMMON_EXPORT PathNode & | getNodeByPath (std::string const &path) |
Returns the node indicated by the path, which must be absolute (begin with a /). More... | |
OSVR_COMMON_EXPORT PathNode const & | getNodeByPath (std::string const &path) const |
Returns the node indicated by the path, which must be absolute (begin with a /). More... | |
OSVR_COMMON_EXPORT PathNode & | 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. More... | |
OSVR_COMMON_EXPORT 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. More... | |
Related Functions | |
(Note that these are not member functions.) | |
OSVR_COMMON_EXPORT 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... | |
OSVR_COMMON_EXPORT 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... | |
OSVR_COMMON_EXPORT void | clonePathTree (PathTree const &src, PathTree &dest) |
Clones a path tree. More... | |
A tree representation, with path/url syntax, of the known OSVR system.
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
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 /).
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.
|
inline |
Visit the tree, with const nodes, starting at the root, with the given functor.
|
inline |
Visitation.
Visit the tree, starting at the root, with the given functor.
|
related |
Make node an alias pointing to source, with the given priority, if it needs updating.
|
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.
Clones a path tree.