class
SushiDSP::LogLineQueue
Carries lines from any number of producer threads to one consumer thread.
- Declared in
include/SushiDSP/log/LogLineQueue.hpp
push() and pop() neither block nor allocate; the storage is taken once, at construction.
Public member functions
explicit LogLineQueue(std::size_t capacity)Allocates the storage for every line the queue can hold.
Parameters
capacityRounded up to a power of two, and to at least two.
LogLineQueue(const LogLineQueue &)=deleteLogLineQueue & operator=(const LogLineQueue &)=deleteLogLineQueue(LogLineQueue &&)=deleteLogLineQueue & operator=(LogLineQueue &&)=delete~LogLineQueue()=defaultbool push(const LogRecord &record) noexceptCopies a line into the queue.
Any thread may call it, several at once.
Returns
False when the queue is full; the line is then not stored.
bool pop(QueuedLogLine &out) noexceptMoves the oldest line out of the queue.
One thread only.
Returns
False when the queue is empty; out is then untouched.
std::size_t capacity() const noexceptReturns how many lines the queue holds when full.

