Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Concurrent blocking packet queue. More...
#include <concurrent_queue.h>
Public Types | |
enum | Mode { Blocking , NonBlocking } |
Queue mode. More... | |
Public Member Functions | |
ConcurrentQueue (Mode mode) | |
Initialize. mode defines whether reads will be blocking. More... | |
virtual ROC_ATTR_NODISCARD status::StatusCode | read (PacketPtr &) |
Read next packet. If reads are not concurrent, and queue is non-blocking, then reads are wait-free. Otherwise they may block. More... | |
virtual ROC_ATTR_NODISCARD status::StatusCode | write (const PacketPtr &packet) |
Add packet to the queue. Wait-free operation. More... | |
Concurrent blocking packet queue.
Definition at line 28 of file concurrent_queue.h.
Queue mode.
Enumerator | |
---|---|
Blocking | Read operation blocks until queue is non-empty. |
NonBlocking | Read operation returns null if queue is empty. |
Definition at line 31 of file concurrent_queue.h.
|
explicit |
Initialize. mode
defines whether reads will be blocking.
|
virtual |
Read next packet. If reads are not concurrent, and queue is non-blocking, then reads are wait-free. Otherwise they may block.
Implements roc::packet::IReader.
|
virtual |
Add packet to the queue. Wait-free operation.
Implements roc::packet::IWriter.