25 #ifndef INCLUDED_PathTree_h_GUID_8C6C691A_AAB1_4586_64DD_BD3F870C9071 26 #define INCLUDED_PathTree_h_GUID_8C6C691A_AAB1_4586_64DD_BD3F870C9071 29 #include <osvr/Common/Export.h> 34 #include <boost/noncopyable.hpp> 51 template <
typename F>
void visitTree(F &functor) { functor(*m_root); }
56 functor(const_cast<PathNode const &>(*m_root));
83 OSVR_COMMON_EXPORT
void reset();
85 PathNode &getRoot() {
return *m_root; }
87 PathNode const &getRoot()
const {
return *m_root; }
100 OSVR_COMMON_EXPORT
bool 102 AliasPriority priority = ALIASPRIORITY_MANUAL);
113 OSVR_COMMON_EXPORT
bool 115 AliasPriority priority = ALIASPRIORITY_MANUAL);
118 PathNode &node, std::string
const &source, std::string
const &dest,
119 AliasPriority priority = ALIASPRIORITY_MANUAL);
122 std::string
const &dest);
124 bool isPathAbsolute(std::string
const &source);
134 #endif // INCLUDED_PathTree_h_GUID_8C6C691A_AAB1_4586_64DD_BD3F870C9071 bool addArticulation(PathNode &node, std::string const &source, std::string const &dest)
Definition: PathTree.cpp:165
void visitConstTree(F &functor) const
Visit the tree, with const nodes, starting at the root, with the given functor.
Definition: PathTree.h:55
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
A node in a generic tree, which can contain an object by value.
Definition: TreeNode.h:72
A tree representation, with path/url syntax, of the known OSVR system.
Definition: PathTree.h:43
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
OSVR_COMMON_EXPORT PathTree()
Constructor.
Definition: PathTree.cpp:47
OSVR_COMMON_EXPORT PathNode & getNodeByPath(std::string const &path)
Returns the node indicated by the path, which must be absolute (begin with a /).
Definition: PathTree.cpp:48
OSVR_COMMON_EXPORT void clonePathTree(PathTree const &src, PathTree &dest)
Clones a path tree.
Definition: PathTree.cpp:188
OSVR_COMMON_EXPORT void reset()
Reset the path tree to a new, empty root node.
Definition: PathTree.cpp:66
boost::variant< NullElement, AliasElement, ArticulationElement, SensorElement, InterfaceElement, DeviceElement, PluginElement, StringElement > PathElement
The variant type containing a particular kind of path element.
Definition: PathElementTypes_fwd.h:54
::osvr::util::TreeNodePointer< PathElement >::type PathNodePtr
The ownership pointer of the specific tree node.
Definition: PathNode_fwd.h:45
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.
void visitTree(F &functor)
Visitation.
Definition: PathTree.h:51
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 poin...
bool addAliasFromSourceAndRelativeDest(PathNode &node, std::string const &source, std::string const &dest, AliasPriority priority=ALIASPRIORITY_MANUAL)
Definition: PathTree.cpp:149