semf
semf::Average< T > Class Template Reference

Average calculates the average value of the entries of a given Buffer or an data array. The types uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t and int64_t are supported. More...

#include <average.h>

Collaboration diagram for semf::Average< T >:
Collaboration graph

Static Public Member Functions

static T value (const T data[], size_t dataSize)
 Calculates an average out of an array. More...
 
static T value (const Buffer< T > &data)
 Calculates an average over the content of a buffer. More...
 

Detailed Description

template<typename T>
class semf::Average< T >

Average calculates the average value of the entries of a given Buffer or an data array. The types uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t and int64_t are supported.

Template Parameters
Datatype.

Definition at line 24 of file average.h.

Member Function Documentation

◆ value() [1/2]

template<typename T >
T semf::Average< T >::value ( const Buffer< T > &  data)
static

Calculates an average over the content of a buffer.

Parameters
dataBuffer to calculate the average over.
Returns
Average.

Definition at line 22 of file average.cpp.

Here is the call graph for this function:

◆ value() [2/2]

template<typename T >
T semf::Average< T >::value ( const T  data[],
size_t  dataSize 
)
static

Calculates an average out of an array.

Parameters
dataPointer to the data array.
dataSizeSize of data array.
Returns
Average.

Definition at line 15 of file average.cpp.