|
using | Byte = std::byte |
| Represents a single byte of data.
|
|
using | Data = std::vector< Byte > |
| Represents collection of bytes stored in the buffer.
|
|
using | ByteSpan = std::span< Byte > |
| Represents a span of bytes.
|
|
using | ConstByteSpan = std::span< const Byte > |
| Represents a constant span of bytes.
|
|
template<class T > |
using | ExpectedByte = Expected< Byte, T > |
| Represents a single byte with error handling.
|
|
template<class T > |
using | ExpectedByteRef = Expected< Byte &, T > |
| Represents a reference to a single byte with error handling.
|
|
template<class T > |
using | ExpectedByteSpan = Expected< ByteSpan, T > |
| Represents a span of bytes with error handling.
|
|
template<class T > |
using | ExpectedConstByte = Expected< const Byte, T > |
| Represents a constant byte with error handling.
|
|
template<class T > |
using | ExpectedConstByteRef = Expected< const Byte &, T > |
| Represents a reference to a constant byte with error handling.
|
|
template<class T > |
using | ExpectedConstByteSpan = Expected< std::span< const Byte >, T > |
| Represents a constant span of bytes with error handling.
|
|
template<class T > |
using | ExpectedData = Expected< Data, T > |
| Represents a collection of bytes with error handling.
|
|
using | PipeFunction = std::function< void(Consumer, Producer)> |
| Represents a function that processes a data pipe.
|
|
using | Processor = std::function< std::shared_ptr< Simple >(const Simple &)> |
| Represents a function that processes a buffer.
|
|
|
template<typename PtrType , typename T , typename = std::enable_if_t< (std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> || std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>) >> |
PtrType & | operator<< (PtrType &ptr, const T &value) |
| Wrapper for operator<< to support std::shared_ptr or std::unique_ptr as the left-hand parameter.
|
|
template<typename PtrType , typename T , typename = std::enable_if_t< (std::is_same_v<PtrType, std::shared_ptr<typename PtrType::element_type>> || std::is_same_v<PtrType, std::unique_ptr<typename PtrType::element_type>>) >> |
PtrType & | operator<< (PtrType &ptr, T &&value) |
| Wrapper for operator<< to support std::shared_ptr or std::unique_ptr as the left-hand parameter (move version).
|
|
Namespace for buffer-related components in the StormByte library.
The Buffer
namespace provides classes and utilities for managing various types of buffers in both single-threaded and multi-threaded environments. It supports a variety of use cases, including:
- Simple Buffer: Lightweight, non-thread-safe buffers for single-threaded environments.
- Shared Buffer: Flexible and efficient storage for byte data with concurrent access support.
- External Buffer: An extension of the
Shared
buffer that allows an external reader function to be executed before every read operation.
- Producer/Consumer Buffer: Advanced models for managing data flow between producers and consumers with status tracking (e.g.,
Ready
, EoF
, Error
).
- Thread Safety: Shared and producer/consumer buffers are designed to ensure consistent behavior in multi-threaded environments.