Loading...
Searching...
No Matches
Dune::TypeTree::TreeVisitor Struct Reference
dune-typetree » Traversal

Convenience base class for visiting the entire tree. More...

`#include <dune/typetree/visitor.hh>`

Inheritance diagram for Dune::TypeTree::TreeVisitor:

## Public Member Functions

template<typename T, typename TreePath>
void | pre (T &&, TreePath) const
| Method for prefix tree traversal.
template<typename T, typename TreePath>
void | in (T &&, TreePath) const
| Method for infix tree traversal.
template<typename T, typename TreePath>
void | post (T &&, TreePath) const
| Method for postfix tree traversal.
template<typename T, typename TreePath>
void | leaf (T &&, TreePath) const
| Method for leaf traversal.
template<typename T, typename Child, typename TreePath, typename ChildIndex>
void | beforeChild (T &&, Child &&, TreePath, ChildIndex) const
| Method for parent-child traversal.
template<typename T, typename Child, typename TreePath, typename ChildIndex>
void | afterChild (T &&, Child &&, TreePath, ChildIndex) const
| Method for child-parent traversal.

## Detailed Description

Convenience base class for visiting the entire tree.

## Member Function Documentation

## afterChild()

template<typename T, typename Child, typename TreePath, typename ChildIndex>

void Dune::TypeTree::DefaultVisitor::afterChild | ( | T && | ,
|  | Child && | ,
|  | TreePath | ,
|  | ChildIndex | ) const

inline inherited

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

  t | The parent node.
  child | The child node that was visited last (if the visitor did not reject it).
  treePath | The position of the parent node within the TypeTree.
  childIndex | The 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 && | ,
|  | Child && | ,
|  | TreePath | ,
|  | ChildIndex | ) const

inline inherited

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

  t | The parent node.
  child | The child node that will (potentially) be visited next.
  treePath | The position of the parent node within the TypeTree.
  childIndex | The index of the child node in relation to the parent node.

## in()

template<typename T, typename TreePath>

void Dune::TypeTree::DefaultVisitor::in | ( | T && | ,
|  | TreePath | ) const

inline inherited

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

  t | The node to visit.
  treePath | The position of the node within the TypeTree.

## leaf()

template<typename T, typename TreePath>

void Dune::TypeTree::DefaultVisitor::leaf | ( | T && | ,
|  | TreePath | ) const

inline inherited

Method for leaf traversal.

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

Parameters

  t | The node to visit.
  treePath | The position of the node within the TypeTree.

## post()

template<typename T, typename TreePath>

void Dune::TypeTree::DefaultVisitor::post | ( | T && | ,
|  | TreePath | ) const

inline inherited

Method for postfix tree traversal.

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

Parameters

  t | The node to visit.
  treePath | The position of the node within the TypeTree.

## pre()

template<typename T, typename TreePath>

void Dune::TypeTree::DefaultVisitor::pre | ( | T && | ,
|  | TreePath | ) const

inline inherited

Method for prefix tree traversal.

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

Parameters

  t | The node to visit.
  treePath | The position of the node within the TypeTree.

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

- visitor.hh