Open FFBoard
Open source force feedback firmware
FastAvg< T, LEN > Class Template Reference

#include <FastAvg.h>

Public Member Functions

 FastAvg ()
 
 ~FastAvg ()
 
 __attribute__ ((optimize("-Ofast"))) void addValue(T value)
 
getAverage ()
 
process (float value)
 
void clear ()
 

Private Attributes

samples [LEN+1] = {static_cast<T>(0)}
 
int currentIndex = 0
 
sumOfSamples = 0
 

Detailed Description

template<class T, std::size_t LEN>
class FastAvg< T, LEN >

Definition at line 14 of file FastAvg.h.

Constructor & Destructor Documentation

◆ FastAvg()

template<class T , std::size_t LEN>
FastAvg< T, LEN >::FastAvg ( )
inline

Definition at line 17 of file FastAvg.h.

◆ ~FastAvg()

template<class T , std::size_t LEN>
FastAvg< T, LEN >::~FastAvg ( )
inline

Definition at line 18 of file FastAvg.h.

Member Function Documentation

◆ __attribute__()

template<class T , std::size_t LEN>
FastAvg< T, LEN >::__attribute__ ( (optimize("-Ofast"))  )
inline

Definition at line 20 of file FastAvg.h.

◆ clear()

template<class T , std::size_t LEN>
void FastAvg< T, LEN >::clear ( )
inline

Definition at line 44 of file FastAvg.h.

◆ getAverage()

template<class T , std::size_t LEN>
T FastAvg< T, LEN >::getAverage ( )
inline

Definition at line 35 of file FastAvg.h.

◆ process()

template<class T , std::size_t LEN>
T FastAvg< T, LEN >::process ( float  value)
inline

Definition at line 39 of file FastAvg.h.

Member Data Documentation

◆ currentIndex

template<class T , std::size_t LEN>
int FastAvg< T, LEN >::currentIndex = 0
private

Definition at line 51 of file FastAvg.h.

◆ samples

template<class T , std::size_t LEN>
T FastAvg< T, LEN >::samples[LEN+1] = {static_cast<T>(0)}
private

Definition at line 50 of file FastAvg.h.

◆ sumOfSamples

template<class T , std::size_t LEN>
T FastAvg< T, LEN >::sumOfSamples = 0
private

Definition at line 52 of file FastAvg.h.


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