diff --git a/src/Vectorial.h b/src/Vectorial.h index 5551e95..e6b6703 100644 --- a/src/Vectorial.h +++ b/src/Vectorial.h @@ -19,6 +19,18 @@ struct Vector { } } + // checks if buffer is empty + + bool is_empty() { + return entriesAdded == 0; + } + + // checks if buffer is full + + bool is_full() { + return entriesAdded == N; + } + T operator[](int idx) const { return data[(entriesAdded - 1 - idx + 2*N) % N]; }