25 #ifndef INCLUDED_ApplyPathNodeVisitor_h_GUID_5F05BD33_812E_4A98_354F_1481FC8AB5BE 26 #define INCLUDED_ApplyPathNodeVisitor_h_GUID_5F05BD33_812E_4A98_354F_1481FC8AB5BE 29 #include <osvr/Common/Export.h> 35 #include <boost/variant/static_visitor.hpp> 36 #include <boost/variant/apply_visitor.hpp> 37 #include <boost/noncopyable.hpp> 45 template <
typename Visitor,
typename NodeType,
46 typename ResultType =
typename Visitor::result_type>
50 : m_node(node), m_v(v) {}
59 return m_v(m_node, val);
64 return m_v(m_node, val);
73 template <
typename Visitor,
typename NodeType>
75 :
public boost::static_visitor<void>, boost::noncopyable {
78 : m_node(node), m_v(v) {}
86 template <
typename T>
void operator()(
T &val) { m_v(m_node, val); }
103 template <
typename Visitor>
107 return boost::apply_visitor(visitor, node.value());
112 template <
typename Visitor>
113 inline typename Visitor::result_type
116 return boost::apply_visitor(visitor, node.value());
123 #endif // INCLUDED_ApplyPathNodeVisitor_h_GUID_5F05BD33_812E_4A98_354F_1481FC8AB5BE Definition: ApplyPathNodeVisitor.h:47
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
::osvr::util::TreeNode< PathElement > PathNode
The specific tree node type that contains a path element.
Definition: PathNode_fwd.h:42
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
void operator()(T &val)
Function call method for a non-const visitor.
Definition: ApplyPathNodeVisitor.h:86
PathNodeVisitorImpl & operator=(PathNodeVisitorImpl const &)=delete
Disable assignment operator, since we have reference members.
Definition: newuoa.h:1888
void operator()(T const &val)
Function call method for a const visitor.
Definition: ApplyPathNodeVisitor.h:89
ResultType operator()(T &val)
Function call method for a non-const visitor.
Definition: ApplyPathNodeVisitor.h:58
Visitor::result_type applyPathNodeVisitor(Visitor &v, PathNode &node)
Visit a node's element's contained type, similar to boost::apply_visitor, but passing both the PathNo...
Definition: ApplyPathNodeVisitor.h:104
ResultType operator()(T const &val)
Function call method for a const visitor.
Definition: ApplyPathNodeVisitor.h:63
Header forward-declaring the types in PathElementTypes.h and including the PathElement typedef...