|
Ocean
|
This class implements a thread-safe buffer queue. More...
#include <BufferQueue.h>
Public Member Functions | |
| void | push (const void *data, const size_t size) |
| Pushes a new buffer to the queue. | |
| void | push (Buffer &&data) |
| Pushes a new buffer to the queue. | |
| Buffer | pop () |
| Pops a buffer from the queue. | |
| void | clear () |
| Clears the buffer queue. | |
| size_t | size () const |
| Returns the number of buffers in this queue. | |
| bool | isEmpty () const |
| Returns whether this queue holds no buffers. | |
Protected Types | |
| typedef std::vector< uint8_t > | Buffer |
| Definition of a vector holding bytes. | |
| typedef std::deque< Buffer > | Queue |
| Definition of a double-ended queue holding buffers. | |
Protected Attributes | |
| Queue | queue_ |
| The internal buffer queue. | |
| Lock | lock_ |
| The buffer lock. | |
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.