25 #ifndef INCLUDED_ApplyPathNodeVisitor_h_GUID_5F05BD33_812E_4A98_354F_1481FC8AB5BE
26 #define INCLUDED_ApplyPathNodeVisitor_h_GUID_5F05BD33_812E_4A98_354F_1481FC8AB5BE
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);
63 template <
typename T> ResultType
operator()(T
const &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
::osvr::util::TreeNode< PathElement > PathNode
The specific tree node type that contains a path element.
void operator()(T &val)
Function call method for a non-const visitor.
PathNodeVisitorImpl & operator=(PathNodeVisitorImpl const &)=delete
Disable assignment operator, since we have reference members.
void operator()(T const &val)
Function call method for a const visitor.
ResultType operator()(T &val)
Function call method for a non-const visitor.
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...
Automatically-generated export header - do not edit!
ResultType operator()(T const &val)
Function call method for a const visitor.
Header forward-declaring the types in PathElementTypes.h and including the PathElement typedef...