MPD
0.20.18
|
A first-in-first-out buffer: you can append data at the end, and read data from the beginning. More...
#include <StaticFifoBuffer.hxx>
Public Types | |
typedef size_t | size_type |
typedef WritableBuffer< T > | Range |
Public Member Functions | |
constexpr | StaticFifoBuffer () |
void | Shift () |
void | Clear () |
bool | IsEmpty () const |
bool | IsFull () const |
Range | Write () |
Prepares writing. More... | |
void | Append (size_type n) |
Expands the tail of the buffer, after data has been written to the buffer returned by write(). More... | |
Range | Read () |
Return a buffer range which may be read. More... | |
void | Consume (size_type n) |
Marks a chunk as consumed. More... | |
Protected Attributes | |
size_type | head |
size_type | tail |
T | data [size] |
A first-in-first-out buffer: you can append data at the end, and read data from the beginning.
This class automatically shifts the buffer as needed. It is not thread safe.
Definition at line 47 of file StaticFifoBuffer.hxx.
typedef WritableBuffer<T> StaticFifoBuffer< T, size >::Range |
Definition at line 52 of file StaticFifoBuffer.hxx.
typedef size_t StaticFifoBuffer< T, size >::size_type |
Definition at line 49 of file StaticFifoBuffer.hxx.
|
inline |
Definition at line 60 of file StaticFifoBuffer.hxx.
|
inline |
Expands the tail of the buffer, after data has been written to the buffer returned by write().
Definition at line 105 of file StaticFifoBuffer.hxx.
|
inline |
Definition at line 76 of file StaticFifoBuffer.hxx.
|
inline |
Marks a chunk as consumed.
Definition at line 124 of file StaticFifoBuffer.hxx.
|
inline |
Definition at line 80 of file StaticFifoBuffer.hxx.
|
inline |
Definition at line 84 of file StaticFifoBuffer.hxx.
|
inline |
Return a buffer range which may be read.
The buffer pointer is writable, to allow modifications while parsing.
Definition at line 117 of file StaticFifoBuffer.hxx.
|
inline |
Definition at line 62 of file StaticFifoBuffer.hxx.
|
inline |
Prepares writing.
Returns a buffer range which may be written. When you are finished, call append().
Definition at line 92 of file StaticFifoBuffer.hxx.
|
protected |
Definition at line 56 of file StaticFifoBuffer.hxx.
|
protected |
Definition at line 55 of file StaticFifoBuffer.hxx.
|
protected |
Definition at line 55 of file StaticFifoBuffer.hxx.