Loading...
Searching...
No Matches
Dune::TypeTree Namespace Reference

## Namespaces

namespace | Concept
namespace | Literals

## Typedefs

template<typename Node, std::size_t... indices>
using | Child = typename Impl::ChildTraits<Node, indices...>::type
| Template alias for the type of a child node given by a list of child indices.
template<typename Node, typename TreePath>
using | ChildForTreePath = std::decay_t<decltype(child(std::declval<Node>(), std::declval<TreePath>()))>
| Template alias for the type of a child node given by a TreePath type.
template<class Value, class Tree>
using | 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 | 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.
template<typename... T>
using | TreePath = Dune::HybridMultiIndex<T...>
| A type for representing tree paths that supports both compile time and run time indices.

## Functions

template<typename Node, typename... Indices>
decltype(auto) | child (Node &&node, TreePath< Indices... > treePath)
| Extracts the child of a node given by a TreePath object.
template<typename Node, typename... Indices>
decltype(auto) | child (Node &&node, Indices... indices)
| Extracts the child of a node given by a sequence of compile-time and run-time indices.
template<Concept::InnerTreeNode Tree, class Callable>
constexpr void | forEachChild (Tree &&container, Callable &&at_value)
| Traverse each child of a tree and apply a callable function.
template<class Tree, class PreNodeFunc, class LeafNodeFunc, class PostNodeFunc>
void | forEachNode (Tree &&tree, PreNodeFunc &&preNodeFunc, LeafNodeFunc &&leafNodeFunc, PostNodeFunc &&postNodeFunc)
| Traverse tree and visit each node.
template<Concept::TreeNode Tree, class NodeFunc>
void | forEachNode (Tree &&tree, NodeFunc &&nodeFunc)
| Traverse tree and visit each node.
template<Concept::TreeNode Tree, class LeafFunc>
void | forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc)
| Traverse tree and visit each leaf node.
template<class Tree, class LeafToValue>
auto | makeTreeContainer (const Tree &tree, LeafToValue &&leafToValue)
| Create container having the same structure as the given tree.
template<class Value, class Tree>
auto | makeTreeContainer (const Tree &tree)
| Create container having the same structure as the given tree.
template<typename... T> requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto | treePath (const T &... t)
| Constructs a new TreePath from the given indices.
template<char... digits>
constexpr auto | operator""_tp ()
| Literal to create treepath.
template<typename... T>
constexpr auto | back (const HybridMultiIndex< T... > &tp) -> decltype(tp.back())
| Returns a copy of the last element of the HybridMultiIndex.
template<typename... T>
constexpr auto | front (const HybridMultiIndex< T... > &tp) -> decltype(tp.front())
| Returns a copy of the first element of the HybridMultiIndex.
template<typename... T>
constexpr HybridMultiIndex< T..., std::size_t > | push_back (const HybridMultiIndex< T... > &tp, std::size_t i)
| Appends a run time index to a HybridMultiIndex.
template<typename... T>
constexpr HybridMultiIndex< std::size_t, T... > | push_front (const HybridMultiIndex< T... > &tp, std::size_t i)
| Prepends a run time index to a HybridMultiIndex.
template<typename I, typename... T> requires (sizeof...(T) > 0)
constexpr auto | accumulate_back (const HybridMultiIndex< T... > &tp, I i)
| Hybrid utility that accumulates to the back of a multi-index.
template<typename I, typename... T> requires (sizeof...(T) > 0)
constexpr auto | accumulate_front (const HybridMultiIndex< T... > &tp, I i)
| Hybrid utility that accumulates to the front of a multi-index.
template<class... Head, class... Other>
constexpr auto | join (const HybridMultiIndex< Head... > &head, const Other &... tail)
| Join two hybrid multi-indices into one.
template<class... T>
constexpr auto | reverse (const HybridMultiIndex< T... > &tp)
| Reverses the order of the elements in the multi-index.
template<class... T> requires (sizeof...(T) > 0)
constexpr auto | pop_front (const HybridMultiIndex< T... > &tp)
| Removes first index on a HybridMultiIndex.
template<class... T> requires (sizeof...(T) > 0)
constexpr auto | pop_back (const HybridMultiIndex< T... > &tp)
| Removes last index on a HybridMultiIndex.

## Function Documentation

## accumulate_back()

template<typename I, typename... T>
requires (sizeof...(T) > 0)

