dune-typetree  2.6-rc1
Public Member Functions | Static Public Attributes | List of all members
Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc > Struct Template Reference

#include <dune/typetree/traversal.hh>

Inheritance diagram for Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc >:
Inheritance graph

Public Member Functions

 CallbackVisitor (PreFunc &preFunc, LeafFunc &leafFunc, PostFunc &postFunc)
 
template<typename Node , typename TreePath >
void pre (Node &&node, TreePath treePath)
 
template<typename Node , typename TreePath >
void leaf (Node &&node, TreePath treePath)
 
template<typename Node , typename TreePath >
void post (Node &&node, TreePath treePath)
 
template<typename T , typename TreePath >
void pre (T &&t, TreePath treePath) const
 Method for prefix tree traversal. More...
 
template<typename T , typename TreePath >
void in (T &&t, TreePath treePath) const
 Method for infix tree traversal. More...
 
template<typename T , typename TreePath >
void post (T &&t, TreePath treePath) const
 Method for postfix tree traversal. More...
 
template<typename T , typename TreePath >
void leaf (T &&t, TreePath treePath) const
 Method for leaf traversal. More...
 
template<typename T , typename Child , typename TreePath , typename ChildIndex >
void beforeChild (T &&t, Child &&child, TreePath treePath, ChildIndex childIndex) const
 Method for parent-child traversal. More...
 
template<typename T , typename Child , typename TreePath , typename ChildIndex >
void afterChild (T &&t, Child &&child, TreePath treePath, ChildIndex childIndex) const
 Method for child-parent traversal. More...
 

Static Public Attributes

static const TreePathType::Type treePathType = TreePathType::dynamic
 Use the dynamic tree traversal algorithm. More...
 

Constructor & Destructor Documentation

◆ CallbackVisitor()

template<class PreFunc, class LeafFunc, class PostFunc>
Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc >::CallbackVisitor ( PreFunc &  preFunc,
LeafFunc &  leafFunc,
PostFunc &  postFunc 
)
inline

Member Function Documentation

◆ afterChild()

template<typename T , typename Child , typename TreePath , typename ChildIndex >
void Dune::TypeTree::DefaultVisitor::afterChild ( T &&  t,
Child &&  child,
TreePath  treePath,
ChildIndex  childIndex 
) const
inlineinherited

Method for child-parent traversal.

This method gets called after visiting a child node.

Note
This method gets called even if the child node was not visited because the visitor chose not to do so.
Parameters
tThe parent node.
childThe child node that was visited last (if the visitor did not reject it).
treePathThe position of the parent node within the TypeTree.
childIndexThe index of the child node in relation to the parent node.

◆ beforeChild()

template<typename T , typename Child , typename TreePath , typename ChildIndex >
void Dune::TypeTree::DefaultVisitor::beforeChild ( T &&  t,
Child &&  child,
TreePath  treePath,
ChildIndex  childIndex 
) const
inlineinherited

Method for parent-child traversal.

This method gets called before visiting a child node.

Note
This method gets called even if the visitor decides not to visit the child in question.
Parameters
tThe parent node.
childThe child node that will (potentially) be visited next.
treePathThe position of the parent node within the TypeTree.
childIndexThe index of the child node in relation to the parent node.

◆ in()

template<typename T , typename TreePath >
void Dune::TypeTree::DefaultVisitor::in ( T &&  t,
TreePath  treePath 
) const
inlineinherited

Method for infix tree traversal.

This method gets called BETWEEN visits of children of a non-leaf node. That definition implies that this method will only be called for nodes with at least two children.

Parameters
tThe node to visit.
treePathThe position of the node within the TypeTree.

◆ leaf() [1/2]

template<typename T , typename TreePath >
void Dune::TypeTree::DefaultVisitor::leaf ( T &&  t,
TreePath  treePath 
) const
inlineinherited

Method for leaf traversal.

This method gets called when encountering a leaf node within the TypeTree.

Parameters
tThe node to visit.
treePathThe position of the node within the TypeTree.

◆ leaf() [2/2]

template<class PreFunc, class LeafFunc, class PostFunc>
template<typename Node , typename TreePath >
void Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc >::leaf ( Node &&  node,
TreePath  treePath 
)
inline

◆ post() [1/2]

template<typename T , typename TreePath >
void Dune::TypeTree::DefaultVisitor::post ( T &&  t,
TreePath  treePath 
) const
inlineinherited

Method for postfix tree traversal.

This method gets called after all children of a non-leaf node have been visited.

Parameters
tThe node to visit.
treePathThe position of the node within the TypeTree.

◆ post() [2/2]

template<class PreFunc, class LeafFunc, class PostFunc>
template<typename Node , typename TreePath >
void Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc >::post ( Node &&  node,
TreePath  treePath 
)
inline

◆ pre() [1/2]

template<typename T , typename TreePath >
void Dune::TypeTree::DefaultVisitor::pre ( T &&  t,
TreePath  treePath 
) const
inlineinherited

Method for prefix tree traversal.

This method gets called when first encountering a non-leaf node and before visiting any of its children.

Parameters
tThe node to visit.
treePathThe position of the node within the TypeTree.

◆ pre() [2/2]

template<class PreFunc, class LeafFunc, class PostFunc>
template<typename Node , typename TreePath >
void Dune::TypeTree::Detail::CallbackVisitor< PreFunc, LeafFunc, PostFunc >::pre ( Node &&  node,
TreePath  treePath 
)
inline

Member Data Documentation

◆ treePathType

const TreePathType::Type Dune::TypeTree::DynamicTraversal::treePathType = TreePathType::dynamic
staticinherited

Use the dynamic tree traversal algorithm.


The documentation for this struct was generated from the following file: