Public Types | Public Member Functions | Private Attributes | List of all members
LeapUtil::RollingAverage< _HistoryLength > Class Template Reference

#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. More...
 
void Reset ()
 
 RollingAverage ()
 

Private Attributes

float m_afSamples [kHistoryLength]
 
float m_fAverage
 
float m_fNumSamples
 
float m_fSum
 
uint32_t m_uiCurIndex
 

Detailed Description

template<int _HistoryLength = 256>
class LeapUtil::RollingAverage< _HistoryLength >

Definition at line 215 of file LeapUtil.h.

Member Enumeration Documentation

template<int _HistoryLength = 256>
anonymous enum
Enumerator
kHistoryLength 

Definition at line 218 of file LeapUtil.h.

Constructor & Destructor Documentation

template<int _HistoryLength = 256>
LeapUtil::RollingAverage< _HistoryLength >::RollingAverage ( )
inline

Definition at line 224 of file LeapUtil.h.

Member Function Documentation

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::AddSample ( float  fSample)
inline

Definition at line 235 of file LeapUtil.h.

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::GetAverage ( ) const
inline

Definition at line 249 of file LeapUtil.h.

template<int _HistoryLength = 256>
uint32_t LeapUtil::RollingAverage< _HistoryLength >::GetNumSamples ( ) const
inline

Definition at line 251 of file LeapUtil.h.

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::GetSum ( ) const
inline

Definition at line 250 of file LeapUtil.h.

template<int _HistoryLength = 256>
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.

template<int _HistoryLength = 256>
void LeapUtil::RollingAverage< _HistoryLength >::Reset ( )
inline

Definition at line 226 of file LeapUtil.h.

Member Data Documentation

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::m_afSamples[kHistoryLength]
private

Definition at line 261 of file LeapUtil.h.

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::m_fAverage
private

Definition at line 260 of file LeapUtil.h.

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::m_fNumSamples
private

Definition at line 258 of file LeapUtil.h.

template<int _HistoryLength = 256>
float LeapUtil::RollingAverage< _HistoryLength >::m_fSum
private

Definition at line 259 of file LeapUtil.h.

template<int _HistoryLength = 256>
uint32_t LeapUtil::RollingAverage< _HistoryLength >::m_uiCurIndex
private

Definition at line 257 of file LeapUtil.h.


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


leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Tue Jun 2 2020 03:58:01