SOFA plugin: LeapMotion  master
Open source framework for multi-physics simuation
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
RollingAverage Class Reference

#include <MyListener.h>

Public Member Functions

 RollingAverage ()
 
void Reset ()
 
float AddSample (float fSample)
 
float GetAverage () const
 
uint32_t GetNumSamples () const
 
float operator[] (uint32_t uiIdx) const
 index 0 is the oldest sample, index kHistorySize - 1 is the newest. More...
 

Constructor details

◆ RollingAverage()

RollingAverage::RollingAverage ( )
inline

Function details

◆ AddSample()

float RollingAverage::AddSample ( float  fSample)
inline

◆ GetAverage()

float RollingAverage::GetAverage ( ) const
inline

◆ GetNumSamples()

uint32_t RollingAverage::GetNumSamples ( ) const
inline

◆ operator[]()

float RollingAverage::operator[] ( uint32_t  uiIdx) const
inline

index 0 is the oldest sample, index kHistorySize - 1 is the newest.

◆ Reset()

void RollingAverage::Reset ( )
inline

Enum details

◆ anonymous enum

anonymous enum
Enumerator
kHistoryLength