AskSin++
|
#include <RingBuffer.h>
Public Member Functions | |
RingStack () | |
void | clear () |
int | size () const |
int | count () const |
bool | shift () |
bool | shift (const TYPE &data) |
TYPE & | operator[] (int index) |
const TYPE & | operator[] (int index) const |
Implements a stack with SIZE elements. New elements will be stored on top. If the number of elements exceeds SIZE the oldest element will be removed/overwritten.
Definition at line 15 of file RingBuffer.h.
|
inline |
Construct and initialize the stack
Definition at line 38 of file RingBuffer.h.
|
inline |
Clear the stack. After this call the stack is empty.
Definition at line 44 of file RingBuffer.h.
|
inline |
Return the actual number of stored elements
Definition at line 57 of file RingBuffer.h.
|
inline |
Array-operator to access an element on the stack
index | the index of the element on the stack to return |
Definition at line 83 of file RingBuffer.h.
|
inline |
Array-operator to access an element on the stack
index | the index of the element on the stack to return |
Definition at line 92 of file RingBuffer.h.
|
inline |
Shift the internal structure to the next element
Definition at line 62 of file RingBuffer.h.
|
inline |
Shift the stack to the next element and store the given value on the top
data | value to store |
Definition at line 73 of file RingBuffer.h.
|
inline |
Return the maximal size of elements which can be stored
Definition at line 52 of file RingBuffer.h.