SofaBuffers C/C++ 0.12.0
API Documentation
Loading...
Searching...
No Matches
sofab::FixedRowSeq< Container, Reader > Struct Template Reference

Collects a wrapper sequence of rows the stream cannot read on its own, into inline storage. More...

#include <seq.hpp>

Inheritance diagram for sofab::FixedRowSeq< Container, Reader >:
[legend]
Collaboration diagram for sofab::FixedRowSeq< Container, Reader >:
[legend]

Public Types

using Elem = typename Container::value_type
 Row type: the container's element.
 

Public Member Functions

void deserialize (IStreamImpl &is, sofab_id_t id, size_t, size_t count) noexcept override
 Dispatch one decoded field to the appropriate read.
 

Data Fields

Container * out = nullptr
 Destination, bound by IStreamImpl::readSequence.
 
Reader readRow {}
 The row read.
 

Static Public Attributes

static constexpr int elemWire = static_cast<int>(Reader::wire())
 Declared row wire type (§7.3), from Reader.
 

Detailed Description

template<typename Container, typename Reader>
struct sofab::FixedRowSeq< Container, Reader >

Collects a wrapper sequence of rows the stream cannot read on its own, into inline storage.

FixedMessageSeq reads a struct/union element or a row of native scalars itself. A row that is itself a wrapper sequence (array<array<string>>, array<array<struct>>, deeper) is neither, and an enum or boolean row has to bind through a view of its elements. For those the row read is the caller's: Reader. It is the only part of a row collector that differs between schemas; the rest is FixedMessageSeq's rule, unchanged and in the same order — the §7.3 skip first, then the index bound against the inline capacity, then the placement at the index id (see FixedMessageSeq for why each comes where it does).

Template Parameters
ContainerInline vector of rows.
ReaderThe row read, one level down. A default-constructible type with
  • static constexpr Wire wire(), the wire type a row of this schema arrives with — Wire::SequenceStart for a row that is a wrapper sequence, the array wire type of the backing integer for an enum or boolean row; and
  • void operator()(IStreamImpl &, Elem &, size_t count), binding the row that was placed; count is the element count the stream announced for it, as IStreamImpl::readArray takes it.

wire() is a function rather than a constant because a local class — which is where generated code declares the reader, next to the field it reads — may not have static data members.

Definition at line 355 of file seq.hpp.

Member Typedef Documentation

◆ Elem

using sofab::FixedRowSeq< Container, Reader >::Elem = typename Container::value_type

Row type: the container's element.

Definition at line 358 of file seq.hpp.

Member Function Documentation

◆ deserialize()

void sofab::FixedRowSeq< Container, Reader >::deserialize ( IStreamImpl &  _istream,
sofab_id_t  _id,
size_t  _size,
size_t  _count 
)
inlineoverridevirtualnoexcept

Dispatch one decoded field to the appropriate read.

Called for each field of this message; implementations typically switch on _id and call _istream.read(member).

Parameters
_istreamStream to bind the field's destination on.
_idField identifier.
_sizeField value size in bytes (e.g. string/blob length).
_countNumber of array elements (for array fields).

Implements sofab::IStreamMessage.

Definition at line 371 of file seq.hpp.

Here is the call graph for this function:

Field Documentation

◆ elemWire

constexpr int sofab::FixedRowSeq< Container, Reader >::elemWire = static_cast<int>(Reader::wire())
staticconstexpr

Declared row wire type (§7.3), from Reader.

Definition at line 361 of file seq.hpp.

◆ out

Destination, bound by IStreamImpl::readSequence.

Definition at line 368 of file seq.hpp.

◆ readRow

The row read.

Definition at line 369 of file seq.hpp.


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