12 #ifndef ROC_CORE_SPSC_BYTE_BUFFER_H_
13 #define ROC_CORE_SPSC_BYTE_BUFFER_H_
69 const size_t chunk_size_;
70 const size_t chunk_count_;
Base class for non-copyable objects.
Thread-safe lock-free single-producer single-consumer circular buffer of byte chunks.
void end_write()
End writing of a chunk. Should be called if and only if begin_write() returned non-NULL....
SpscByteBuffer(IArena &arena, size_t chunk_size, size_t n_chunks)
Initialize.
~SpscByteBuffer()
Deinitialize.
bool is_empty() const
Check if buffer is empty.
uint8_t * begin_write()
Begin writing of a chunk. If buffer is full, returns NULL. Should be called from writer thread....
bool is_valid() const
Check that initial allocation succeeded.
uint8_t * begin_read()
Begin reading of a chunk. If buffer is empty, returns NULL. Should be called from reader thread....
void end_read()
End reading of a chunk. Should be called if and only if begin_read() returned non-NULL....
Commonly used types and functions.