Thread-safe single-producer, single-consumer block-based double-ended byte queue.
Public Member Functions
StreamingBuffer (size_t blockSizeBytes=65536)
voidpushFront (const void *data, size_t sizeBytes)
pushes sizeBytes bytes at the front of the deque
size_tpopBack (void *output, size_t maxSize)
pops up to maxSize bytes from the back of the deque. Returns the number of bytes popped, which may be 0.
size_tgetSize () const
returns the number of bytes currently in the deque
boolempty () const
trueif the deque is empty
clears all data in the deque but does not deallocate internal storage
deallocates internal storage to precisely fit current size
size_tcopyTo (void *output, size_t maxSize) const
Performs a non-destructive copy to output , up to maxSize bytes. Does not pop any data. Returns number of bytes written.