|
| | OStreamObject () noexcept=default |
| | Construct with no flush callback.
|
| |
| | OStreamObject (OStreamImpl::flushCallback callback) noexcept |
| | Construct with a flush callback.
|
| |
| MessageType & | operator-> () noexcept |
| | Member-access to the owned message (e.g. obj->field = ...).
|
| |
| OStreamImpl::Result | serialize () noexcept |
| | Serialize the owned message and flush.
|
| |
| | OStreamInline () noexcept |
| | Construct with no flush callback.
|
| |
| | OStreamInline (flushCallback callback) noexcept |
| | Construct with a flush callback.
|
| |
| | OStreamImpl (const OStreamImpl &)=delete |
| | Copy construction is deleted (the context owns raw buffer pointers).
|
| |
| OStreamImpl & | operator= (const OStreamImpl &)=delete |
| | Copy assignment is deleted (the context owns raw buffer pointers).
|
| |
| | OStreamImpl (OStreamImpl &&) noexcept=default |
| | Move construction (transfers the underlying context).
|
| |
| OStreamImpl & | operator= (OStreamImpl &&) noexcept=default |
| | Move assignment (transfers the underlying context).
|
| |
| virtual | ~OStreamImpl () noexcept |
| | Destructor; flushes any buffered bytes.
|
| |
| size_t | flush () noexcept |
| | Flush buffered bytes through the flush callback (if any).
|
| |
| size_t | bytesUsed () noexcept |
| | Number of bytes written to the active buffer since the last flush.
|
| |
| const uint8_t * | data () const noexcept |
| | Pointer to the start of the active encode buffer.
|
| |
| template<typename T > |
| Result | write (sofab_id_t id, const T &value) noexcept |
| | Encode a single field, deducing the wire type from T.
|
| |
| template<typename T > |
| Result | writeLazy (sofab_id_t id, const T &value) noexcept |
| | Encode a nested message field, omitting it when all-default.
|
| |
| Result | write (sofab_id_t id, const void *value, int32_t size) noexcept |
| | Encode a raw binary blob field.
|
| |
| template<typename T > |
| Result | writeIf (sofab_id_t id, const T &value, bool condition) noexcept |
| | Encode a field only when condition is true.
|
| |
| Result | sequenceBeginLazy (sofab_id_t id) noexcept |
| | Open a nested sequence whose header is held back until it turns out to have content.
|
| |
| Result | sequenceEnd () noexcept |
| | Close the current nested sequence, letting it vanish if it got no content (MESSAGE_SPEC ยง2).
|
| |
| Result | sequenceEndKeep () noexcept |
| | Close the current nested sequence, keeping its frame even without content.
|
| |
| bool | ok () const noexcept |
| | Whether every write on this stream has succeeded.
|
| |
| Error | error () const noexcept |
| | The first failure this stream saw, or Error::None.
|
| |
| Result | rejectArgument () noexcept |
| | Refuse the value being encoded: latch Error::InvalidArgument.
|
| |
template<OutputMessage MessageType,
size_t N = max_size_v<MessageType>,
size_t Offset = 0>
class sofab::OStreamObject< MessageType, N, Offset >
Self-contained encoder that owns a message and an inline buffer.
Bundles a OStreamMessage instance with an OStreamInline buffer sized from the message's worst-case size, so a message can be populated and encoded in one object.
- Template Parameters
-
| MessageType | An OutputMessage type. |
| N | Buffer size in bytes (defaults to the message's MAX_SIZE, or its deprecated _maxSize). |
| Offset | Initial write offset within the buffer. |
Definition at line 1867 of file sofab.hpp.