Allolib
1.0
C++ Components For Interactive Multimedia
|
Constant size shift buffer. More...
Public Member Functions | |
ShiftBuffer (const T &v=T()) | |
const T * | elems () const |
Get pointer to elements (read-only) | |
T * | elems () |
Get pointer to elements. | |
T & | operator[] (int i) |
Get reference to element at index. | |
const T & | operator[] (int i) const |
Get reference to element at index (read-only) | |
void | operator() (const T &v) |
Push new element onto buffer. Newest element is at index 0. | |
void | assign (const T &v) |
Set all elements to argument. | |
void | zero () |
Zero bytes of all elements. | |
Static Public Member Functions | |
static int | size () |
Get number of elements. | |
Protected Attributes | |
T | mElems [N] |
Constant size shift buffer.
This is a first-in, first-out buffer with a constant number of elements. Adding new elements to the buffer physically moves existing elements. The advantage of moving memory like this is that elements stay logically ordered making access faster and operating on the history easier.
Definition at line 298 of file al_Buffer.hpp.
|
inline |
[in] | v | Value to initialize all elements to |
Definition at line 301 of file al_Buffer.hpp.