|
StormByte C++ Library: Buffer module 1.2.0
StormByte-Buffer is the buffer module of the StormByte C++ suite.
|
Pure interface for a buffer that can be written but not read. More...
#include <StormByte/buffer/generic.hxx>


Public Member Functions | |
Constructors / destructor / assignment | |
| WriteOnly () noexcept | |
| Default construct. | |
| WriteOnly (const WriteOnly &)=default | |
| Copy construct. | |
| WriteOnly (WriteOnly &&) noexcept=default | |
| Move construct. | |
| virtual | ~WriteOnly () noexcept |
| Virtual destructor. | |
| WriteOnly & | operator= (const WriteOnly &)=default |
| Copy assign. | |
| WriteOnly & | operator= (WriteOnly &&) noexcept=default |
| Move assign. | |
Lifecycle / queries | |
| virtual bool | IsWritable () const noexcept=0 |
| Whether the buffer accepts writes. | |
| virtual void | Close () noexcept=0 |
| Mark the buffer closed for further writes. | |
| virtual void | SetError () noexcept=0 |
| Enter a permanent error state (unreadable and unwritable). | |
Write (canonical pure virtuals) | |
| virtual bool | Write (const std::size_t &count, const DataType &data) noexcept=0 |
| Append bytes from a DataType (copy). | |
| virtual bool | Write (const std::size_t &count, DataType &&data) noexcept=0 |
| Append bytes from a DataType (move). | |
| virtual bool | Write (const std::size_t &count, const ReadOnly &data) noexcept=0 |
| Append bytes from a ReadOnly (copy path). | |
| virtual bool | Write (const std::size_t &count, ReadOnly &&data) noexcept=0 |
| Append bytes from a ReadOnly (move / extract path). | |
Write (ReadOnly conveniences) | |
| bool | Write (const ReadOnly &data) noexcept |
| Append all available bytes from a ReadOnly (copy). | |
| bool | Write (ReadOnly &&data) noexcept |
| Append all available bytes from a ReadOnly (move path). | |
Write (string conveniences) | |
Stable overloads so string / C-string calls do not hit range templates. String literals exclude the trailing NUL. | |
| bool | Write (std::string_view sv) noexcept |
| Write a string view (no trailing NUL). | |
| bool | Write (const char *s) noexcept |
| Write a null-terminated C string. | |
| bool | Write (const std::size_t &count, std::string_view sv) noexcept |
Write up to count characters from a string view. | |
| bool | Write (const std::size_t &count, const char *s) noexcept |
Write up to count characters from a C string. | |
| template<std::size_t N> | |
| bool | Write (const char(&s)[N]) noexcept |
| Write a string literal without the trailing NUL. | |
Write (range / iterator conveniences) | |
| template<Type::ByteInputRange R> | |
| bool | Write (const R &r) noexcept |
| Write all elements from an input range. | |
| template<Type::ByteInputRange Rw> | |
| bool | Write (const std::size_t &count, const Rw &r) noexcept |
Write up to count elements from an input range. | |
| template<Type::ByteInputRange Rrw> | |
| bool | Write (const std::size_t &count, Rrw &&r) noexcept |
Write up to count elements from an rvalue range. | |
| template<Type::ByteInputRange Rr> | |
| bool | Write (Rr &&r) noexcept |
| Write all elements from an rvalue range. | |
| template<Type::ByteInputIterator I, typename S > requires Type::SentinelFor<S, I> | |
| bool | Write (I first, S last) noexcept |
| Write all elements from an iterator pair. | |
| template<Type::ByteInputIterator I2, typename S2 > requires Type::SentinelFor<S2, I2> | |
| bool | Write (const std::size_t &count, I2 first, S2 last) noexcept |
Write up to count elements from an iterator pair. | |
Public Member Functions inherited from StormByte::Buffer::Generic | |
| Generic () noexcept=default | |
| Default construct. | |
| Generic (const Generic &) noexcept=default | |
| Copy construct. | |
| Generic (Generic &&) noexcept=default | |
| Move construct. | |
| virtual | ~Generic () noexcept=0 |
| Pure virtual destructor (keeps the class abstract). | |
| Generic & | operator= (const Generic &other)=default |
| Copy assign. | |
| Generic & | operator= (Generic &&) noexcept=default |
| Move assign. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from StormByte::Buffer::Generic | |
| template<Type::ByteInputRange Src> | |
| static DataType | DataConvert (const Src &src) noexcept |
| Convert an lvalue input range to DataType. | |
| template<Type::ByteInputRange Src> | |
| static DataType | DataConvert (Src &&src) noexcept |
| Convert an rvalue input range to DataType (moves when already DataType). | |
| static DataType | DataConvert (std::string_view sv) noexcept |
| Convert a string view to DataType (no trailing NUL). | |
| static DataType | DataConvert (const char *s) noexcept |
| Convert a null-terminated C string to DataType. | |
Pure interface for a buffer that can be written but not read.
Declares lifecycle (Close / SetError), writability, and the canonical Write overloads. Convenience overloads for strings, ranges and iterators are implemented inline in terms of those.
|
inlinenoexcept |
Default construct.
|
default |
Copy construct.
|
defaultnoexcept |
Move construct.
|
virtualnoexcept |
Virtual destructor.
|
pure virtualnoexcept |
Mark the buffer closed for further writes.
Subsequent Write() calls must fail. Readers may still drain data. Thread-safe implementations should wake blocked waiters.
Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, and StormByte::Buffer::SharedFIFO.
|
pure virtualnoexcept |
Whether the buffer accepts writes.
false if closed or in error state. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, and StormByte::Buffer::SharedFIFO.
|
pure virtualnoexcept |
Enter a permanent error state (unreadable and unwritable).
Implementations should wake any blocked waiters.
Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, and StormByte::Buffer::SharedFIFO.
|
inlinenoexcept |
Write a null-terminated C string.
| s | Source (may be null → empty write). |
true on success, false if closed / error.
|
inlinenoexcept |
Write a string literal without the trailing NUL.
| N | Array extent (includes NUL for literals). |
| s | Literal / char array. |
true on success, false if closed / error.
|
inlinenoexcept |
Write all elements from an input range.
| R | Range whose value_type is convertible to std::byte. |
| r | Source range. |
true on success, false if closed / error.
|
inlinenoexcept |
Append all available bytes from a ReadOnly (copy).
| data | Source buffer. |
true on success, false if closed / error.
|
inlinenoexcept |
Write up to count characters from a C string.
| count | Maximum characters (0 = entire string). |
| s | Source (may be null). |
true on success, false if closed / error.
|
pure virtualnoexcept |
Append bytes from a DataType (copy).
| count | Number of bytes to write. |
| data | Source vector. |
true on success, false if closed / error. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, and StormByte::Buffer::Ring.
|
pure virtualnoexcept |
Append bytes from a ReadOnly (copy path).
| count | Number of bytes to write. |
| data | Source buffer. |
true on success, false if closed / error. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, and StormByte::Buffer::Ring.
|
inlinenoexcept |
Write up to count elements from an input range.
| Rw | Range type. |
| count | Maximum elements (0 = entire range). |
| r | Source range. |
true on success, false if closed / error.
|
pure virtualnoexcept |
Append bytes from a DataType (move).
| count | Number of bytes to write. |
| data | Source vector. |
true on success, false if closed / error. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, and StormByte::Buffer::Ring.
|
inlinenoexcept |
Write up to count elements from an iterator pair.
| I2 | Input iterator. |
| S2 | Sentinel for I2. |
| count | Maximum elements (0 = all). |
| first | Begin iterator. |
| last | End sentinel. |
true on success, false if closed / error.
|
pure virtualnoexcept |
Append bytes from a ReadOnly (move / extract path).
| count | Number of bytes to write. |
| data | Source buffer. |
true on success, false if closed / error. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, and StormByte::Buffer::Ring.
|
inlinenoexcept |
|
inlinenoexcept |
Write up to count characters from a string view.
| count | Maximum characters (0 = entire view). |
| sv | Source characters. |
true on success, false if closed / error.
|
inlinenoexcept |
Write all elements from an iterator pair.
| I | Input iterator. |
| S | Sentinel for I. |
| first | Begin iterator. |
| last | End sentinel. |
true on success, false if closed / error.
|
inlinenoexcept |
Append all available bytes from a ReadOnly (move path).
| data | Source buffer. |
true on success, false if closed / error.
|
inlinenoexcept |
Write all elements from an rvalue range.
| Rr | Range type. |
| r | Source (moved when DataType). |
true on success, false if closed / error.
|
inlinenoexcept |
Write a string view (no trailing NUL).
| sv | Source characters. |
true on success, false if closed / error.