3#include <StormByte/expected.hxx>
48 enum class Position:
unsigned short {
65 enum class Status:
unsigned short {
89 enum class Status:
unsigned short {
139 using Data = std::vector<Byte>;
173 template <
typename PtrType,
typename T,
174 typename = std::enable_if_t<
175 (std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> ||
176 std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>)
179 inline PtrType&
operator<<(PtrType& ptr,
const T& value) {
180 static_assert(std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> ||
181 std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>,
182 "PtrType must be a std::shared_ptr or std::unique_ptr");
203 template <
typename PtrType,
typename T,
204 typename = std::enable_if_t<
205 (std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> ||
206 std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>)
209 inline PtrType&
operator<<(PtrType& ptr, T&& value) {
210 static_assert(std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> ||
211 std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>,
212 "PtrType must be a std::shared_ptr or std::unique_ptr");
214 *ptr << std::move(value);
A read-only interface for accessing a shared buffer.
Definition consumer.hxx:37
A write-only interface for accessing a shared buffer.
Definition producer.hxx:43
A lightweight class for storing and manipulating simple byte buffers.
Definition simple.hxx:36
Namespace for read-related utilities in the StormByte library.
Namespace for buffer-related components in the StormByte library.
Definition consumer.hxx:19
std::span< const Byte > ConstByteSpan
Represents a constant span of bytes.
Definition typedefs.hxx:141
Expected< Byte, T > ExpectedByte
Represents a single byte with error handling.
Definition typedefs.hxx:143
std::function< std::shared_ptr< Simple >(const Simple &)> Processor
Represents a function that processes a buffer.
Definition typedefs.hxx:157
std::function< void(Consumer, Producer)> PipeFunction
Represents a function that processes a data pipe.
Definition typedefs.hxx:156
std::span< Byte > ByteSpan
Represents a span of bytes.
Definition typedefs.hxx:140
Expected< ByteSpan, T > ExpectedByteSpan
Represents a span of bytes with error handling.
Definition typedefs.hxx:147
std::byte Byte
Represents a single byte of data.
Definition typedefs.hxx:138
Expected< std::span< const Byte >, T > ExpectedConstByteSpan
Represents a constant span of bytes with error handling.
Definition typedefs.hxx:153
Expected< const Byte &, T > ExpectedConstByteRef
Represents a reference to a constant byte with error handling.
Definition typedefs.hxx:151
Expected< Byte &, T > ExpectedByteRef
Represents a reference to a single byte with error handling.
Definition typedefs.hxx:145
Expected< const Byte, T > ExpectedConstByte
Represents a constant byte with error handling.
Definition typedefs.hxx:149
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
@ ReadOnly
Indicates the buffer has closed its write end.
@ Error
Indicates the buffer has encountered an error.
@ Ready
Indicates the buffer is OK and ready for operations.
std::conditional_t< is_reference< T >::value, std::expected< std::reference_wrapper< std::remove_reference_t< T > >, std::shared_ptr< E > >, std::expected< T, std::shared_ptr< E > > > Expected
Expected type with support for reference types.
Definition expected.hxx:32
Namespace for write-related utilities in the StormByte library.