|
Tomographer
v5.3
Tomographer C++ Framework Documentation
|
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... CreatorFns> | |
| MultiplexorValueCalculator (const int i, CreatorFns &&... creators) | |
| Constructor. More... | |
| ~MultiplexorValueCalculator () | |
| Destructor. Frees resources. | |
| MultiplexorValueCalculator (const MultiplexorValueCalculator &other) | |
| Copy constructor. More... | |
| template<int I> | |
| const std::tuple_element< I, ValueCalculatorsTupleType >::type * | getValueCalculator () const |
| Get a particular value calculator [static index]. | |
| 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 |
A ValueCalculator-instance which the choice of which ValueCalculator to use at run-time.
Definition at line 222 of file valuecalculator.h.
|
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 callables, which are responsible for creating each value calculator. Each callable should take no arguments and create a ValueCalculator of the corresponding type using the new operator. Only the callable corresponding to the chosen i will be called. The created ValueCalculator will be automatically deleted.
Definition at line 307 of file valuecalculator.h.
|
inline |
Copy constructor.
Create the corresponding valcalc using its copy constructor
Definition at line 326 of file valuecalculator.h.
|
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 347 of file valuecalculator.h.