senf::StatisticAccumulator< T > Class Template Reference

Accumulate measurement values. More...

#include <senf/Utils/StatisticAccumulator.hh>

Public Member Functions

 StatisticAccumulator ()
 
 StatisticAccumulator (T const &value)
 
 StatisticAccumulator (T const &sum, T const &sumSquared, T const &min, T const &max, unsigned count)
 
 StatisticAccumulator (senf::StatisticsData const &data)
 
void clear ()
 Reset accumulated values. More...
 
void accumulate (T const &value)
 Gather value to be accumulated. More...
 
min () const
 Returns current minimal value. More...
 
max () const
 Returns current maximal value. More...
 
sum () const
 Returns current sum value. More...
 
sum2 () const
 Returns current squared sum value. More...
 
float avg () const
 Returns arithmetic average value. More...
 
float rms () const
 Returns root mean square value. More...
 
float stddev () const
 Returns standard deviation value. More...
 
unsigned count () const
 Returns count of accumulated values. More...
 
void data (StatisticsData &data_) const
 Returns the accumulated data as a tuple. More...
 
StatisticsData data () const
 Returns the accumulated data as a tuple. More...
 
 operator bool () const
 Returns true if valid data is present. More...
 
StatisticAccumulator< T > operator+= (StatisticAccumulator< T > const &other)
 
StatisticAccumulator< T > operator*= (const float &scale)
 

Detailed Description

template<class T>
class senf::StatisticAccumulator< T >

Accumulate measurement values.

The accumulator mainly do the preliminary work for the senf::Statistic class. It accumulates certain values within an interval to be used by senf::Statistics

This class provides the average, standard deviation, min, max values over one interval, means until clear() is called. It rather directly calculates the results then collection all single values provided by calling accumulate().

See also
senf::Statistics to process accumulated values

Definition at line 68 of file StatisticAccumulator.hh.

Constructor & Destructor Documentation

◆ StatisticAccumulator() [1/4]

template<class T>
senf::StatisticAccumulator< T >::StatisticAccumulator ( )

◆ StatisticAccumulator() [2/4]

template<class T>
senf::StatisticAccumulator< T >::StatisticAccumulator ( T const &  value)

◆ StatisticAccumulator() [3/4]

template<class T>
senf::StatisticAccumulator< T >::StatisticAccumulator ( T const &  sum,
T const &  sumSquared,
T const &  min,
T const &  max,
unsigned  count 
)

◆ StatisticAccumulator() [4/4]

template<class T>
senf::StatisticAccumulator< T >::StatisticAccumulator ( senf::StatisticsData const &  data)

Member Function Documentation

◆ accumulate()

template<class T>
void senf::StatisticAccumulator< T >::accumulate ( T const &  value)

Gather value to be accumulated.

This method accumulates a value.

Parameters
[in]valueto be accumulated value

◆ avg()

template<class T>
float senf::StatisticAccumulator< T >::avg ( ) const

Returns arithmetic average value.

This method returns the arithmetic average value of the current accumulation.

◆ clear()

template<class T>
void senf::StatisticAccumulator< T >::clear ( )

Reset accumulated values.

This member reset all values.

◆ count()

template<class T>
unsigned senf::StatisticAccumulator< T >::count ( ) const

Returns count of accumulated values.

This method returns count of accumulated values of the current accumulation.

◆ data() [1/2]

template<class T>
void senf::StatisticAccumulator< T >::data ( StatisticsData data_) const

Returns the accumulated data as a tuple.

This method returns the accumulated information as a tuple.

◆ data() [2/2]

template<class T>
StatisticsData senf::StatisticAccumulator< T >::data ( ) const

Returns the accumulated data as a tuple.

This method returns the accumulated information as a tuple.

◆ max()

template<class T>
T senf::StatisticAccumulator< T >::max ( ) const

Returns current maximal value.

This method returns the maximal value of the current accumulation.

◆ min()

template<class T>
T senf::StatisticAccumulator< T >::min ( ) const

Returns current minimal value.

This method returns the minimal value of the current accumulation.

◆ operator bool()

template<class T>
senf::StatisticAccumulator< T >::operator bool ( ) const
explicit

Returns true if valid data is present.

This method indicates if valid data is present

◆ operator*=()

template<class T>
StatisticAccumulator<T> senf::StatisticAccumulator< T >::operator*= ( const float &  scale)

◆ operator+=()

template<class T>
StatisticAccumulator<T> senf::StatisticAccumulator< T >::operator+= ( StatisticAccumulator< T > const &  other)

◆ rms()

template<class T>
float senf::StatisticAccumulator< T >::rms ( ) const

Returns root mean square value.

This method returns the root mean square value of the current accumulation.

◆ stddev()

template<class T>
float senf::StatisticAccumulator< T >::stddev ( ) const

Returns standard deviation value.

This method returns the standard deviation value of the current accumulation.

◆ sum()

template<class T>
T senf::StatisticAccumulator< T >::sum ( ) const

Returns current sum value.

This method returns the sum value of the current accumulation.

◆ sum2()

template<class T>
T senf::StatisticAccumulator< T >::sum2 ( ) const

Returns current squared sum value.

This method returns the squared sum value of the current accumulation.


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