aimstil
5.0.5
|
A class to accumulate value. More...
#include <til/Accumulator.h>
Public Member Functions | |
Accumulator () | |
const TAccumulation & | get () const |
Get accumulation result. More... | |
const RecordPolicy & | recordPolicy () const |
Get record policy. More... | |
void | clear () |
clear accumulated values More... | |
void | accumulate (typename boost::call_traits< T >::param_type value) |
Accumulate a value. More... | |
template<typename TIterator > | |
boost::enable_if< boost::is_same< typename value_type_of< TIterator >::type, T > >::type | accumulate (TIterator begin, TIterator end) |
Accumulate values spanned by given range. More... | |
A class to accumulate value.
What is exactly meant by accumulate is actually left to the user, via the AccumulationPolicy. Note that the interface of this policy is actually that of a inplace functor (i.e. a functor that do an inplace operation and returns void, such as AddTo – this is necessary for objects, because things like A = A+B cannot be simplified for say vectors, and it is thus highly inefficient. So the use of AddTo as the accumulation trait should be enough to make it a sum accumulator.
Definition at line 81 of file Accumulator.h.
|
inline |
Definition at line 85 of file Accumulator.h.
|
inline |
Accumulate a value.
Definition at line 104 of file Accumulator.h.
|
inline |
Accumulate values spanned by given range.
Definition at line 111 of file Accumulator.h.
|
inline |
clear accumulated values
Definition at line 99 of file Accumulator.h.
|
inline |
Get accumulation result.
Definition at line 94 of file Accumulator.h.
Referenced by til::MeanAccumulator< T, TAccumulation >::get().
|
inline |
Get record policy.
Definition at line 96 of file Accumulator.h.