82 inline explicit Producer(std::shared_ptr<Ring> buffer) noexcept
83 : m_buffer(std::move(buffer)) {}
90 : m_buffer(consumer.m_buffer) {}
127 m_buffer = std::move(other.m_buffer);
146 return m_buffer.get() == other.m_buffer.get();
155 return !(*
this == other);
176 void SetError() noexcept override;
182 bool IsWritable() const noexcept override;
213 return Write(data.size(), data);
230 return Write(data.size(), std::move(data));
252 using WriteOnly::Write;
Read-oriented handle over a shared Ring.
Definition consumer.hxx:84
Write-only handle over a shared Ring.
Definition producer.hxx:66
Producer(std::shared_ptr< Ring > buffer) noexcept
Share an existing Ring.
Definition producer.hxx:82
Producer(Producer &&other) noexcept
Move constructor.
Definition producer.hxx:102
bool Write(BinaryData &&data) noexcept
Append an entire StormByte::BinaryData (move).
Definition producer.hxx:229
Producer() noexcept
Construct a Producer with a new shared Ring.
Definition producer.hxx:76
Producer(const Producer &other) noexcept
Copy constructor.
Definition producer.hxx:96
~Producer() noexcept override
Destructor.
void Close() noexcept override
Close the shared Ring for further writes.
bool operator!=(const Producer &other) const noexcept
Inequality.
Definition producer.hxx:154
bool operator==(const Producer &other) const noexcept
Equality.
Definition producer.hxx:145
bool Write(const StormByte::ByteSize &count, const ReadOnly &data) noexcept override
Append bytes from a ReadOnly (copy).
Producer & operator=(Producer &&other) noexcept
Move assignment.
Definition producer.hxx:125
bool Write(const StormByte::ByteSize &count, ReadOnly &&data) noexcept override
Append bytes from a ReadOnly (extract).
bool Write(const StormByte::ByteSize &count, BinaryData &&data) noexcept override
Append bytes from a StormByte::BinaryData (move).
std::shared_ptr< Ring > m_buffer
Shared ring. Not null after construction.
Definition producer.hxx:267
Producer(const Consumer &consumer) noexcept
Share the Ring of a Consumer.
Definition producer.hxx:89
Buffer that can be read and not written.
Definition generic.hxx:228
High-performance, highly-concurrent thread-safe ring buffer.
Definition ring.hxx:83
Buffer that can be written and not read.
Definition generic.hxx:505
Root namespace of the StormByte C++ suite.
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54