![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Multiple-producer single-consumer (MPSC) bounded ring buffer. More...
#include <streaming_sink.hpp>
Public Member Functions | |
| MpscRingBuffer () | |
| Construct the ring buffer, initializing all slot sequences. | |
| MpscRingBuffer (const MpscRingBuffer &)=delete | |
| MpscRingBuffer & | operator= (const MpscRingBuffer &)=delete |
| bool | push (T item) |
| Push one item. Returns false immediately if the buffer is full. | |
| size_t | push (const T *items, size_t count) |
| Bulk push. Returns the number of items actually pushed. | |
| bool | pop (T &out) |
Pop one item into out. Returns false if the buffer is empty. | |
| size_t | pop (T *out, size_t max_count) |
Bulk pop up to max_count items. Returns number popped. | |
| size_t | size () const |
| Approximate number of items in the buffer (may transiently exceed Capacity during push). | |
| bool | empty () const |
| True if the buffer appears empty (approximate). | |
| bool | full () const |
| True if the buffer appears full (approximate). | |
Static Public Member Functions | |
| static constexpr size_t | capacity () |
| The compile-time capacity of this ring buffer. | |
Multiple-producer single-consumer (MPSC) bounded ring buffer.
Producers are lock-free via CAS on the enqueue position (Vyukov-style per-slot sequencing). The single consumer requires no locking. Capacity must be a power of two.
| T | Element type (must be move-constructible and default-constructible). |
| Capacity | Maximum number of elements (must be power of 2). |
Definition at line 251 of file streaming_sink.hpp.
|
inline |
Construct the ring buffer, initializing all slot sequences.
Definition at line 271 of file streaming_sink.hpp.
|
delete |
|
inlinestaticconstexpr |
The compile-time capacity of this ring buffer.
Definition at line 372 of file streaming_sink.hpp.
|
inline |
True if the buffer appears empty (approximate).
Definition at line 367 of file streaming_sink.hpp.
|
inline |
True if the buffer appears full (approximate).
Definition at line 369 of file streaming_sink.hpp.
|
delete |
|
inline |
Pop one item into out. Returns false if the buffer is empty.
Definition at line 331 of file streaming_sink.hpp.
|
inline |
Bulk pop up to max_count items. Returns number popped.
Definition at line 349 of file streaming_sink.hpp.
|
inline |
Bulk push. Returns the number of items actually pushed.
Definition at line 317 of file streaming_sink.hpp.
|
inline |
Push one item. Returns false immediately if the buffer is full.
Definition at line 286 of file streaming_sink.hpp.
|
inline |
Approximate number of items in the buffer (may transiently exceed Capacity during push).
Definition at line 362 of file streaming_sink.hpp.