Buffer that can be written and not read. More...
#include <StormByte/buffer/generic.hxx>


Public Member Functions | |
Lifecycle | |
| WriteOnly () noexcept | |
| Default constructor. | |
| WriteOnly (const WriteOnly &other)=default | |
| Copy constructor. | |
| WriteOnly (WriteOnly &&other) noexcept=default | |
| Move constructor. | |
| virtual | ~WriteOnly () noexcept |
| Destructor. | |
| WriteOnly & | operator= (const WriteOnly &other)=default |
| Copy assignment. | |
| WriteOnly & | operator= (WriteOnly &&other) noexcept=default |
| Move assignment. | |
Lifecycle of the store | |
| virtual bool | IsWritable () const noexcept=0 |
| Whether the buffer accepts writes. | |
| virtual void | Close () noexcept=0 |
| Stop further writes. | |
| virtual void | SetError () noexcept=0 |
| Permanent error. | |
Write | |
| virtual bool | Write (const StormByte::ByteSize &count, const BinaryData &data) noexcept=0 |
| Append bytes from a StormByte::BinaryData (copy). | |
| virtual bool | Write (const StormByte::ByteSize &count, BinaryData &&data) noexcept=0 |
| Append bytes from a StormByte::BinaryData (move). | |
| virtual bool | Write (const StormByte::ByteSize &count, const ReadOnly &data) noexcept=0 |
| Append bytes from a ReadOnly (copy). | |
| virtual bool | Write (const StormByte::ByteSize &count, ReadOnly &&data) noexcept=0 |
| Append bytes from a ReadOnly (extract). | |
Write (ReadOnly helpers) | |
| 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 (extract). | |
Write (string helpers) | |
| bool | Write (std::string_view sv) noexcept |
| Write a string view. | |
| bool | Write (const char *s) noexcept |
| Write a C string. | |
| bool | Write (const StormByte::ByteSize &count, std::string_view sv) noexcept |
Write up to count characters of a string view. | |
| bool | Write (const StormByte::ByteSize &count, const char *s) noexcept |
Write up to count characters of 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 helpers) | |
| template<Type::ByteInputRange R> | |
| bool | Write (const R &r) noexcept |
| Write all elements from an input range. | |
| template<Type::ByteInputRange Rw> | |
| bool | Write (const StormByte::ByteSize &count, const Rw &r) noexcept |
Write up to count elements from an input range. | |
| template<Type::ByteInputRange Rrw> | |
| bool | Write (const StormByte::ByteSize &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 StormByte::ByteSize &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 constructor. | |
| Generic (const Generic &other) noexcept=default | |
| Copy constructor. | |
| Generic (Generic &&other) noexcept=default | |
| Move constructor. | |
| virtual | ~Generic () noexcept=0 |
| Pure virtual destructor. | |
| Generic & | operator= (const Generic &other)=default |
| Copy assignment. | |
| Generic & | operator= (Generic &&other) noexcept=default |
| Move assignment. | |
| virtual StormByte::ByteSize | Size () const noexcept=0 |
| Total number of bytes stored. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from StormByte::Buffer::Generic | |
| template<Type::ByteInputRange Src> | |
| static BinaryData | DataConvert (const Src &src) noexcept |
| Convert an lvalue input range to StormByte::BinaryData. | |
| template<Type::ByteInputRange Src> | |
| static BinaryData | DataConvert (Src &&src) noexcept |
| Convert an rvalue input range to StormByte::BinaryData. | |
| static BinaryData | DataConvert (std::string_view sv) noexcept |
| Convert a string view to StormByte::BinaryData. | |
| static BinaryData | DataConvert (const char *s) noexcept |
| Convert a C string to StormByte::BinaryData. | |
Buffer that can be written and not read.
Close, error and Write. Occupancy is Generic::Size.
|
inlinenoexcept |
Default constructor.
|
default |
Copy constructor.
| other | Instance to copy. |
|
defaultnoexcept |
Move constructor.
| other | Instance to take from. |
|
virtualnoexcept |
Destructor.
|
pure virtualnoexcept |
Stop further writes.
Readers may still drain the store.
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. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, and StormByte::Buffer::SharedFIFO.
Copy assignment.
| other | Instance to copy. |
Move assignment.
| other | Instance to take from. |
|
pure virtualnoexcept |
Permanent error.
Wake waiters.
Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, and StormByte::Buffer::SharedFIFO.
|
inlinenoexcept |
Write a C string.
| s | Source. Null is an empty write. |
false if closed or in error.
|
inlinenoexcept |
Write a string literal without the trailing NUL.
| N | Array extent (includes the NUL of a literal). |
| s | Literal. |
false if closed or in error.
|
inlinenoexcept |
Write all elements from an input range.
| R | Range whose value_type converts to std::byte. |
| r | Source range. |
false if closed or in error.
|
inlinenoexcept |
Append all available bytes from a ReadOnly (copy).
| data | Source buffer. |
false if closed or in error.
|
pure virtualnoexcept |
Append bytes from a StormByte::BinaryData (move).
| count | Bytes to write. |
| data | Source. |
false if closed or in error. Implemented in StormByte::Buffer::Producer, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, and StormByte::Buffer::Ring.
|
pure virtualnoexcept |
Append bytes from a StormByte::BinaryData (copy).
| count | Bytes to write. |
| data | Source. |
false if closed or in error. Implemented in StormByte::Buffer::Producer, StormByte::Buffer::FIFO, StormByte::Buffer::Producer, StormByte::Buffer::Ring, StormByte::Buffer::FIFO, and StormByte::Buffer::Ring.
|
inlinenoexcept |
Write up to count characters of a C string.
| count | Maximum characters. 0 = entire string. |
| s | Source. May be null. |
false if closed or in error.
|
pure virtualnoexcept |
Append bytes from a ReadOnly (copy).
| count | Bytes to write. |
| data | Source buffer. |
false if closed or in 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. |
false if closed or in error.
|
inlinenoexcept |
Write up to count elements from an iterator pair.
| I2 | Input iterator. |
| S2 | Sentinel for I2. |
| count | Maximum elements. 0 = all. |
| first | Begin. |
| last | End. |
false if closed or in error.
|
pure virtualnoexcept |
Append bytes from a ReadOnly (extract).
| count | Bytes to write. |
| data | Source buffer. |
false if closed or in 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 rvalue range.
| Rrw | Range type. Moved when StormByte::BinaryData. |
| count | Maximum elements. 0 = entire range. |
| r | Source range. |
false if closed or in error.
|
inlinenoexcept |
Write up to count characters of a string view.
| count | Maximum characters. 0 = entire view. |
| sv | Source. |
false if closed or in error.
|
inlinenoexcept |
Write all elements from an iterator pair.
| I | Input iterator. |
| S | Sentinel for I. |
| first | Begin. |
| last | End. |
false if closed or in error.
|
inlinenoexcept |
Append all available bytes from a ReadOnly (extract).
| data | Source buffer. |
false if closed or in error.
|
inlinenoexcept |
Write all elements from an rvalue range.
| Rr | Range type. Moved when StormByte::BinaryData. |
| r | Source. |
false if closed or in error.
|
inlinenoexcept |
Write a string view.
No trailing NUL.
| sv | Source. |
false if closed or in error.