iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | List of all members
AccumulationBuffer< T > Class Template Reference

Class to accumulate values for determining a rolling average note that the buffer will be filled with 0 at initialization, therefore the average will ramp up slowly as the buffer is filled. More...

#include <imstkAccumulationBuffer.h>

Public Member Functions

 AccumulationBuffer (size_t capacity=1024)
 
size_t getCapacity () const
 
void pushBack (T val)
 Pushes the value onto the buffer.
 
getAverage () const
 

Detailed Description

template<typename T>
class AccumulationBuffer< T >

Class to accumulate values for determining a rolling average note that the buffer will be filled with 0 at initialization, therefore the average will ramp up slowly as the buffer is filled.

Definition at line 13 of file imstkAccumulationBuffer.h.

Member Function Documentation

◆ getAverage()

template<typename T>
T AccumulationBuffer< T >::getAverage ( ) const
inline
Returns
the average of all values in the buffer

Definition at line 36 of file imstkAccumulationBuffer.h.

◆ getCapacity()

template<typename T>
size_t AccumulationBuffer< T >::getCapacity ( ) const
inline
Returns
the capacity of the buffer

Definition at line 21 of file imstkAccumulationBuffer.h.


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