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) noexcept | |
| Copy constructor. | |
| WriteOnly (WriteOnly &&other) noexcept | |
| Move constructor. | |
| virtual | ~WriteOnly () noexcept |
| Destructor. | |
| WriteOnly & | operator= (const WriteOnly &other) noexcept |
| Copy assignment. | |
| WriteOnly & | operator= (WriteOnly &&other) noexcept |
| 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 Safe::Binary &data) noexcept=0 |
| Append bytes from a StormByte::Safe::Binary (copy). | |
| virtual bool | Write (const StormByte::ByteSize &count, Safe::Binary &&data) noexcept=0 |
| Append bytes from a StormByte::Safe::Binary (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> | |
| STORMBYTE_FORCE_INLINE bool | Write (const R &r) noexcept |
| Write all elements from an input range. | |
| template<Type::ByteInputRange Rw> | |
| STORMBYTE_FORCE_INLINE bool | Write (const StormByte::ByteSize &count, const Rw &r) noexcept |
Write up to count elements from an input range. | |
| template<Type::ByteInputRange Rrw> | |
| STORMBYTE_FORCE_INLINE bool | Write (const StormByte::ByteSize &count, Rrw &&r) noexcept |
Write up to count elements from an rvalue range. | |
| template<Type::ByteInputRange Rr> | |
| STORMBYTE_FORCE_INLINE bool | Write (Rr &&r) noexcept |
| Write all elements from an rvalue range. | |
| template<Type::ByteInputIterator I, typename S> requires Type::SentinelFor<S, I> | |
| STORMBYTE_FORCE_INLINE 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> | |
| STORMBYTE_FORCE_INLINE 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 constructor. | |
| Generic (const Generic &other) noexcept | |
| Copy constructor. | |
| Generic (Generic &&other) noexcept | |
| Move constructor. | |
| virtual | ~Generic () noexcept=0 |
| Pure virtual destructor. | |
| Generic & | operator= (const Generic &other) noexcept |
| Copy assignment. | |
| Generic & | operator= (Generic &&other) noexcept |
| 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 STORMBYTE_FORCE_INLINE Safe::Binary | DataConvert (const Src &src) noexcept |
| Convert an lvalue input range to StormByte::Safe::Binary. | |
| template<Type::ByteInputRange Src> | |
| static STORMBYTE_FORCE_INLINE Safe::Binary | DataConvert (Src &&src) noexcept |
| Convert an rvalue input range to StormByte::Safe::Binary. | |
| static Safe::Binary | DataConvert (std::string_view sv) noexcept |
| Convert a string view to StormByte::Safe::Binary. | |
| static Safe::Binary | DataConvert (const char *s) noexcept |
| Convert a C string to StormByte::Safe::Binary. | |
Buffer that can be written and not read.
Close, error and Write. Occupancy is Generic::Size.
|
noexcept |
Default constructor.
|
noexcept |
Copy constructor.
| other | Instance to copy. |
|
noexcept |
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.
|
noexcept |
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.
|
noexcept |
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, 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.
|
pure virtualnoexcept |
Append bytes from a StormByte::Safe::Binary (copy).
| count | Bytes to write. |
| data | Source. |
false if closed or in error. Implemented in 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. |
| 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, and StormByte::Buffer::Ring.
|
inlinenoexcept |
Write up to count elements from an rvalue range.
| Rrw | Range type. Moved when StormByte::Safe::Binary. |
| count | Maximum elements. 0 = entire range. |
| r | Source range. |
false if closed or in error.
|
pure virtualnoexcept |
Append bytes from a StormByte::Safe::Binary (move).
| count | Bytes to write. |
| data | Source. |
false if closed or in error. Implemented in StormByte::Buffer::FIFO, StormByte::Buffer::Producer, and StormByte::Buffer::Ring.
|
noexcept |
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::Safe::Binary. |
| r | Source. |
false if closed or in error.
|
noexcept |
Write a string view.
No trailing NUL.
| sv | Source. |
false if closed or in error.