3#include <StormByte/buffer/simple.hxx>
53 explicit
Shared(const std::
size_t& size);
60 Shared(const
char* data, const std::
size_t& length);
114 virtual ~
Shared() noexcept override = default;
152 Shared& operator<<(const std::
string& data);
177 template <typename NumericType, typename = std::enable_if_t<std::is_arithmetic_v<std::decay_t<NumericType>>>>
178 Shared& operator<<(const NumericType& value) {
179 std::unique_lock lock(m_data_mutex);
180 Simple::operator<<(value);
200 size_t Capacity() const noexcept override;
206 void Clear() noexcept override;
218 void Discard(const std::
size_t& length, const
Read::Position& mode) noexcept override;
224 bool End() const noexcept override;
230 bool Empty() const noexcept override;
262 virtual
bool HasEnoughData(const std::
size_t& length) override;
268 std::
string HexData(const std::
size_t& column_size = 16) const override;
274 bool IsEoF() const noexcept override;
282 bool IsReadable() const noexcept;
290 bool IsWritable() const noexcept;
308 std::
size_t Position() const noexcept override;
327 void Reserve(const std::
size_t& size) override;
333 void Seek(const std::ptrdiff_t& position, const
Read::Position& mode) const override;
339 std::
size_t Size() const noexcept override;
398 mutable std::shared_mutex m_data_mutex;
415 virtual
Read::
Status Wait(const std::
size_t& length) noexcept;
Exception class for buffer overflow errors.
Definition exception.hxx:48
A thread-safe version of the Simple buffer.
Definition shared.hxx:41
Shared & operator>>(Shared &buffer)
Appends current shared buffer to target shared buffer Thread-safe version of.
virtual size_t AvailableBytes() const noexcept
Gets the available bytes to read from current position.
Shared() noexcept
Default constructor Initializes an empty shared buffer.
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 read-related utilities in the StormByte library.
Namespace for buffer-related components in the StormByte library.
Definition consumer.hxx:19
Expected< Byte, T > ExpectedByte
Represents a single byte with error handling.
Definition typedefs.hxx:143
std::byte Byte
Represents a single byte of data.
Definition typedefs.hxx:138
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
Namespace for write-related utilities in the StormByte library.