#include <LeapUtil.h>
Public Types | |
enum | { kHistoryLength = _HistoryLength } |
Public Member Functions | |
float | AddSample (float fSample) |
float | GetAverage () const |
uint32_t | GetNumSamples () const |
float | GetSum () const |
float | operator[] (uint32_t uiIdx) const |
index 0 is the oldest sample, index kHistorySize - 1 is the newest. | |
void | Reset () |
RollingAverage () | |
Private Attributes | |
float | m_afSamples [kHistoryLength] |
float | m_fAverage |
float | m_fNumSamples |
float | m_fSum |
uint32_t | m_uiCurIndex |
Definition at line 215 of file LeapUtil.h.
anonymous enum |
Definition at line 218 of file LeapUtil.h.
LeapUtil::RollingAverage< _HistoryLength >::RollingAverage | ( | ) | [inline] |
Definition at line 224 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::AddSample | ( | float | fSample | ) | [inline] |
Definition at line 235 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::GetAverage | ( | ) | const [inline] |
Definition at line 249 of file LeapUtil.h.
uint32_t LeapUtil::RollingAverage< _HistoryLength >::GetNumSamples | ( | ) | const [inline] |
Definition at line 251 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::GetSum | ( | ) | const [inline] |
Definition at line 250 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::operator[] | ( | uint32_t | uiIdx | ) | const [inline] |
index 0 is the oldest sample, index kHistorySize - 1 is the newest.
Definition at line 254 of file LeapUtil.h.
void LeapUtil::RollingAverage< _HistoryLength >::Reset | ( | ) | [inline] |
Definition at line 226 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::m_afSamples[kHistoryLength] [private] |
Definition at line 261 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::m_fAverage [private] |
Definition at line 260 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::m_fNumSamples [private] |
Definition at line 258 of file LeapUtil.h.
float LeapUtil::RollingAverage< _HistoryLength >::m_fSum [private] |
Definition at line 259 of file LeapUtil.h.
uint32_t LeapUtil::RollingAverage< _HistoryLength >::m_uiCurIndex [private] |
Definition at line 257 of file LeapUtil.h.