Loading...
Searching...
No Matches
Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction > Struct Template Reference
dune-typetree » Traversal

Statically accumulate a value over the nodes of a TypeTree. More...

`#include <dune/typetree/accumulate_static.hh>`

## Public Types

typedef Functor::result_type | result_type
| The result type of the computation.

## Static Public Attributes

static const result_type | result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result
| The accumulated result of the computation.

## Detailed Description

template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
struct Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction >

Statically accumulate a value over the nodes of a TypeTree.

This struct implements an algorithm for iterating over a tree and calculating an accumulated value at compile time.

Template Parameters

  Tree | The tree to iterate over.
  Functor | The compile-time functor used for visiting each node.

This functor must implement the following interface:

struct AccumulationFunctor
{
// The result type of the overall computation.
typedef ... result_type;
// Decide whether to include the given node in the calculation
// or to skip it.
template<typename Node, typename TreePath>
struct doVisit
{
static const bool value = true;
};
// Calculate the per-node result.
template<typename Node, typename TreePath>
struct visit
{
static const result_type result = ...;
};
};
Dune::TypeTree::AccumulateValue::result_type
Functor::result_type result_type
The result type of the computation.
Definition accumulate_static.hh:266

Template Parameters

  Reduction | The reduction operator used to accumulate the per-node results.

The reduction operator must implement the following interface:

template<typename result_type>
struct ReductionOperator
{
// combine two per-node results
template<result_type r1, result_type r2>
struct reduce
{
static const result_type result = ...;
};
};
Dune::TypeTree::AccumulateValue::result
static const result_type result
The accumulated result of the computation.
Definition accumulate_static.hh:269

Template Parameters

  startValue | The starting value fed into the initial accumulation step.

## Member Typedef Documentation

## result_type

template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>

typedef Functor::result_type Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction >::result_type

The result type of the computation.

## Member Data Documentation

## result

template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>

const result_type Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction >::result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result

static

The accumulated result of the computation.

The documentation for this struct was generated from the following file:

- accumulate_static.hh