Ocean
|
This class implements a thread-safe buffer queue. More...
Public Member Functions | |
void | push (const void *data, const size_t size) |
Pushes a new buffer to the queue. More... | |
void | push (Buffer &&data) |
Pushes a new buffer to the queue. More... | |
Buffer | pop () |
Pops a buffer from the queue. More... | |
void | clear () |
Clears the buffer queue. More... | |
size_t | size () const |
Returns the number of buffers in this queue. More... | |
bool | isEmpty () const |
Returns whether this queue holds no buffers. More... | |
Protected Types | |
typedef std::vector< uint8_t > | Buffer |
Definition of a vector holding bytes. More... | |
typedef std::deque< Buffer > | Queue |
Definition of a double-ended queue holding buffers. More... | |
Protected Attributes | |
Queue | queue_ |
The internal buffer queue. More... | |
Lock | lock_ |
The buffer lock. More... | |
This class implements a thread-safe buffer queue.
|
protected |
Definition of a vector holding bytes.
|
protected |
Definition of a double-ended queue holding buffers.
|
inline |
Clears the buffer queue.
|
inline |
Returns whether this queue holds no buffers.
|
inline |
Pops a buffer from the queue.
|
inline |
Pushes a new buffer to the queue.
data | The data to push, will be moved |
|
inline |
Pushes a new buffer to the queue.
data | The data to push, will be copied, can be nullptr if 'size == 0' |
size | The number of bytes to copy, with range [0, infinity) |
|
inline |
Returns the number of buffers in this queue.
|
mutableprotected |
The buffer lock.
|
protected |
The internal buffer queue.