|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
#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 57 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 142 of file SpscQueue.h.
|
inlinenoexcept |
Returns true if the queue appears empty (approximate).
Definition at line 139 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 107 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 80 of file SpscQueue.h.
|
inlinenoexcept |
Returns the approximate number of elements in the queue.
Definition at line 131 of file SpscQueue.h.