OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::common::PathTree Class Reference

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

#include <osvr/Common/PathTree.h>

Inheritance diagram for osvr::common::PathTree:

Public Member Functions

 PathTree ()
 Constructor.
 
PathNodegetNodeByPath (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...
 
PathNodegetNodeByPath (std::string const &path, PathElement const &finalComponentDefault)
 
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.
 

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...
 

Detailed Description

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

Definition at line 43 of file PathTree.h.

Member Function Documentation

template<typename F >
void osvr::common::PathTree::visitTree ( F &  functor)
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.

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

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
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.

Friends And Related Function Documentation

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

Definition at line 103 of file PathTree.cpp.

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

Definition at line 120 of file PathTree.cpp.

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

Clones a path tree.

Definition at line 155 of file PathTree.cpp.


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