|
dune-typetree 2.10
|
Loading...
Searching...
No Matches
traversal.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
38 // SFINAE template check that Tree has a degree() function and a child() function accepting integer indices
64 std::enable_if_t<(Tree::isComposite or (Tree::isPower and (pathType!=TreePathType::dynamic))), int> = 0>
67 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, Dune::index_constant<indices>{}))...);
74 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, indices))...);
81 return Detail::leafTreePathTuple<Tree, pathType>(prefix, std::make_index_sequence<Tree::degree()>{});
121 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
164 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
void forEachNode(Tree &&tree, NodeFunc &&nodeFunc)
Traverse tree and visit each node.
Definition traversal.hh:254
constexpr auto leafTreePathTuple()
Create tuple of tree paths to leafs.
Definition traversal.hh:218
void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc)
Traverse tree and visit each leaf node.
Definition traversal.hh:269
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition traversal.hh:239
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition childextraction.hh:225
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition childextraction.hh:128
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition treepath.hh:416
constexpr auto hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition treepath.hh:312
constexpr auto treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition treepath.hh:326
void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
Definition traversal.hh:164
decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) DynamicTraversalConcept
Definition traversal.hh:43
decltype((std::integral_constant< std::size_t, Tree::degree()>{})) StaticTraversalConcept
Definition traversal.hh:49
void applyToTree(T &&tree, TreePath treePath, V &&visitor)
Definition traversal.hh:97
constexpr auto leafTreePathTuple(Prefix prefix)
Definition traversal.hh:54
static StaticIntegralRange< T, to > range(std::integral_constant< T, to >) noexcept
constexpr void forEach(Range &&range, F &&f)
typename detected_or< nonesuch, Op, Args... >::value_t is_detected
virtual void operator()()=0
T make_tuple(T... args)
T reduce(T... args)
T tuple_cat(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8