|
Turbo Engine 0.3
A C++ game engine using Allegro 5
|
Simple cirular buffer implementation. More...
#include <RotativeBuffer.hpp>
Public Member Functions | |
| RotativeBuffer (T initial_value, unsigned short size) | |
| Initialize the cirular buffer. | |
| RotativeBuffer () | |
| Initialize a cirular buffer of size 10 and the default value of the type as memset. | |
| ~RotativeBuffer () | |
| RotativeBuffer (const RotativeBuffer &other) | |
| RotativeBuffer & | operator= (const RotativeBuffer &other) |
| RotativeBuffer (RotativeBuffer &&other) noexcept | |
| RotativeBuffer & | operator= (RotativeBuffer &&other) noexcept |
| T & | get_data (unsigned short position) const |
| get an item of the circular buffer | |
| T * | get_array () const |
| get the buffer rotated by the buffer position | |
| void | turn () |
| void | set_first (const T &val) |
| void | set_last (const T &val) |
| unsigned short | get_size () const |
| const T & | operator[] (unsigned short pos) |
| operator const char * () | |
Protected Attributes | |
| T * | buffer = nullptr |
| unsigned short | size |
| unsigned short | position = 0 |
Simple cirular buffer implementation.
| T | content type |
|
inline |
Initialize the cirular buffer.
| initial_value | value to memset |
| size | size of the circular buffer |
|
inline |
Initialize a cirular buffer of size 10 and the default value of the type as memset.
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
get the buffer rotated by the buffer position
|
inline |
get an item of the circular buffer
| position | position in the buffer |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |