3#include <StormByte/buffer/reader.hxx>
4#include <StormByte/buffer/shared.hxx>
178 template <typename NumericType, typename = std::enable_if_t<std::is_arithmetic_v<std::decay_t<NumericType>>>>
180 Shared::operator<<(value);
239 std::shared_ptr<class Reader> m_external_reader;
248 Read::Status Wait(
const std::size_t& length)
noexcept override;
258 bool ReadExternalData(
const size_t& bytes)
noexcept;
A specialized buffer that extends the functionality of the Shared buffer by integrating an external R...
Definition external.hxx:48
External(Reader &&reader) noexcept
Constructs an External buffer taking ownership of a specified Reader instance.
External & operator>>(External &buffer)
Appends the current buffer's data to another buffer.
void Reader(const class Reader &reader) noexcept
Sets the external Reader instance.
~External() noexcept override=default
Destructor. Cleans up the buffer and releases any associated resources.
External(const External &other)=default
Copy constructor.
External(External &&other) noexcept=default
Move constructor.
bool HasEnoughData(const std::size_t &length) override
Checks if the buffer has enough data to satisfy a read request.
External(const Reader &reader) noexcept
Constructs an External buffer with a specified Reader instance.
void Reader(class Reader &&reader) noexcept
Sets the external Reader instance taking ownership of it.
ExpectedData< BufferOverflow > Read(const size_t &length) const override
Reads a specific size of data from the buffer.
Abstract base class for implementing external data readers.
Definition reader.hxx:37
A thread-safe version of the Simple buffer.
Definition shared.hxx:41
A lightweight class for storing and manipulating simple byte buffers.
Definition simple.hxx:36
Namespace for buffer-related components in the StormByte library.
Namespace for buffer-related components in the StormByte library.
Definition consumer.hxx:19
Expected< Data, T > ExpectedData
Represents a collection of bytes with error handling.
Definition typedefs.hxx:155
std::vector< Byte > Data
Represents collection of bytes stored in the buffer.
Definition typedefs.hxx:139
Status
Defines the status of the buffer during producer/consumer operations.
Definition typedefs.hxx:106