|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
#include <SpscQueue.h>
Public Member Functions | |
| SpscQueue ()=default | |
| Constructs an empty SPSC queue. | |
| SpscQueue (const SpscQueue &)=delete | |
| SpscQueue & | operator= (const SpscQueue &)=delete |
| bool | push (const T &item) noexcept |
| Pushes an element into the queue (producer side). | |
| bool | pop (T &item) noexcept |
| Pops an element from the queue (consumer side). | |
| std::size_t | sizeApprox () const noexcept |
| Returns the approximate number of elements in the queue. | |
| bool | empty () const noexcept |
| Returns true if the queue appears empty (approximate). | |
Static Public Member Functions | |
| static constexpr std::size_t | capacity () noexcept |
| Usable capacity: one slot is reserved to tell full from empty. | |
Definition at line 66 of file SpscQueue.h.
|
default |
Constructs an empty SPSC queue.
|
delete |
|
inlinestaticconstexprnoexcept |
Usable capacity: one slot is reserved to tell full from empty.
Definition at line 151 of file SpscQueue.h.
|
inlinenoexcept |
Returns true if the queue appears empty (approximate).
Definition at line 148 of file SpscQueue.h.
|
delete |
|
inlinenoexcept |
Pops an element from the queue (consumer side).
| [out] | item | Receives the dequeued element if the queue is not empty. |
| true | if an element was dequeued. |
| false | if the queue was empty. |
Definition at line 116 of file SpscQueue.h.
|
inlinenoexcept |
Pushes an element into the queue (producer side).
| item | The element to enqueue. |
| true | if the element was successfully enqueued. |
| false | if the queue is full (element dropped). |
Definition at line 89 of file SpscQueue.h.
|
inlinenoexcept |
Returns the approximate number of elements in the queue.
Definition at line 140 of file SpscQueue.h.