57 inline explicit Producer(std::shared_ptr<Ring> buffer) noexcept
58 : m_buffer(std::move(buffer)) {}
65 : m_buffer(consumer.m_buffer) {}
88 if (
this != &other) m_buffer = other.
m_buffer;
98 if (
this != &other) m_buffer = std::move(other.m_buffer);
115 return m_buffer.get() == other.m_buffer.get();
124 return !(*
this == other);
145 void SetError() noexcept override;
151 bool IsWritable() const noexcept override;
166 bool Write(const std::
size_t& count, const
DataType& data) noexcept override;
174 return Write(data.size(), data);
191 return Write(data.size(), std::move(data));
200 bool Write(
const std::size_t& count,
const ReadOnly& data)
noexcept override;
211 using WriteOnly::Write;
Read-oriented handle over a shared Ring.
Definition consumer.hxx:53
Write-only handle over a shared Ring.
Definition producer.hxx:41
Producer(std::shared_ptr< Ring > buffer) noexcept
Construct a Producer that shares an existing Ring.
Definition producer.hxx:57
Producer(Producer &&other) noexcept
Move construct.
Definition producer.hxx:77
bool Write(const std::size_t &count, ReadOnly &&data) noexcept override
Append bytes from a ReadOnly (move / extract path).
Producer() noexcept
Construct a Producer with a fresh shared Ring.
Definition producer.hxx:51
Producer(const Producer &other) noexcept
Copy construct (shares the same Ring).
Definition producer.hxx:71
~Producer() noexcept override
Destructor.
void Close() noexcept override
Close the shared Ring for further writes.
bool operator!=(const Producer &other) const noexcept
Inequality comparison.
Definition producer.hxx:123
bool operator==(const Producer &other) const noexcept
Equality comparison.
Definition producer.hxx:114
bool Write(const std::size_t &count, const ReadOnly &data) noexcept override
Append bytes from a ReadOnly (copy path).
Producer & operator=(Producer &&other) noexcept
Move assignment.
Definition producer.hxx:97
bool Write(DataType &&data) noexcept
Append an entire DataType (move path).
Definition producer.hxx:190
std::shared_ptr< Ring > m_buffer
Shared ring storage.
Definition producer.hxx:231
Producer(const Consumer &consumer) noexcept
Construct a Producer that shares the Ring of a Consumer.
Definition producer.hxx:64
bool Write(const std::size_t &count, DataType &&data) noexcept override
Append bytes from a DataType (move path).
Pure interface for a buffer that can be read but not written.
Definition generic.hxx:164
High-performance, highly-concurrent thread-safe ring buffer.
Definition ring.hxx:62
Pure interface for a buffer that can be written but not read.
Definition generic.hxx:420
Buffer module of the StormByte suite.
std::vector< std::byte > DataType
Primary byte storage type used throughout the buffer API.
Definition typedefs.hxx:62
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:28