|
SatCat5
|
Version of io::WriteableBroadcast that considers a write successful if ANY of the downstream Writeable objects return success.
Note that get_write_space() is also updated to return the maximum available write space of any downstream Writeable object.
Definition at line 81 of file io_broadcast.h.
#include <io_broadcast.h>
Public Member Functions | |
| unsigned | get_write_space () const override |
| Get the max available write space of any downstream Writeable. | |
| bool | write_finalize () override |
| Finalize the in-progress write for all downstream Writeables. More... | |
| void | write_abort () override |
| Abort writes for all downstream Writeables. | |
| void | write_bytes (unsigned nbytes, const void *src) override |
| Write a byte sequence to all downstream Writeables. | |
| Writeable *& | operator[] (unsigned idx) |
| Access or assign the Nth downstream Writeable object. | |
| void | port_set (unsigned idx, Writeable *dst) |
| Designate the Nth downstream Writeable object. | |
| unsigned | len () const |
| Length of the output array. | |
| void | write_u8 (u8 data) |
| One of many functions for writing integer/floating point values, see details. More... | |
| void | write_str (const char *str) |
| Write the contents of a null-terminated string. More... | |
| template<class T > | |
| void | write_obj (const T &obj) |
Templated wrapper for any object with the following method: void write_to(satcat5::io::Writeable* wr) const; | |
Protected Member Functions | |
| constexpr | WriteableBroadcastAny (unsigned n_dsts, satcat5::io::Writeable **dsts) |
| void | write_next (u8 data) override |
| Write the next byte to the underlying buffer or device. More... | |
| void | write_overflow () override |
| Optional error handling for write overflow. More... | |
Protected Attributes | |
| const unsigned | m_size |
Size of m_dsts. | |
| satcat5::io::Writeable **const | m_dsts |
| Array of Writeables. | |
| friend | WriteableBroadcast |
| friend | LimitedWrite |
| friend | WriteableRedirect |
|
overridevirtual |
Finalize the in-progress write for all downstream Writeables.
Reimplemented from satcat5::io::WriteableBroadcast.
Definition at line 75 of file io_broadcast.cc.
|
overrideprotectedvirtualinherited |
Write the next byte to the underlying buffer or device.
Child objects of io::Writeable MUST override this method.
Implements satcat5::io::Writeable.
Definition at line 52 of file io_broadcast.cc.
|
overrideprotectedvirtualinherited |
Optional error handling for write overflow.
Child objects of io::Writeable MAY override this method for error handling.
Reimplemented from satcat5::io::Writeable.
Definition at line 59 of file io_broadcast.cc.
|
inherited |
Write the contents of a null-terminated string.
Note: Null-termination is not copied to the output.
Definition at line 180 of file io_writeable.cc.
|
inherited |
One of many functions for writing integer/floating point values, see details.
Several functions are provided for reading and writing scalar types to/from io::Readable and io::Writeable instances. Since there are many of these that are frequently inherited, they are hidden from documentation. These functions follow a shared template:
read_ or write_ prefix.u for unsigned, s for signed, f for floating-point.l suffix if little-endian, no suffix if big-endian.Example: write_s48l is "Write 48 bits (6 bytes) to this
io::Writeable as a signed value in little-endian order".
Definition at line 20 of file io_writeable.cc.