48#include <condition_variable>
78 template<Type::MoveConstructible T>
140 void Push(
int key, T item) noexcept;
231 void Notify(
std::condition_variable& consumer) noexcept;
297 bool Full(
int key) const noexcept;
311 bool EoF(
int key) const noexcept;
329 T
Front(
int key) const noexcept requires
Type::CopyConstructible<T>;
383 bool EoF() const noexcept;
400 class Implementation;
402 std::unique_ptr<Implementation> m_io;
406#include <StormByte/buffer/sink.txx>
One-key redirect: from.To(key) >> dest.
Definition sink.hxx:166
Sink & operator>>(Sink &dest) noexcept
Wire this key onto dest.
Set of Hopper buckets keyed by an integer.
Definition sink.hxx:79
Sink & operator>>(Sink &dest) noexcept
Share every existing hopper with dest.
StormByte::Size Buckets() const noexcept
Number of hoppers wired on this Sink.
Lane To(int key) noexcept
Redirect of one hopper key.
bool Contains(int key) const noexcept
Whether hopper key exists on this Sink.
void Unnotify() noexcept
Clears Notify on this Sink and on every hopper.
void Drain() noexcept
Marks Sink as a terminal producer (un-wired Push calls drop instead of waiting).
std::vector< int > Keys() const noexcept
Keys of hoppers currently wired on this Sink.
StormByte::Size Capacity(int key) const noexcept
Gets capacity ceiling of bucket key.
Sink() noexcept
Constructs an empty Sink with zero buckets.
T Front(int key) const noexcept
Copy of the next item in bucket key without dequeuing.
bool Full(int key) const noexcept
Checks if bucket key is full.
bool Draining() const noexcept
Checks whether Drain was called.
void Notify(std::condition_variable &consumer) noexcept
Registers consumer condition variable to notify on all current and future hoppers.
void Push(int key, T item) noexcept
Pushes an item into the bucket specified by key.
bool Empty(int key) const noexcept
Whether bucket key has no pending items.
Sink & operator<<(Sink &src) noexcept
Same as src >> *this (all hoppers).
bool EoF() const noexcept
Checks if the Sink is finished.
std::function< StormByte::Size(StormByte::Size)> Select
Index chooser for Pop selection across multiple buckets.
Definition sink.hxx:86
bool Ready() const noexcept
Checks whether a Pop call can return immediately (item available or EoF).
Sink & operator<<(Lane lane) noexcept
Same as lane >> *this.
void Eof() noexcept
Closes the Sink and releases writer holds on its hoppers.
T Pop() noexcept
Pops one item from the Sink using default round-robin order.
Buffer module of the StormByte suite.
Root namespace of the StormByte C++ suite.