Loading...
Searching...
No Matches
Dune::TypeTree::Experimental::Info::LeafCounterVisitor Struct Reference

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

Inheritance diagram for Dune::TypeTree::Experimental::Info::LeafCounterVisitor:

## Public Member Functions

template<class Tree, class Child, class TreePath, class ChildIndex, class U>
auto | beforeChild (Tree &&, Child &&, TreePath, ChildIndex, U u) const
template<class Tree, class Child, class TreePath, class U>
std::size_t | beforeChild (Tree &&, Child &&, TreePath, std::size_t, U u) const
template<class Tree, class TreePath, class U>
auto | leaf (Tree &&, TreePath, U u) const
template<typename T, typename TreePath, typename U>
auto | pre (T &&, TreePath, const U &u) const
| Method for prefix tree traversal.
template<typename T, typename TreePath, typename U>
auto | in (T &&, TreePath, const U &u) const
| Method for infix tree traversal.
template<typename T, typename TreePath, typename U>
auto | post (T &&, TreePath, const U &u) const
| Method for postfix tree traversal.
template<typename T, typename TreePath, typename U>
auto | leaf (T &&, TreePath, const U &u) const
| Method for leaf traversal.
template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
auto | beforeChild (T &&, Child &&, TreePath, ChildIndex, const U &u) const
| Method for parent-child traversal.
template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
auto | afterChild (T &&, Child &&, TreePath, ChildIndex, const U &u) const
| Method for child-parent traversal.

## Static Public Attributes

static const TreePathType::Type | treePathType = TreePathType::fullyStatic
| Use the static tree traversal algorithm.

## Member Function Documentation

## afterChild()

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

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::afterChild | ( | T && | ,
|  | Child && | ,
|  | TreePath | ,
|  | ChildIndex | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## beforeChild() [1/3]

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

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::beforeChild | ( | T && | ,
|  | Child && | ,
|  | TreePath | ,
|  | ChildIndex | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## beforeChild() [2/3]

template<class Tree, class Child, class TreePath, class ChildIndex, class U>

auto Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild | ( | Tree && | ,
|  | Child && | ,
|  | TreePath | ,
|  | ChildIndex | ,
|  | U | u ) const

inline

## beforeChild() [3/3]

template<class Tree, class Child, class TreePath, class U>

std::size_t Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild | ( | Tree && | ,
|  | Child && | ,
|  | TreePath | ,
|  | std::size_t | ,
|  | U | u ) const

inline

## in()

template<typename T, typename TreePath, typename U>

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::in | ( | T && | ,
|  | TreePath | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## leaf() [1/2]

template<typename T, typename TreePath, typename U>

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::leaf | ( | T && | ,
|  | TreePath | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## leaf() [2/2]

template<class Tree, class TreePath, class U>

auto Dune::TypeTree::Experimental::Info::LeafCounterVisitor::leaf | ( | Tree && | ,
|  | TreePath | ,
|  | U | u ) const

inline

## post()

template<typename T, typename TreePath, typename U>

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::post | ( | T && | ,
|  | TreePath | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## pre()

template<typename T, typename TreePath, typename U>

auto Dune::TypeTree::Experimental::DefaultHybridVisitor::pre | ( | T && | ,
|  | TreePath | ,
|  | const U & | u ) 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.
  u | The carry value from previous visit.

Returns
  The result of applying this visitor to u.

## Member Data Documentation

## treePathType

const TreePathType::Type Dune::TypeTree::StaticTraversal::treePathType = TreePathType::fullyStatic

static inherited

Use the static tree traversal algorithm.

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

- visitor.hh