MPD
0.20.6
|
A first-in-first-out buffer: you can append data at the end, and read data from the beginning. More...
#include <DynamicFifoBuffer.hxx>
Public Types | |
typedef ForeignFifoBuffer< T >::size_type | size_type |
typedef ForeignFifoBuffer< T >::pointer_type | pointer_type |
typedef ForeignFifoBuffer< T >::const_pointer_type | const_pointer_type |
typedef ForeignFifoBuffer< T >::Range | Range |
Public Member Functions | |
DynamicFifoBuffer (size_type _capacity) | |
~DynamicFifoBuffer () | |
DynamicFifoBuffer (const DynamicFifoBuffer &)=delete | |
void | Grow (size_type new_capacity) |
void | WantWrite (size_type n) |
pointer_type | Write (size_type n) |
Write data to the buffer, growing it as needed. More... | |
void | Append (const_pointer_type p, size_type n) |
Append data to the buffer, growing it as needed. More... | |
Additional Inherited Members | |
![]() | |
typedef size_t | size_type |
typedef WritableBuffer< T > | Range |
typedef Range::pointer_type | pointer_type |
typedef Range::const_pointer_type | const_pointer_type |
![]() | |
void | Shift () |
constexpr | ForeignFifoBuffer (std::nullptr_t n) |
constexpr | ForeignFifoBuffer (T *_data, size_type _capacity) |
ForeignFifoBuffer (ForeignFifoBuffer &&src) | |
ForeignFifoBuffer & | operator= (ForeignFifoBuffer &&src) |
void | Swap (ForeignFifoBuffer< T > &other) |
constexpr bool | IsNull () const |
constexpr bool | IsDefined () const |
T * | GetBuffer () |
constexpr size_type | GetCapacity () const |
void | SetNull () |
void | SetBuffer (T *_data, size_type _capacity) |
void | MoveBuffer (T *new_data, size_type new_capacity) |
void | Clear () |
constexpr bool | IsEmpty () const |
constexpr bool | IsFull () const |
Range | Write () |
Prepares writing. More... | |
bool | WantWrite (size_type n) |
void | Append (size_type n) |
Expands the tail of the buffer, after data has been written to the buffer returned by write(). More... | |
constexpr size_type | GetAvailable () const |
constexpr Range | Read () const |
Return a buffer range which may be read. More... | |
void | Consume (size_type n) |
Marks a chunk as consumed. More... | |
size_type | Read (pointer_type p, size_type n) |
size_type | MoveFrom (ForeignFifoBuffer< T > &src) |
Move as much data as possible from the specified buffer. More... | |
![]() | |
size_type | head |
size_type | tail |
size_type | capacity |
T * | data |
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 41 of file DynamicFifoBuffer.hxx.
typedef ForeignFifoBuffer<T>::const_pointer_type DynamicFifoBuffer< T >::const_pointer_type |
Definition at line 45 of file DynamicFifoBuffer.hxx.
typedef ForeignFifoBuffer<T>::pointer_type DynamicFifoBuffer< T >::pointer_type |
Definition at line 44 of file DynamicFifoBuffer.hxx.
typedef ForeignFifoBuffer<T>::Range DynamicFifoBuffer< T >::Range |
Definition at line 46 of file DynamicFifoBuffer.hxx.
typedef ForeignFifoBuffer<T>::size_type DynamicFifoBuffer< T >::size_type |
Definition at line 43 of file DynamicFifoBuffer.hxx.
|
inlineexplicit |
Definition at line 48 of file DynamicFifoBuffer.hxx.
|
inline |
Definition at line 50 of file DynamicFifoBuffer.hxx.
|
delete |
|
inline |
Append data to the buffer, growing it as needed.
Definition at line 102 of file DynamicFifoBuffer.hxx.
|
inline |
Definition at line 66 of file DynamicFifoBuffer.hxx.
|
inline |
Definition at line 75 of file DynamicFifoBuffer.hxx.
|
inline |
Write data to the buffer, growing it as needed.
Returns a writable pointer.
Definition at line 94 of file DynamicFifoBuffer.hxx.