Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FMovingWindowAverageFast< T, ArraySize > Class Template Reference

#include <MovingWindowAverageFast.h>

Public Member Functions

 FMovingWindowAverageFast ()
 
void PushValue (T Value)
 
T GetAverage () const
 

Private Attributes

TStaticArray< T, ArraySizeValuesArray
 
T TotalValues
 
T AverageValue
 
int32 RemoveNextIdx
 
int32 NumValuesUsed
 

Detailed Description

template<typename T, int32 ArraySize>
class FMovingWindowAverageFast< T, ArraySize >

This class calculates a moving window average. Its designed to be used with floats or doubles and keeps track of the average with every value pushed so is ideal when there is a one to one or one to many relationship between calls to PushValue() and GetMovingWindowAverage() respectively.

Definition at line 12 of file MovingWindowAverageFast.h.

Constructor & Destructor Documentation

◆ FMovingWindowAverageFast()

Definition at line 15 of file MovingWindowAverageFast.h.

Member Function Documentation

◆ GetAverage()

template<typename T , int32 ArraySize>
T FMovingWindowAverageFast< T, ArraySize >::GetAverage ( ) const
inline

Definition at line 47 of file MovingWindowAverageFast.h.

◆ PushValue()

template<typename T , int32 ArraySize>
void FMovingWindowAverageFast< T, ArraySize >::PushValue ( T Value)
inline

Definition at line 24 of file MovingWindowAverageFast.h.

Member Data Documentation

◆ AverageValue

template<typename T , int32 ArraySize>
T FMovingWindowAverageFast< T, ArraySize >::AverageValue
private

Definition at line 56 of file MovingWindowAverageFast.h.

◆ NumValuesUsed

template<typename T , int32 ArraySize>
int32 FMovingWindowAverageFast< T, ArraySize >::NumValuesUsed
private

Definition at line 60 of file MovingWindowAverageFast.h.

◆ RemoveNextIdx

template<typename T , int32 ArraySize>
int32 FMovingWindowAverageFast< T, ArraySize >::RemoveNextIdx
private

The array Index of the next item to remove when the moving window is full

Definition at line 59 of file MovingWindowAverageFast.h.

◆ TotalValues

template<typename T , int32 ArraySize>
T FMovingWindowAverageFast< T, ArraySize >::TotalValues
private

Definition at line 55 of file MovingWindowAverageFast.h.

◆ ValuesArray

template<typename T , int32 ArraySize>
TStaticArray<T, ArraySize> FMovingWindowAverageFast< T, ArraySize >::ValuesArray
private

Definition at line 53 of file MovingWindowAverageFast.h.


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