|
| | SharedFIFO () noexcept |
| | Default construct an empty SharedFIFO.
|
| | SharedFIFO (const StormByte::Safe::Binary &data) |
| | Construct with initial data (copy).
|
| | SharedFIFO (StormByte::Safe::Binary &&data) noexcept |
| | Construct with initial data (move).
|
template<StormByte::Type::ByteInputRange R>
requires (!StormByte::Type::SameAs<R, StormByte::Safe::Binary>) |
| STORMBYTE_FORCE_INLINE | SharedFIFO (const R &r) noexcept |
| | Construct from an input range.
|
| template<StormByte::Type::ByteInputRange Rr> |
| STORMBYTE_FORCE_INLINE | SharedFIFO (Rr &&r) noexcept |
| | Construct from an rvalue range.
|
| | SharedFIFO (std::string_view sv) noexcept |
| | Construct from a string view.
|
| | SharedFIFO (const char *s) noexcept |
| | Construct from a C string.
|
| | SharedFIFO (const FIFO &other) |
| | Construct by copying a plain FIFO.
|
| | SharedFIFO (FIFO &&other) noexcept |
| | Construct by moving a plain FIFO.
|
| | SharedFIFO (const SharedFIFO &)=delete |
| | Copy constructor.
|
| | SharedFIFO (SharedFIFO &&)=delete |
| | Move constructor.
|
| virtual | ~SharedFIFO () noexcept |
| | Destroy the SharedFIFO.
|
| SharedFIFO & | operator= (const FIFO &other) |
| | Copy-assign from a plain FIFO.
|
| SharedFIFO & | operator= (FIFO &&other) noexcept |
| | Move-assign from a plain FIFO.
|
| SharedFIFO & | operator= (const SharedFIFO &)=delete |
| | Copy assignment.
|
| SharedFIFO & | operator= (SharedFIFO &&)=delete |
| | Move assignment.
|
| bool | operator== (const SharedFIFO &other) const noexcept |
| | Compare two SharedFIFOs.
|
| bool | operator!= (const SharedFIFO &other) const noexcept |
| | Compare two SharedFIFOs.
|
| virtual StormByte::ByteSize | Available () const noexcept override |
| | Bytes available from the current read position.
|
| virtual const StormByte::Safe::Binary & | Data () const noexcept override |
| | Access the internal storage.
|
| virtual bool | Empty () const noexcept override |
| | Whether the underlying storage is empty.
|
| virtual bool | EoF () const noexcept override |
| | End-of-stream condition.
|
| bool | HasError () const noexcept |
| | Whether the buffer is in a permanent error state.
|
| virtual bool | IsReadable () const noexcept override |
| | Whether the buffer can still be read.
|
| virtual bool | IsWritable () const noexcept override |
| | Whether the buffer accepts writes.
|
| virtual StormByte::ByteSize | Size () const noexcept override |
| | Total number of bytes stored.
|
| void | Clean () noexcept override |
| | Discard data from the start up to the read position.
|
| virtual void | Clear () noexcept override |
| | Clear stored bytes.
|
| virtual void | Close () noexcept override |
| | Close for further writes and notify waiters.
|
| virtual bool | Drop (const StormByte::ByteSize &count) noexcept override |
| | Discard unread bytes and notify waiters.
|
| virtual void | Seek (const std::ptrdiff_t &offset, const Position &mode) const noexcept override |
| | Move the logical read position and notify waiters.
|
| virtual void | SetError () noexcept override |
| | Enter the permanent error state and notify waiters.
|
| virtual StormByte::Safe::String | HexDump (const StormByte::ByteSize &columns=0, const StormByte::ByteSize &byte_limit=0) const noexcept override |
| | Hexdump of unread contents.
|
| | FIFO () noexcept=default |
| | Default construct an empty FIFO.
|
| | FIFO (const StormByte::Safe::Binary &data) noexcept |
| | Construct a FIFO with initial data (copy).
|
| | FIFO (StormByte::Safe::Binary &&data) noexcept |
| | Construct a FIFO with initial data (move).
|
template<Type::ByteInputRange R>
requires (!Type::SameAs<R, StormByte::Safe::Binary>) |
| | FIFO (const R &r) noexcept |
| | Construct a FIFO from an input range.
|
| template<Type::ByteInputRange Rr> |
| | FIFO (Rr &&r) noexcept |
| | Construct a FIFO from an rvalue range.
|
| | FIFO (std::string_view sv) noexcept |
| | Construct a FIFO from a string view.
|
| | FIFO (const char *s) noexcept |
| | Construct a FIFO from a C string.
|
| | FIFO (const FIFO &other) noexcept |
| | Copy a FIFO, including contents and state.
|
| | FIFO (FIFO &&other) noexcept |
| | Take a FIFO.
|
| virtual | ~FIFO () noexcept |
| | Destroy the FIFO.
|
| FIFO & | operator= (const FIFO &other) |
| | Copy-assign a FIFO, including contents and state.
|
| FIFO & | operator= (FIFO &&other) noexcept |
| | Move-assign a FIFO.
|
| bool | operator== (const FIFO &other) const noexcept |
| | Compare two FIFOs.
|
| bool | operator!= (const FIFO &other) const noexcept |
| | Compare two FIFOs.
|
| bool | Extract (const StormByte::ByteSize &count, StormByte::Safe::Binary &outBuffer) noexcept override |
| | Extract bytes into owned storage.
|
| bool | Extract (const StormByte::ByteSize &count, WriteOnly &outBuffer) noexcept override |
| | Extract bytes into a writer.
|
| void | ExtractUntilEoF (StormByte::Safe::Binary &outBuffer) noexcept override |
| | Extract until EoF into owned storage.
|
| void | ExtractUntilEoF (WriteOnly &outBuffer) noexcept override |
| | Extract until EoF into a writer.
|
| bool | Extract (StormByte::Safe::Binary &outBuffer) noexcept |
| | Bring the ReadOnly convenience Extract overloads into scope.
|
| bool | Extract (WriteOnly &outBuffer) noexcept |
| | Bring the ReadOnly convenience Extract overloads into scope.
|
| bool | Read (const StormByte::ByteSize &count, StormByte::Safe::Binary &outBuffer) const noexcept override |
| | Read into owned storage and advance the position.
|
| bool | Read (const StormByte::ByteSize &count, WriteOnly &outBuffer) const noexcept override |
| | Read into a writer and advance the position.
|
| void | ReadUntilEoF (StormByte::Safe::Binary &outBuffer) const noexcept override |
| | Read until EoF into owned storage.
|
| void | ReadUntilEoF (WriteOnly &outBuffer) const noexcept override |
| | Read until EoF into a writer.
|
| bool | Read (StormByte::Safe::Binary &outBuffer) const noexcept |
| | Bring the ReadOnly convenience Read overloads into scope.
|
| bool | Read (WriteOnly &outBuffer) const noexcept |
| | Bring the ReadOnly convenience Read overloads into scope.
|
| bool | Peek (const StormByte::ByteSize &count, StormByte::Safe::Binary &outBuffer) const noexcept override |
| | Peek into owned storage without advancing the position.
|
| bool | Peek (const StormByte::ByteSize &count, WriteOnly &outBuffer) const noexcept override |
| | Peek into a writer without advancing the position.
|
| bool | Write (const StormByte::ByteSize &count, const StormByte::Safe::Binary &data) noexcept override |
| | Append bytes from owned storage (copy).
|
| bool | Write (const StormByte::ByteSize &count, StormByte::Safe::Binary &&data) noexcept override |
| | Append bytes from owned storage (move).
|
| bool | Write (const StormByte::ByteSize &count, const ReadOnly &data) noexcept override |
| | Append bytes from a readable buffer (copy).
|
| bool | Write (const StormByte::ByteSize &count, ReadOnly &&data) noexcept override |
| | Append bytes from a readable buffer (extract path).
|
| bool | Write (const ReadOnly &data) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| bool | Write (ReadOnly &&data) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| bool | Write (std::string_view sv) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| bool | Write (const char *s) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| bool | Write (const StormByte::ByteSize &count, std::string_view sv) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| bool | Write (const StormByte::ByteSize &count, const char *s) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| template<std::size_t N> |
| bool | Write (const char(&s)[N]) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| template<Type::ByteInputRange R> |
| STORMBYTE_FORCE_INLINE bool | Write (const R &r) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| template<Type::ByteInputRange Rw> |
| STORMBYTE_FORCE_INLINE bool | Write (const StormByte::ByteSize &count, const Rw &r) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| template<Type::ByteInputRange Rrw> |
| STORMBYTE_FORCE_INLINE bool | Write (const StormByte::ByteSize &count, Rrw &&r) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| template<Type::ByteInputRange Rr> |
| STORMBYTE_FORCE_INLINE bool | Write (Rr &&r) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
template<Type::ByteInputIterator I, typename S>
requires Type::SentinelFor<S, I> |
| STORMBYTE_FORCE_INLINE bool | Write (I first, S last) noexcept |
| | Bring the WriteOnly convenience Write overloads into scope.
|
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 |
| | Bring the WriteOnly convenience Write overloads into scope.
|
| | ReadWrite () noexcept |
| | Default constructor.
|
| | ReadWrite (const ReadWrite &other) noexcept |
| | Copy constructor.
|
| | ReadWrite (ReadWrite &&other) noexcept |
| | Move constructor.
|
| virtual | ~ReadWrite () noexcept |
| | Destructor.
|
| ReadWrite & | operator= (const ReadWrite &other) noexcept |
| | Copy assignment.
|
| ReadWrite & | operator= (ReadWrite &&other) noexcept |
| | Move assignment.
|
| | ReadOnly () noexcept |
| | Default constructor.
|
| | ReadOnly (const ReadOnly &other) noexcept |
| | Copy constructor.
|
| | ReadOnly (ReadOnly &&other) noexcept |
| | Move constructor.
|
| virtual | ~ReadOnly () noexcept |
| | Destructor.
|
| ReadOnly & | operator= (const ReadOnly &other) noexcept |
| | Copy assignment.
|
| ReadOnly & | operator= (ReadOnly &&other) noexcept |
| | Move assignment.
|
| bool | Extract (StormByte::Safe::Binary &outBuffer) noexcept |
| | Extract all available bytes into a StormByte::Safe::Binary.
|
| bool | Extract (WriteOnly &outBuffer) noexcept |
| | Extract all available bytes into a WriteOnly.
|
| bool | Read (StormByte::Safe::Binary &outBuffer) const noexcept |
| | Read all available bytes into a StormByte::Safe::Binary.
|
| bool | Read (WriteOnly &outBuffer) const noexcept |
| | Read all available bytes into a WriteOnly.
|
| | 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.
|
| | 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.
|
| 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).
|
| 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.
|
| 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.
|
Thread-safe FIFO built on top of FIFO.
SharedFIFO wraps the non-thread-safe FIFO with a mutex and a condition variable. It preserves the byte-oriented FIFO semantics and adds blocking reads and extracts.
Read and Extract with a count greater than zero block until that many bytes are available, or until Close() or SetError(). A count of zero returns immediately with whatever is available.
Close() marks the FIFO closed and notifies waiters. Later Write calls fail. Waiters complete with whatever is presently available.
SetError() puts the buffer into a permanent error state and wakes all waiters. Seek() updates the non-destructive read position and notifies waiters.
All public member functions are thread-safe. Closed and error flags are owned by the base FIFO. SharedFIFO only protects access and notifies.
Construction from StormByte::Safe::Binary, a byte range, a string view, a C string or a FIFO is implicit.
- See also
- FIFO, Ring, Producer, Consumer