Variable that automaticaly averages itself out when it is called, that is, it only updates it's average when the variable is used.
More...
#include <Util.h>
|
| AvgVarRef (T *pointer, int samples) |
| Construct a new AvgVar Ref given the number of samples to average the value over and the pointer to the variable it should reference.
|
|
| operator T () |
| Update the internal average.
|
|
template<typename T>
class AvgVarRef< T >
Variable that automaticaly averages itself out when it is called, that is, it only updates it's average when the variable is used.
- Note
- The underlying implementation converts everything to a double to maximize precision when averaging
- Template Parameters
-
T | The primitive data type of this variable |
Definition at line 105 of file Util.h.
◆ AvgVarRef()
Construct a new AvgVar Ref given the number of samples to average the value over and the pointer to the variable it should reference.
- Parameters
-
pointer | The variable to reference |
samples | The number of samples |
Definition at line 118 of file Util.h.
◆ operator T()
Update the internal average.
- Returns
- T The internal average interpreted as type T
Definition at line 128 of file Util.h.
The documentation for this class was generated from the following file: