HDK
|
#include <NET_CircularBuffer.h>
Classes | |
class | base_iterator |
Public Types | |
using | index_t = exint |
using | range_t = std::pair< T *, int > |
using | const_range_t = std::pair< const T *, int > |
using | iterator = base_iterator< T > |
using | const_iterator = base_iterator< const T > |
Public Member Functions | |
NET_CircularBuffer () | |
T & | front () |
The first element in the buffer. Undefined behaviour if the buffer is empty. More... | |
T & | back () |
The last element in the buffer. Undefined behaviour if the buffer is empty. More... | |
const T & | front () const |
The first element in the buffer. Undefined behaviour if the buffer is empty. More... | |
const T & | back () const |
The last element in the buffer. Undefined behaviour if the buffer is empty. More... | |
iterator | begin () |
The begin iterator for the buffer. More... | |
iterator | end () |
The end iterator for the buffer. More... | |
const_iterator | begin () const |
The begin const iterator for the buffer. More... | |
const_iterator | end () const |
The end const iterator for the buffer. More... | |
T & | operator[] (int index) |
Retrieve element at provided index. More... | |
const T & | operator[] (int index) const |
Retrieve element at provided index. More... | |
void | push (const T &data) |
Place a single element onto the back of the buffer. More... | |
void | push (const T *data, exint count) |
Place an array of elements onto the back of the buffer. More... | |
T | pop () |
Remove a single element from the front of the buffer. More... | |
void | pop (int count) |
Remove multiple elements from the front of the buffer. More... | |
bool | isFull () const |
Is the buffer currently full. More... | |
bool | isEmpty () const |
Is the buffer currently empty. More... | |
exint | size () const |
The number of elements currently stored in the buffer. More... | |
int | entries () const |
The number of elements currently stored in the buffer. More... | |
exint | capacity () const |
The current capacity of the buffer. More... | |
exint | maxSize () const |
The absolute maximum size of the buffer. Use size() if you need to know the current size of the buffer. More... | |
range_t | arrayOne () |
A circular buffer can wrap around in memory. This is the first array of continious memory. If the buffer is not currently wrapped then the entire buffer will be present in this array and the second array will be empty. More... | |
range_t | arrayTwo () |
Holds information about the second array of contigous data. See arrayOne() for further details. More... | |
const_range_t | arrayOne () const |
Const variant of the arrayOne(). More... | |
const_range_t | arrayTwo () const |
Const variant of the arrayTwo(). More... | |
void | clear () |
Completely clear the buffer. This will free any currently allocated data. More... | |
void | debug () const |
Printout debug information about this buffer. More... | |
Definition at line 27 of file NET_CircularBuffer.h.
using NET_CircularBuffer< T >::const_iterator = base_iterator<const T> |
Definition at line 155 of file NET_CircularBuffer.h.
using NET_CircularBuffer< T >::const_range_t = std::pair<const T*, int> |
Definition at line 32 of file NET_CircularBuffer.h.
using NET_CircularBuffer< T >::index_t = exint |
Definition at line 30 of file NET_CircularBuffer.h.
using NET_CircularBuffer< T >::iterator = base_iterator<T> |
Definition at line 154 of file NET_CircularBuffer.h.
using NET_CircularBuffer< T >::range_t = std::pair<T*, int> |
Definition at line 31 of file NET_CircularBuffer.h.
|
inline |
Definition at line 34 of file NET_CircularBuffer.h.
|
inline |
A circular buffer can wrap around in memory. This is the first array of continious memory. If the buffer is not currently wrapped then the entire buffer will be present in this array and the second array will be empty.
Definition at line 331 of file NET_CircularBuffer.h.
|
inline |
Const variant of the arrayOne().
Definition at line 359 of file NET_CircularBuffer.h.
|
inline |
Holds information about the second array of contigous data. See arrayOne() for further details.
Definition at line 346 of file NET_CircularBuffer.h.
|
inline |
Const variant of the arrayTwo().
Definition at line 366 of file NET_CircularBuffer.h.
|
inline |
The last element in the buffer. Undefined behaviour if the buffer is empty.
Definition at line 167 of file NET_CircularBuffer.h.
|
inline |
The last element in the buffer. Undefined behaviour if the buffer is empty.
Definition at line 177 of file NET_CircularBuffer.h.
|
inline |
The begin iterator for the buffer.
Definition at line 182 of file NET_CircularBuffer.h.
|
inline |
The begin const iterator for the buffer.
Definition at line 190 of file NET_CircularBuffer.h.
|
inline |
The current capacity of the buffer.
Definition at line 317 of file NET_CircularBuffer.h.
|
inline |
Completely clear the buffer. This will free any currently allocated data.
Definition at line 372 of file NET_CircularBuffer.h.
|
inline |
Printout debug information about this buffer.
Definition at line 380 of file NET_CircularBuffer.h.
|
inline |
The end iterator for the buffer.
Definition at line 186 of file NET_CircularBuffer.h.
|
inline |
The end const iterator for the buffer.
Definition at line 197 of file NET_CircularBuffer.h.
|
inline |
The number of elements currently stored in the buffer.
Definition at line 313 of file NET_CircularBuffer.h.
|
inline |
The first element in the buffer. Undefined behaviour if the buffer is empty.
Definition at line 161 of file NET_CircularBuffer.h.
|
inline |
The first element in the buffer. Undefined behaviour if the buffer is empty.
Definition at line 172 of file NET_CircularBuffer.h.
|
inline |
Is the buffer currently empty.
Definition at line 300 of file NET_CircularBuffer.h.
|
inline |
Is the buffer currently full.
Definition at line 296 of file NET_CircularBuffer.h.
|
inline |
The absolute maximum size of the buffer. Use size() if you need to know the current size of the buffer.
Definition at line 322 of file NET_CircularBuffer.h.
|
inline |
Retrieve element at provided index.
index | The index to retrieve the element at. |
Definition at line 206 of file NET_CircularBuffer.h.
|
inline |
Retrieve element at provided index.
index | The index to retrieve the element at. |
Definition at line 217 of file NET_CircularBuffer.h.
|
inline |
Remove a single element from the front of the buffer.
Definition at line 277 of file NET_CircularBuffer.h.
|
inline |
Remove multiple elements from the front of the buffer.
count | The number of elements to remove. |
Definition at line 287 of file NET_CircularBuffer.h.
|
inline |
Place a single element onto the back of the buffer.
data |
Definition at line 227 of file NET_CircularBuffer.h.
|
inline |
Place an array of elements onto the back of the buffer.
data | The array of elements to add to the buffer. |
count | The number of elements in the array to add. |
Definition at line 235 of file NET_CircularBuffer.h.
|
inline |
The number of elements currently stored in the buffer.
Definition at line 304 of file NET_CircularBuffer.h.