auto Dune::accumulate_back | ( | const HybridMultiIndex< T... > & | tp,
|  | I | i )

nodiscard constexpr

Hybrid utility that accumulates to the back of a multi-index.

The back of the multi-index will be accumulated and promoted in order to hold the new index:

accumulate_back(HybridMultiIndex(_0,_2),_2) -> HybridMultiIndex(_0,_4)
accumulate_back(HybridMultiIndex(_0,_2), 2) -> HybridMultiIndex(_0, 4)
accumulate_back(HybridMultiIndex(_0, 2),_2) -> HybridMultiIndex(_0, 4)
accumulate_back(HybridMultiIndex(_0, 2), 2) -> HybridMultiIndex(_0, 4)
Dune::HybridMultiIndex
HybridMultiIndex(I... i) -> HybridMultiIndex< decltype(Impl::castToHybridSizeT(i))... >
Dune::TypeTree::accumulate_back
constexpr auto accumulate_back(const HybridMultiIndex< T... > &tp, I i)
Hybrid utility that accumulates to the back of a multi-index.
Definition hybridmultiindex.hh:328
Dune::HybridMultiIndex
A hybrid multi-index class that supports both compile time and run time indices.
Definition hybridmultiindex.hh:81

## accumulate_front()

template<typename I, typename... T>
requires (sizeof...(T) > 0)

auto Dune::accumulate_front | ( | const HybridMultiIndex< T... > & | tp,
|  | I | i )

nodiscard constexpr

Hybrid utility that accumulates to the front of a multi-index.

The front of the multi-index will be accumulated and promoted in order to hold the new index:

accumulate_front(HybridMultiIndex(_0,_2),_2) -> HybridMultiIndex(_2,_2)
accumulate_front(HybridMultiIndex(_0,_2), 2) -> HybridMultiIndex( 2,_2)
accumulate_front(HybridMultiIndex( 0,_2),_2) -> HybridMultiIndex( 2,_2)
accumulate_front(HybridMultiIndex( 0,_2), 2) -> HybridMultiIndex( 2,_2)
Dune::TypeTree::accumulate_front
constexpr auto accumulate_front(const HybridMultiIndex< T... > &tp, I i)
Hybrid utility that accumulates to the front of a multi-index.
Definition hybridmultiindex.hh:348

## back()

template<typename... T>

auto Dune::back | ( | const HybridMultiIndex< T... > & | tp | ) | ->decltype(tp.back())

nodiscard constexpr

Returns a copy of the last element of the HybridMultiIndex.

As HybridMultiIndex instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

## front()

template<typename... T>

auto Dune::front | ( | const HybridMultiIndex< T... > & | tp | ) | ->decltype(tp.front())

nodiscard constexpr

Returns a copy of the first element of the HybridMultiIndex.

As HybridMultiIndex instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

## join()

template<class... Head, class... Other>

auto Dune::join | ( | const HybridMultiIndex< Head... > & | head,
|  | const Other &... | tail )

nodiscard constexpr

Join two hybrid multi-indices into one.

## pop_back()

template<class... T>
requires (sizeof...(T) > 0)

auto Dune::pop_back | ( | const HybridMultiIndex< T... > & | tp | ) |

nodiscard constexpr

Removes last index on a HybridMultiIndex.

This function returns a new HybridMultiIndex without the last index.

## pop_front()

template<class... T>
requires (sizeof...(T) > 0)

auto Dune::pop_front | ( | const HybridMultiIndex< T... > & | tp | ) |

nodiscard constexpr

Removes first index on a HybridMultiIndex.

This function returns a new HybridMultiIndex without the first index.

## push_back()

template<typename... T>

HybridMultiIndex< T..., std::size_t > Dune::push_back | ( | const HybridMultiIndex< T... > & | tp,
|  | std::size_t | i )

nodiscard constexpr

Appends a run time index to a HybridMultiIndex.

This function returns a new HybridMultiIndex with the run time index i appended.

## push_front()

template<typename... T>

HybridMultiIndex< std::size_t, T... > Dune::push_front | ( | const HybridMultiIndex< T... > & | tp,
|  | std::size_t | i )

nodiscard constexpr

Prepends a run time index to a HybridMultiIndex.

This function returns a new HybridMultiIndex with the run time index i prepended.

## reverse()

template<class... T>

auto Dune::reverse | ( | const HybridMultiIndex< T... > & | tp | ) |

nodiscard constexpr

Reverses the order of the elements in the multi-index.