Dune Core Modules (2.10.0)

Child Extraction

Typedefs

template<typename Node , std::size_t... indices>
using Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type
 Template alias for the type of a child node given by a list of child indices. More...
 
template<typename Node , typename TreePath >
using Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath< Node, TreePath >::type
 Template alias for the type of a child node given by a TreePath or a HybridTreePath type. More...
 
template<typename T >
using Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std::decay_t< T > >::type
 Type trait that determines whether T is a flat index in the context of child extraction.
 

Functions

template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, Indices... indices)
 Extracts the child of a node given by a sequence of compile-time and run-time indices. More...
 
template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, HybridTreePath< Indices... > treePath)
 Extracts the child of a node given by a HybridTreePath object. More...
 

Detailed Description

Utility functions and metafunctions for extracting children from a TypeTree.

Typedef Documentation

◆ Child

template<typename Node , std::size_t... indices>
using Dune::TypeTree::Child = typedef typename impl::_Child<Node,indices...>::type

Template alias for the type of a child node given by a list of child indices.

This template alias is implemented in terms of the free-standing child() functions and uses those in combination with decltype() to extract the child type.

Template Parameters
NodeThe type of the parent node.
indicesA list of index values the describes the path to the wanted child.

◆ ChildForTreePath

template<typename Node , typename TreePath >
using Dune::TypeTree::ChildForTreePath = typedef typename impl::_ChildForTreePath<Node,TreePath>::type

Template alias for the type of a child node given by a TreePath or a HybridTreePath type.

This template alias is implemented in terms of the free-standing child() functions and uses those in combination with decltype() to extract the child type. It supports both TreePath and HybridTreePath.

Template Parameters
NodeThe type of the parent node.
TreePathThe type of a TreePath or a HybridTreePath that describes the path to the wanted child.

Function Documentation

◆ child() [1/2]

template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child ( Node &&  node,
HybridTreePath< Indices... >  treePath 
)

Extracts the child of a node given by a HybridTreePath object.

Use this function to extract a (possibly indirect) child of a TypeTree node.

Example:

using namespace Dune::TypeTree::Indices; // for compile-time indices
auto&& c = child(node,tp);
constexpr index_constant< 0 > _0
Compile time index with value 0.
Definition: indices.hh:52
constexpr index_constant< 4 > _4
Compile time index with value 4.
Definition: indices.hh:64
constexpr auto hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:312
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

returns the second child of the first child of the third child of the fifth child of node, where some child lookups were done using a compile-time index and some using a run-time index.

Parameters
nodeThe node from which to extract the child.
tree{athA HybridTreePath that describes the path into the tree to the wanted child. This tree path object can be a combination of run time indices (for tree nodes that allow accessing their children using run time information, like PowerNode) and instances of index_constant, which work for all types of inner nodes.
Returns
A reference to the child, its cv-qualification depends on the passed-in node.

References Dune::TypeTree::child().

Referenced by Dune::TypeTree::child().

◆ child() [2/2]

template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child ( Node &&  node,
Indices...  indices 
)

Extracts the child of a node given by a sequence of compile-time and run-time indices.

Use this function to extract a (possibly indirect) child of a TypeTree node.

Example:

using namespace Dune::Indices; // for compile-time indices
auto&& c = child(node,_4,2,_0,1);
Namespace with predefined compile time indices for the range [0,19].
Definition: indices.hh:50

returns the second child of the first child of the third child of the fifth child of node, where some child lookups were done using a compile-time index and some using a run-time index.

Parameters
nodeThe node from which to extract the child.
indices...A list of indices that describes the path into the tree to the wanted child. These parameters can be a combination of run time indices (for tree nodes that allow accessing their children using run time information, like PowerNode) and instances of index_constant, which work for all types of inner nodes.
Returns
A reference to the child, its cv-qualification depends on the passed-in node.

Referenced by Dune::TypeTree::CompositeNode< Children >::child(), Dune::TypeTree::PowerNode< T, k >::child(), and Dune::Functions::SubspaceLocalView< RLV, PP >::tree().

Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 26, 23:30, 2024)