The interface for rolling averages used in the Mezzanine, and threading library. More...
#include <rollingaverage.h>
Public Types | |
typedef RecordType | Type |
Used for accessing the derived type when it may not be directly known. | |
Public Member Functions | |
virtual | ~RollingAverage () |
Empty virtual Destructor. | |
virtual RecordType | GetAverage () const =0 |
What is the current rolling average. More... | |
virtual void | Insert (RecordType Datum)=0 |
Add another record. More... | |
virtual RecordType & | operator[] (Whole Index)=0 |
Get a 0 indexed record of the past few insertions. More... | |
virtual RecordType | operator[] (Whole Index) const =0 |
Get a 0 indexed record of the past few insertions. More... | |
virtual Whole | RecordCapacity () const =0 |
How many records does this use to calculate its wolling average. More... | |
The interface for rolling averages used in the Mezzanine, and threading library.
Definition at line 52 of file rollingaverage.h.
|
pure virtual |
What is the current rolling average.
The is no gaurantee on the time this runs in. It run in linear time relative to the amount of records or it could run in constant time
Implemented in Mezzanine::WeightedRollingAverage< RecordType, MathType >, and Mezzanine::BufferedRollingAverage< RecordType >.
|
pure virtual |
Add another record.
Datum | The record to be added. No gaurantee is provided that this record will be preserved, it could be use just once then discarded. |
Implemented in Mezzanine::WeightedRollingAverage< RecordType, MathType >, and Mezzanine::BufferedRollingAverage< RecordType >.
|
pure virtual |
Get a 0 indexed record of the past few insertions.
Index | Which entry to access. This may have different effects with different rolling averages, such as being ignored or estimated. |
This returns one insertion, with RecordCapacity()-1 being the newest, and 0 being the oldest.
Implemented in Mezzanine::WeightedRollingAverage< RecordType, MathType >, and Mezzanine::BufferedRollingAverage< RecordType >.
|
pure virtual |
Get a 0 indexed record of the past few insertions.
This returns one insertion, with RecordCapacity()-1 being the newest, and 0 being the oldest.
Index | Which entry to access. This may have different effects with different rolling averages, such as being ignored or estimated. |
This returns one insertion, with RecordCapacity()-1 being the newest, and 0 being the oldest.
Implemented in Mezzanine::WeightedRollingAverage< RecordType, MathType >, and Mezzanine::BufferedRollingAverage< RecordType >.
|
pure virtual |
How many records does this use to calculate its wolling average.
Implemented in Mezzanine::WeightedRollingAverage< RecordType, MathType >, and Mezzanine::BufferedRollingAverage< RecordType >.