44#include <StormByte/type_traits/safe.hxx>
47#include <StormByte/safe/owner.hxx>
138 bool operator==(const
Producer& other) const noexcept;
145 inline
bool operator!=(const
Producer& other) const noexcept {
146 return !(*
this == other);
204 return Write(data.size(), data);
221 return Write(data.size(), std::move(data));
262 Ring& Storage() const noexcept;
Producer(Producer &&other) noexcept
Take a Producer.
Producer(const Producer &other)
Copy a Producer.
StormByte::ByteSize Size() const noexcept override
Bytes stored in the shared Ring.
~Producer() noexcept override
Destroy the Producer.
void Close() noexcept override
Close the shared Ring for further writes and notify waiters.
bool Write(const StormByte::ByteSize &count, const StormByte::Safe::Binary &data) noexcept override
Append bytes from owned storage (copy).
bool Write(const StormByte::ByteSize &count, const ReadOnly &data) noexcept override
Append bytes from a readable buffer (copy).
class Consumer Consumer()
Consumer that shares this Producer's Ring.
Producer(const Consumer &consumer)
Share the Ring of a Consumer.
bool Write(const StormByte::ByteSize &count, StormByte::Safe::Binary &&data) noexcept override
Append bytes from owned storage (move).
bool IsWritable() const noexcept override
Whether the shared Ring still accepts writes.
bool Write(const StormByte::ByteSize &count, ReadOnly &&data) noexcept override
Append bytes from a readable buffer (extract path).
bool Write(StormByte::Safe::Binary &&data) noexcept
Append an entire owned buffer (move).
Definition producer.hxx:220
Producer()
Create a Producer and a new shared Ring.
void SetError() noexcept override
Put the shared Ring in a permanent error state and notify waiters.
Buffer that can be read and not written.
Definition generic.hxx:220
Highly concurrent thread-safe ring buffer.
Definition ring.hxx:90
virtual bool Write(const StormByte::ByteSize &count, const Safe::Binary &data) noexcept=0
Append bytes from a StormByte::Safe::Binary (copy).
WriteOnly() noexcept
Default constructor.
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
Buffer module of the StormByte suite.
Root namespace of the StormByte C++ suite.
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54