85 std::size_t chunk_size = 4096) noexcept
87 , m_read_handler(in.Clone())
88 , m_write_handler(out.Clone())
89 , m_chunk_size(chunk_size)
100 std::size_t chunk_size = 4096) noexcept
102 , m_read_handler(in.Move())
103 , m_write_handler(out.Move())
104 , m_chunk_size(chunk_size)
146 inline std::
size_t ChunkSize() const noexcept {
155 return m_buffer.Size();
162 inline bool EoF() const noexcept {
163 return m_read_handler->EoF();
171 return m_read_handler->IsReadable();
179 return m_write_handler->IsWritable();
202 bool FlushAndClose() const noexcept;
209 void SetError() const noexcept;
228 bool Passthrough(std::
size_t bytes) const noexcept;
239 bool Passthrough(std::
size_t bytes) noexcept;
244 mutable
FIFO m_buffer;
247 std::
size_t m_chunk_size;
257 bool PassthroughWrite(
DataType&& data) const noexcept;
Pass-through adapter that forwards bytes from an ExternalReader to an ExternalWriter in fixed-size ch...
Definition bridge.hxx:68
bool Flush() const noexcept
Flush any pending bytes to the writer.
bool IsWritable() const noexcept
Check whether the sink still accepts writes.
Definition bridge.hxx:178
Bridge & operator=(Bridge &&) noexcept=default
Move assignment.
bool EoF() const noexcept
Check whether the source has reached end-of-stream.
Definition bridge.hxx:162
Bridge(ExternalReader &&in, ExternalWriter &&out, std::size_t chunk_size=4096) noexcept
Construct a Bridge by moving the supplied handlers.
Definition bridge.hxx:98
Bridge(const Bridge &)=delete
Copy constructor (deleted – Bridge is non-copyable).
std::size_t PendingBytes() const noexcept
Number of bytes currently waiting in the internal buffer.
Definition bridge.hxx:154
bool IsReadable() const noexcept
Check whether the source is still readable.
Definition bridge.hxx:170
Bridge(const ExternalReader &in, const ExternalWriter &out, std::size_t chunk_size=4096) noexcept
Construct a Bridge by cloning the supplied handlers.
Definition bridge.hxx:83
Bridge(Bridge &&) noexcept=default
Move constructor.
Bridge & operator=(const Bridge &)=delete
Copy assignment (deleted – Bridge is non-copyable).
Abstract interface for reading data from an external or internal source.
Definition external.hxx:55
Abstract interface for writing data to an external or internal sink.
Definition external.hxx:284
Byte-oriented FIFO buffer with grow-on-demand and close/error support.
Definition fifo.hxx:58
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