DUNE PDELab (2.8)

dune-typetree

Modules

 Traversal
 
 Child Extraction
 
 Nodes
 
 TreePath
 
 Transformation
 

Namespaces

namespace  Dune::TypeTree::apply_to_tuple_policy
 Policies for the function apply_to_tuple().
 

Classes

struct  Dune::TypeTree::TreeInfo< Tree, Tag >
 Struct for obtaining some basic structural information about a TypeTree. More...
 

Typedefs

template<class Value , class Tree >
using Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >()))>
 Alias to container type generated by makeTreeContainer for given tree type and uniform value type.
 
template<template< class Node > class LeafToValue, class Tree >
using Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))>
 Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue to create values.
 

Functions

template<class Tree , class LeafToValue >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue &&leafToValue)
 Create container havin the same structure as the given tree. More...
 
template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree)
 Create container havin the same structure as the given tree. More...
 
template<typename... Args>
void Dune::TypeTree::discard (Args &&... args)
 No-op function to make calling a function on a variadic template argument pack legal C++.
 
template<typename T , typename F , typename Policy >
void Dune::TypeTree::apply_to_tuple (T &&t, F &&f, Policy=apply_to_tuple_policy::default_policy())
 Apply a functor to each element of a std::tuple.
 

Detailed Description

Function Documentation

◆ makeTreeContainer() [1/2]

template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer ( const Tree &  tree)

Create container havin the same structure as the given tree.

This class allows to create a nested hybrid container having the same structure as a given type tree. Power nodes are represented as std::array's while composite nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes are of the given type Value. For convenience the created container is not returned directly. Instead, the returned object stores the container and provides operator[] access using a HybridTreePath.

Template Parameters
ValueType of the values to be stored for the leafs. Should be default constructible.
Parameters
leafToValueA predicate used to generate the stored values for the leaves
Returns
A container matching the tree structure

References Dune::TypeTree::makeTreeContainer().

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

◆ makeTreeContainer() [2/2]

template<class Tree , class LeafToValue >
auto Dune::TypeTree::makeTreeContainer ( const Tree &  tree,
LeafToValue &&  leafToValue 
)

Create container havin the same structure as the given tree.

This class allows to create a nested hybrid container having the same structure as a given type tree. Power nodes are represented as std::array's while composite nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes are creating using a given predicate. For convenience the created container is not returned directly. Instead, the returned object stores the container and provides operator[] access using a HybridTreePath.

Parameters
treeThe tree which should be mapper to a container
leafToValueA predicate used to generate the stored values for the leaves
Returns
A container matching the tree structure
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)