Parasol Planning Library (PPL)
Average< T > Class Template Referencefinal

#include <Average.h>

Public Member Functions

Modifiers
Averageoperator+= (const T &_value) noexcept
 
AverageAddSummedValues (const T &_sum, const size_t _count) noexcept
 
Queries
Get () const noexcept
 Get the average. More...
 
const T & Sum () const noexcept
 Get the total sum. More...
 
size_t Count () const noexcept
 Get the number of elements included. More...
 

Detailed Description

template<typename T>
class Average< T >

Keep a running total and count of any type which supports addition and division.

Member Function Documentation

◆ AddSummedValues()

template<typename T >
Average< T > & Average< T >::AddSummedValues ( const T &  _sum,
const size_t  _count 
)
inlinenoexcept

Add one or more elements (pre-summed) to the average.

Parameters
_sumThe summed elements to add.
_countThe number of elements.
Returns
A reference to self.

◆ Count()

template<typename T >
size_t Average< T >::Count
inlinenoexcept

Get the number of elements included.

◆ Get()

template<typename T >
T Average< T >::Get
inlinenoexcept

Get the average.

◆ operator+=()

template<typename T >
Average< T > & Average< T >::operator+= ( const T &  _value)
inlinenoexcept

Add an element to the average.

Parameters
_valueThe element to add.
Returns
A reference to self.

◆ Sum()

template<typename T >
const T & Average< T >::Sum
inlinenoexcept

Get the total sum.


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