Loading...
Searching...
No Matches
TypeTree
Collaboration diagram for TypeTree:

## Topics

| Child Extraction
| Traversal
| TreePath

## 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<Impl::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 having the same structure as the given tree.
template<class Value, class Tree>
auto | Dune::TypeTree::makeTreeContainer (const Tree &tree)
| Create container having the same structure as the given tree.

## Detailed Description

## Typedef Documentation

## TreeContainer

template<template< class Node > class LeafToValue, class Tree>

using Dune::TypeTree::TreeContainer = std::decay_t<decltype(makeTreeContainer(std::declval<const Tree&>(), std::declval<Impl::LeafToDefaultConstructibleValue<LeafToValue>>()))>

Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue to create values.

## UniformTreeContainer

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.

## Function Documentation

## makeTreeContainer() [1/2]

template<class Value, class Tree>

auto Dune::TypeTree::makeTreeContainer | ( | const Tree & | tree | ) |

Create container having 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 TreePath.

Template Parameters

  Value | Type of the values to be stored for the leafs. Should be default constructible.

Parameters

  tree | The tree which should be mapper to a container

Returns
  A container matching the tree structure

## makeTreeContainer() [2/2]

template<class Tree, class LeafToValue>

auto Dune::TypeTree::makeTreeContainer | ( | const Tree & | tree,
|  | LeafToValue && | leafToValue )

Create container having 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 TreePath.

Parameters

  tree | The tree which should be mapper to a container
  leafToValue | A predicate used to generate the stored values for the leaves

Returns
  A container matching the tree structure