SofaBuffers C++ 0.12.0
Pure-C++20 SofaBuffers — API Documentation
Loading...
Searching...
No Matches
sofab::Message Struct Reference

A message that both encodes and decodes: exactly OStreamMessage + IStreamMessage. More...

#include <sofab.hpp>

Inheritance diagram for sofab::Message:
[legend]
Collaboration diagram for sofab::Message:
[legend]

Additional Inherited Members

- Public Member Functions inherited from sofab::IStreamMessage
virtual void deserialize (IStreamImpl &istream, sofab::id id, size_t size, size_t count) noexcept=0
 Consume one of this message's fields from istream.
 
virtual ~IStreamMessage ()=default
 
- Protected Member Functions inherited from sofab::OStreamMessage
virtual OStreamImpl::Result serialize (OStreamImpl &ostream) const noexcept=0
 Write this message's fields into ostream.
 

Detailed Description

A message that both encodes and decodes: exactly OStreamMessage + IStreamMessage.

Almost every message is both, so spelling out the pair at every declaration is noise. This is an empty intermediate base — no storage, no vtable slot of its own, identical layout to inheriting the two directly — so it is a naming convenience and nothing else:

struct Telemetry : sofab::Message {
sofab::OStreamImpl::Result serialize(sofab::OStreamImpl &os) const noexcept override;
void deserialize(sofab::IStreamImpl &is, sofab::id id, size_t, size_t) noexcept override;
};
Base of the input streams: decodes fields from fed bytes.
Definition sofab.hpp:2919
Chainable result of a write operation.
Definition sofab.hpp:2031
Base of the output streams: encodes values into a caller-provided buffer.
Definition sofab.hpp:1349
uint32_t id
Field identifier on the wire.
Definition sofab.hpp:247
A message that both encodes and decodes: exactly OStreamMessage + IStreamMessage.
Definition sofab.hpp:6194

Both sofab::InputMessage and sofab::OutputMessage are satisfied through it. Inherit a single side directly when a type really is one-way.

Definition at line 6193 of file sofab.hpp.


The documentation for this struct was generated from the following file: