value_type |
Alias for template parameter T. |
CyclicBuffer<T>(const unsigned N = 64u) |
Constructor,N is the desired capacity of the buffer. |
unsigned size() cons |
Number of element currently in the buffer. |
unsigned capacity() const |
Maximum capacity of the buffer. |
void resize(const unsigned N) |
Change the capacity of the buffer. |
void clear() |
Remove all elements from the buffer. |
void add(const value_type x) |
Add an element to the buffer. |
value_type avg() const |
Return the average value of all the elements in the buffer. |
value_type operator[](const unsigned index) const |
Access previously stored elements. For index equal to
zero, retrieve the last added element; for index equals one,
return the last-but-one added element; et cetera. |