125 m_buffer = other.m_buffer;
136 m_buffer = std::move(other.m_buffer);
153 return m_buffer.get() == other.m_buffer.get();
162 return !(*
this == other);
191 bool Empty() const noexcept override;
197 bool EoF() const noexcept override;
203 bool IsReadable() const noexcept override;
211 inline
bool IsWritable() const noexcept {
212 return m_buffer->IsWritable();
220 return m_buffer->HasError();
248 void Clean() noexcept override;
254 void Clear() noexcept override;
261 inline
void Close() noexcept {
277 void Seek(
const std::ptrdiff_t& offset,
const Position& mode)
const noexcept override;
375 std::shared_ptr<Ring> m_buffer;
383 inline explicit Consumer(std::shared_ptr<Ring> buffer) noexcept
384 : m_buffer(std::move(buffer)) {}
Read-oriented handle over a shared Ring.
Definition consumer.hxx:84
bool Read(const StormByte::ByteSize &count, StormByte::BinaryData &out) const noexcept override
Read bytes into a StormByte::BinaryData.
Consumer() noexcept
Empty Consumer.
Definition consumer.hxx:99
bool Drop(const StormByte::ByteSize &count) noexcept override
Discard count bytes from the current read position.
Consumer & operator=(Consumer &&other) noexcept
Move assignment.
Definition consumer.hxx:134
Consumer(const Consumer &other) noexcept
Copy constructor.
Definition consumer.hxx:105
bool operator!=(const Consumer &other) const noexcept
Inequality comparison.
Definition consumer.hxx:161
void ReadUntilEoF(WriteOnly &out) const noexcept override
Read until EoF into a WriteOnly store.
~Consumer() noexcept override
Destructor.
bool Peek(const StormByte::ByteSize &count, StormByte::BinaryData &out) const noexcept override
Peek bytes into a StormByte::BinaryData.
bool HasError() const noexcept
Whether the shared Ring is in a permanent error state.
Definition consumer.hxx:219
StormByte::ByteSize Size() const noexcept override
Total number of bytes stored in the shared Ring.
void ReadUntilEoF(StormByte::BinaryData &out) const noexcept override
Read until EoF into a StormByte::BinaryData.
void ExtractUntilEoF(WriteOnly &out) noexcept override
Extract until EoF into a WriteOnly store.
void Seek(const std::ptrdiff_t &offset, const Position &mode) const noexcept override
Move the logical read position for non-destructive reads.
bool Extract(const StormByte::ByteSize &count, StormByte::BinaryData &out) noexcept override
Extract bytes into a StormByte::BinaryData (consumes data from the Ring).
bool operator==(const Consumer &other) const noexcept
Equality comparison.
Definition consumer.hxx:152
bool Extract(const StormByte::ByteSize &count, WriteOnly &out) noexcept override
Extract bytes into a WriteOnly store.
StormByte::ByteSize Available() const noexcept override
Number of bytes available for reading from the current position.
void ExtractUntilEoF(StormByte::BinaryData &out) noexcept override
Extract until EoF into a StormByte::BinaryData.
Consumer(Consumer &&other) noexcept
Move constructor.
Definition consumer.hxx:111
bool Read(const StormByte::ByteSize &count, WriteOnly &out) const noexcept override
Read bytes into a WriteOnly store.
bool Peek(const StormByte::ByteSize &count, WriteOnly &out) const noexcept override
Peek bytes into a WriteOnly store.
Write-only handle over a shared Ring.
Definition producer.hxx:66
void Close() noexcept override
Close the shared Ring for further writes.
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
Position
Forward declaration of the WriteOnly interface.
Definition typedefs.hxx:73
Root namespace of the StormByte C++ suite.
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54