SofaBuffers C++ 0.12.0
Pure-C++20 SofaBuffers — API Documentation
Loading...
Searching...
No Matches
sofab::IStreamMessage Class Referenceabstract

Base class for user-defined messages that can deserialise themselves. More...

#include <sofab.hpp>

Inheritance diagram for sofab::IStreamMessage:
[legend]

Public Member Functions

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
 

Friends

template<InputMessage MessageType>
class IStreamObject
 

Detailed Description

Base class for user-defined messages that can deserialise themselves.

Derive from this and implement deserialize to read the message's fields; the type can then be decoded directly (e.g. via IStreamObject or by reading a nested sub-message with IStreamImpl::read).

Definition at line 6153 of file sofab.hpp.

Constructor & Destructor Documentation

◆ ~IStreamMessage()

virtual sofab::IStreamMessage::~IStreamMessage ( )
virtualdefault

Member Function Documentation

◆ deserialize()

virtual void sofab::IStreamMessage::deserialize ( IStreamImpl &  istream,
sofab::id  id,
size_t  size,
size_t  count 
)
pure virtualnoexcept

Consume one of this message's fields from istream.

Invoked once per field of the message; use id to dispatch and IStreamImpl::read to pull the value.

Parameters
istreamStream positioned at the field's value.
idIdentifier of the field being delivered.
sizePayload length (fixlen) or element size (fixlen array), in bytes.
countElement count for array fields, otherwise 0.

Implemented in sofab::StringSeq< C >, sofab::BlobSeq< C >, sofab::MessageSeq< A >, and sofab::RowSeq< C, Reader >.

Friends And Related Symbol Documentation

◆ IStreamObject

template<InputMessage MessageType>
friend class IStreamObject
friend

Definition at line 6156 of file sofab.hpp.


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