|
RADLib
RADical C++ application framework
|
Lock-free single-producer/single-consumer bounded queue. More...
#include <RADDataStructures.h>
Public Member Functions | |
| RADSpscQueue (size_t capacity) | |
| Creates a queue with usable capacity rounded to a power of two. More... | |
| ~RADSpscQueue () | |
| Destroys any elements still queued. More... | |
| RADSpscQueue (const RADSpscQueue &)=delete | |
| SPSC queues own atomic storage and cannot be copied. More... | |
| RADSpscQueue & | operator= (const RADSpscQueue &)=delete |
| SPSC queues own atomic storage and cannot be copied. More... | |
| bool | empty () const noexcept |
| Returns true when no item is available. More... | |
| size_t | capacity () const noexcept |
| Returns usable queue capacity. More... | |
| bool | try_push (const T &value) |
| Attempts to push a copy; returns false when full. More... | |
| bool | try_push (T &&value) |
| Attempts to push a moved value; returns false when full. More... | |
| template<typename... Args> | |
| bool | emplace (Args &&... args) |
| Attempts to construct an item in-place; returns false when full. More... | |
| bool | try_pop (T &out) |
| Attempts to pop into out; returns false when empty. More... | |
Lock-free single-producer/single-consumer bounded queue.
|
inlineexplicit |
Creates a queue with usable capacity rounded to a power of two.
|
inline |
Destroys any elements still queued.
|
delete |
SPSC queues own atomic storage and cannot be copied.
|
inlinenoexcept |
Returns usable queue capacity.
|
inline |
Attempts to construct an item in-place; returns false when full.
|
inlinenoexcept |
Returns true when no item is available.
|
delete |
SPSC queues own atomic storage and cannot be copied.
|
inline |
Attempts to pop into out; returns false when empty.
|
inline |
Attempts to push a copy; returns false when full.
|
inline |
Attempts to push a moved value; returns false when full.