7 #include <imstkLogger.h> 16 explicit AccumulationBuffer(
size_t capacity = 1024) : m_capacity(capacity), m_data(capacity, {})
30 m_sum -= m_data[m_index];
31 m_data[m_index] = val;
32 m_index = (m_index + 1) % m_capacity;
38 return m_sum /
static_cast<T
>(m_capacity);
43 std::vector<T> m_data;
void pushBack(T val)
Pushes the value onto the buffer.
size_t getCapacity() const
Class to accumulate values for determining a rolling average note that the buffer will be filled with...