Skip to content
Snippets Groups Projects
Commit ebc9e703 authored by Federico Lolli's avatar Federico Lolli
Browse files

[SlidingWindow] minor (added simple method + init little change)

parent 4579a450
No related branches found
No related tags found
1 merge request!227FFT and other Utilities (Filters and Windows)
......@@ -31,7 +31,7 @@ template <typename T, size_t D>
class SlidingWindow
{
public:
explicit SlidingWindow() : window({}), filled(0) {}
explicit SlidingWindow() : window({0}), filled(0) {}
void push(T value)
{
......@@ -42,6 +42,11 @@ public:
bool isFull() { return filled == D; }
/**
* @brief Get the actual number of elements in the window
*/
size_t filled() { return filled; }
T last() { return window[D - 1]; }
std::array<T, D>& all() { return &window; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment