Dune Core Modules (unstable)
Functions | |
| template<Concept::InnerTreeNode Tree, class Callable > | |
| constexpr void | Dune::TypeTree::forEachChild (Tree &&container, Callable &&at_value) |
| Traverse each child of a tree and apply a callable function. More... | |
| template<class Tree , class PreNodeFunc , class LeafNodeFunc , class PostNodeFunc > | |
| void | Dune::TypeTree::forEachNode (Tree &&tree, PreNodeFunc &&preNodeFunc, LeafNodeFunc &&leafNodeFunc, PostNodeFunc &&postNodeFunc) |
| Traverse tree and visit each node. More... | |
| template<Concept::TreeNode Tree, class NodeFunc > | |
| void | Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc) |
| Traverse tree and visit each node. More... | |
| template<Concept::TreeNode Tree, class LeafFunc > | |
| void | Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc) |
| Traverse tree and visit each leaf node. More... | |
Detailed Description
Function Documentation
◆ forEachChild()
|
constexpr |
Traverse each child of a tree and apply a callable function.
This function iterates over each child node of a given tree and applies a callable function to each child. The callable function can accept either one or two arguments: the child node itself, and optionally, its index.
- Template Parameters
-
Tree The type of the tree container to be traversed. This must satisfy the Concept::InnerTreeNode concept. Callable The type of the callable function (functor) to be applied to each child node. This can be a lambda, function pointer, or any callable object.
- Parameters
-
container The tree container whose children will be traversed. at_value The callable function to be applied to each child node. This function can accept either one argument (the child node) or two arguments (the child node and its index).
References Dune::TypeTree::child(), and Dune::unpackIntegerSequence().
◆ forEachLeafNode()
| void Dune::TypeTree::forEachLeafNode | ( | Tree && | tree, |
| LeafFunc && | leafFunc | ||
| ) |
Traverse tree and visit each leaf node.
The passed callback function is called with the node and corresponding treepath as arguments.
- Parameters
-
tree The tree to traverse leafFunc This function is called for each leaf node
References Dune::TypeTree::forEachNode().
◆ forEachNode() [1/2]
| void Dune::TypeTree::forEachNode | ( | Tree && | tree, |
| NodeFunc && | nodeFunc | ||
| ) |
Traverse tree and visit each node.
The passed callback function is called with the node and corresponding treepath as arguments.
- Parameters
-
tree The tree to traverse nodeFunc This function is called for each node
References Dune::TypeTree::forEachNode().
Referenced by Dune::TypeTree::forEachLeafNode(), and Dune::TypeTree::forEachNode().
◆ forEachNode() [2/2]
| void Dune::TypeTree::forEachNode | ( | Tree && | tree, |
| PreNodeFunc && | preNodeFunc, | ||
| LeafNodeFunc && | leafNodeFunc, | ||
| PostNodeFunc && | postNodeFunc | ||
| ) |
Traverse tree and visit each node.
This does an in-order traversal of the tree. For leaf node the leafNodeFunc callback is called. For each inner node this function first calls the preNodeFunc, then it traverses the children, and then it calls the postNodeFunc. All callback functions are called with the node and corresponding treepath as arguments.
- Parameters
-
tree The tree to traverse preNodeFunc This function is called for each inner node leafNodeFunc This function is called for each leaf node postNodeFunc This function is called for each inner node
References Dune::TypeTree::forEachNode(), and Dune::TypeTree::treePath().
|
Legal Statements / Impressum |
Hosted by TU Dresden & Uni Heidelberg |
generated with Hugo v0.111.3
(Jan 8, 23:33, 2026)