23 : numPoints(numPoints), data() {}
35 return std::reduce(std::next(data.begin()), data.end(), data.front()) / data.size();
46 if (data.size() > numPoints) {
int getBufferSize() const
Get the maximum number of points that can be stored in the buffer.
Definition RollingAvgFilter.h:74
RollingAvgFilter(size_t numPoints)
Construct a new rolling average filter.
Definition RollingAvgFilter.h:22
T get(const T &val)
Adds data to the filter and gets the new output.
Definition RollingAvgFilter.h:44
void reset()
Clears all data in the buffer.
Definition RollingAvgFilter.h:56
T get() const
Get the output of the filter.
Definition RollingAvgFilter.h:34
int getSize() const
Returns the number of points stored in the buffer.
Definition RollingAvgFilter.h:65
std::list< T > getData() const
Get the underlying buffer of the filter.
Definition RollingAvgFilter.h:83