4 #ifndef DUNE_TYPETREE_VISITOR_HH
5 #define DUNE_TYPETREE_VISITOR_HH
48 #if HAVE_RVALUE_REFERENCES || DOXYGEN
58 template<
typename T,
typename TreePath>
70 template<
typename T,
typename TreePath>
81 template<
typename T,
typename TreePath>
91 template<
typename T,
typename TreePath>
105 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
120 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
123 #else // HAVE_RVALUE_REFERENCES
130 template<
typename T,
typename TreePath>
134 template<
typename T,
typename TreePath>
135 void in(
const T& t, TreePath treePath)
const {}
138 template<
typename T,
typename TreePath>
139 void post(
const T& t, TreePath treePath)
const {}
142 template<
typename T,
typename TreePath>
143 void leaf(
const T& t, TreePath treePath)
const {}
146 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
147 void beforeChild(
const T& t,
const Child& child, TreePath treePath, ChildIndex childIndex)
const {}
150 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
151 void afterChild(
const T& t,
const Child& child, TreePath treePath, ChildIndex childIndex)
const {}
153 #endif // HAVE_RVALUE_REFERENCES || DOXYGEN
197 #if HAVE_RVALUE_REFERENCES || DOXYGEN
208 template<
typename T1,
typename T2,
typename TreePath>
221 template<
typename T1,
typename T2,
typename TreePath>
233 template<
typename T1,
typename T2,
typename TreePath>
248 template<
typename T1,
typename T2,
typename TreePath>
264 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
265 void beforeChild(T1&& t1, Child1&& child1, T2&& t2, Child2&& child2,
TreePath treePath, ChildIndex childIndex)
const {}
280 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
281 void afterChild(T1&& t1, Child1&& child1, T2&& t2, Child2&& child2,
TreePath treePath, ChildIndex childIndex)
const {}
283 #else // HAVE_RVALUE_REFERENCES
290 template<
typename T1,
typename T2,
typename TreePath>
291 void pre(T1& t1, T2& t2,
TreePath treePath)
const {}
294 template<
typename T1,
typename T2,
typename TreePath>
295 void in(T1& t1, T2& t2, TreePath treePath)
const {}
298 template<
typename T1,
typename T2,
typename TreePath>
299 void post(T1& t1, T2& t2, TreePath treePath)
const {}
302 template<
typename T1,
typename T2,
typename TreePath>
303 void leaf(T1& t1, T2& t2, TreePath treePath)
const {}
305 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
307 T2& t2, Child2& child2,
309 ChildIndex childIndex)
const {}
311 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
313 T2& t2, Child2& child2,
315 ChildIndex childIndex)
const {}
318 template<
typename T1,
typename T2,
typename TreePath>
319 void pre(
const T1& t1,
const T2& t2, TreePath treePath)
const {}
322 template<
typename T1,
typename T2,
typename TreePath>
323 void in(
const T1& t1,
const T2& t2, TreePath treePath)
const {}
326 template<
typename T1,
typename T2,
typename TreePath>
327 void post(
const T1& t1,
const T2& t2, TreePath treePath)
const {}
330 template<
typename T1,
typename T2,
typename TreePath>
331 void leaf(
const T1& t1,
const T2& t2, TreePath treePath)
const {}
333 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
334 void beforeChild(
const T1& t1,
const Child1& child1,
335 const T2& t2,
const Child2& child2,
337 ChildIndex childIndex)
const {}
339 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
340 void afterChild(
const T1& t1,
const Child1& child1,
341 const T2& t2,
const Child2& child2,
343 ChildIndex childIndex)
const {}
345 #endif // HAVE_RVALUE_REFERENCES || DOXYGEN
362 template<
typename Node1,
365 typename Child2 = void,
388 template<
typename Node1,
391 typename Child2 = void,
458 #endif // DUNE_TYPETREE_VISITOR_HH
Convenience base class for visiting the direct children of a node pair.
Definition: visitor.hh:448
Definition: treepath.hh:26
Convenience base class for visiting the entire tree.
Definition: visitor.hh:430
Definition: treepath.hh:32
void afterChild(T &&t, Child &&child, TreePath treePath, ChildIndex childIndex) const
Method for child-parent traversal.
Definition: visitor.hh:121
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:367
static const bool value
Do not visit any child.
Definition: visitor.hh:370
void post(T1 &&t1, T2 &&t2, TreePath treePath) const
Method for postfix traversal.
Definition: visitor.hh:234
Convenience base class for visiting the direct children of a node.
Definition: visitor.hh:436
Visitor interface and base class for TypeTree visitors.
Definition: visitor.hh:45
void in(T &&t, TreePath treePath) const
Method for infix tree traversal.
Definition: visitor.hh:71
void in(T1 &&t1, T2 &&t2, TreePath treePath) const
Method for infix tree traversal.
Definition: visitor.hh:222
Mixin base class for visitors that want to visit the complete tree.
Definition: visitor.hh:381
Definition: treepath.hh:26
void leaf(T1 &&t1, T2 &&t2, TreePath treePath) const
Method for leaf traversal.
Definition: visitor.hh:249
void pre(T1 &&t1, T2 &&t2, TreePath treePath) const
Method for prefix tree traversal.
Definition: visitor.hh:209
void afterChild(T1 &&t1, Child1 &&child1, T2 &&t2, Child2 &&child2, TreePath treePath, ChildIndex childIndex) const
Method for child-parent traversal.
Definition: visitor.hh:281
void beforeChild(T1 &&t1, Child1 &&child1, T2 &&t2, Child2 &&child2, TreePath treePath, ChildIndex childIndex) const
Method for parent-child traversal.
Definition: visitor.hh:265
Convenience base class for visiting an entire tree pair.
Definition: visitor.hh:442
Mixin base class for visitors that only want to visit the direct children of a node.
Definition: visitor.hh:355
void pre(T &&t, TreePath treePath) const
Method for prefix tree traversal.
Definition: visitor.hh:59
static const bool value
Visit any child.
Definition: visitor.hh:396
Visitor interface and base class for visitors of pairs of TypeTrees.
Definition: visitor.hh:194
Mixin base class for visitors that only need a dynamic TreePath during traversal. ...
Definition: visitor.hh:423
void leaf(T &&t, TreePath treePath) const
Method for leaf traversal.
Definition: visitor.hh:92
void post(T &&t, TreePath treePath) const
Method for postfix tree traversal.
Definition: visitor.hh:82
void beforeChild(T &&t, Child &&child, TreePath treePath, ChildIndex childIndex) const
Method for parent-child traversal.
Definition: visitor.hh:106
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:393
Type
Definition: treepath.hh:26
static const TreePathType::Type treePathType
Use the dynamic tree traversal algorithm.
Definition: visitor.hh:426
static const TreePathType::Type treePathType
Use the static tree traversal algorithm.
Definition: visitor.hh:412
Mixin base class for visitors that require a static TreePath during traversal.
Definition: visitor.hh:409