Tomographer  v4.0
Tomographer C++ Framework Documentation
Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators > Class Template Reference

A ValueCalculator-instance which the choice of which ValueCalculator to use at run-time. More...

#include <tomographer/valuecalculator.h>

+ Inheritance diagram for Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators >:
+ Collaboration diagram for Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators >:

Public Types

typedef ValueType_ ValueType
 
typedef std::tuple< ValueCalculators... > ValueCalculatorsTupleType
 

Public Member Functions

template<typename... Args>
 MultiplexorValueCalculator (const int i, Args &&... valcalcs)
 Constructor. More...
 
template<int I>
const std::tuple_element< I, ValueCalculatorsTupleType >::type & getValueCalculator () const
 Get a particular value calculator [static index].
 
template<int I, typename PointType >
ValueType getValueI (PointType &&x) const
 Calculate the value at the given point, using the I-th value calculator.
 
template<typename PointType >
ValueType getValue (PointType &&x) const
 The main method which computes the value according to the pre-chosen ValueCalculator. More...
 

Static Public Attributes

static constexpr int NumValueCalculators = sizeof...(ValueCalculators)
 
static constexpr int NumStaticallyOptimizedIfs = 6
 

Detailed Description

template<typename ValueType_, typename... ValueCalculators>
class Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators >

A ValueCalculator-instance which the choice of which ValueCalculator to use at run-time.

Definition at line 185 of file valuecalculator.h.

Constructor & Destructor Documentation

§ MultiplexorValueCalculator()

template<typename ValueType_ , typename... ValueCalculators>
template<typename... Args>
Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators >::MultiplexorValueCalculator ( const int  i,
Args &&...  valcalcs 
)
inline

Constructor.

The first parameter, i, selects which value calculator is applied. (The whole idea is that this value can be selected at run-time.)

Specify as argument a list of value calculator instances, in the same order as the template parameters.

Definition at line 213 of file valuecalculator.h.

Member Function Documentation

§ getValue()

template<typename ValueType_ , typename... ValueCalculators>
template<typename PointType >
ValueType Tomographer::MultiplexorValueCalculator< ValueType_, ValueCalculators >::getValue ( PointType &&  x) const
inline

The main method which computes the value according to the pre-chosen ValueCalculator.

Calculates the value according to the ValueCalculator instance which was chosen at constructor-time (via the index i).

Definition at line 238 of file valuecalculator.h.


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