OSVR-Core
Public Member Functions | Related Functions | List of all members
osvr::common::PathTree Class Reference

A tree representation, with path/url syntax, of the known OSVR system. More...

#include <PathTree.h>

Inheritance diagram for osvr::common::PathTree:

Public Member Functions

OSVR_COMMON_EXPORT PathTree ()
 Constructor.
 
OSVR_COMMON_EXPORT PathNodegetNodeByPath (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 PathNodegetNodeByPath (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.
 
PathNodegetRoot ()
 
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...
 

Detailed Description

A tree representation, with path/url syntax, of the known OSVR system.

Member Function Documentation

§ getNodeByPath() [1/3]

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

Exceptions
exceptions::PathNotAbsolute,exceptions::EmptyPath,exceptions::EmptyPathComponent

§ getNodeByPath() [2/3]

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
exceptions::PathNotAbsolute,exceptions::EmptyPath,exceptions::EmptyPathComponent,util::tree::NoSuchChild

§ getNodeByPath() [3/3]

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.

§ visitConstTree()

template<typename F >
void osvr::common::PathTree::visitConstTree ( F &  functor) const
inline

Visit the tree, with const nodes, starting at the root, with the given functor.

§ visitTree()

template<typename F >
void osvr::common::PathTree::visitTree ( F &  functor)
inline

Visitation.

Visit the tree, starting at the root, with the given functor.

Friends And Related Function Documentation

§ addAlias()

OSVR_COMMON_EXPORT bool addAlias ( PathNode node,
std::string const &  source,
AliasPriority  priority = ALIASPRIORITY_MANUAL 
)
related

Make node an alias pointing to source, with the given priority, if it needs updating.

Returns
true if the node was changed

§ addAliasFromRoute()

OSVR_COMMON_EXPORT bool addAliasFromRoute ( PathNode node,
std::string const &  route,
AliasPriority  priority = ALIASPRIORITY_MANUAL 
)
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.

Returns
true if the node was changed

§ clonePathTree()

OSVR_COMMON_EXPORT void clonePathTree ( PathTree const &  src,
PathTree dest 
)
related

Clones a path tree.


The documentation for this class was generated from the following files: