Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Sorted packet queue. More...
#include <sorted_queue.h>
Public Member Functions | |
SortedQueue (size_t max_size) | |
Construct empty queue. More... | |
virtual ROC_ATTR_NODISCARD status::StatusCode | write (const PacketPtr &packet) |
Add packet to the queue. More... | |
virtual ROC_ATTR_NODISCARD status::StatusCode | read (PacketPtr &packet) |
Read next packet. More... | |
size_t | size () const |
Get number of packets in queue. More... | |
PacketPtr | head () const |
Get first packet in the queue. More... | |
PacketPtr | tail () const |
Get last packet in the queue. More... | |
PacketPtr | latest () const |
Get the latest packet that were ever added to the queue. More... | |
Sorted packet queue.
Definition at line 27 of file sorted_queue.h.
|
explicit |
Construct empty queue.
max_size
is non-zero, it specifies maximum number of packets in queue. PacketPtr roc::packet::SortedQueue::head | ( | ) | const |
Get first packet in the queue.
PacketPtr roc::packet::SortedQueue::latest | ( | ) | const |
Get the latest packet that were ever added to the queue.
|
virtual |
size_t roc::packet::SortedQueue::size | ( | ) | const |
Get number of packets in queue.
PacketPtr roc::packet::SortedQueue::tail | ( | ) | const |
Get last packet in the queue.
|
virtual |
Add packet to the queue.
Implements roc::packet::IWriter.