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

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

#include <seq.hpp>

Inheritance diagram for sofab::RowSeq< Container, Reader, Count >:
[legend]
Collaboration diagram for sofab::RowSeq< Container, Reader, Count >:
[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, long Count = -1>
struct sofab::RowSeq< Container, Reader, Count >

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

The heap counterpart of FixedRowSeq, as MessageSeq is of FixedMessageSeq. Named to match sofab::RowSeq in corelib-cpp. The schema count arrives one of two ways:

  • as the template argument Count — the bound is then a constant, the collector stores no bound at all and a row at or past it is Error::InvalidMessage. This is the generated layer's form: the footprint profile requires a count on every array level, so a receiver cap could never apply, and neither its storage nor its branch is paid for;
  • or, with Count left at -1, as the runtime member cap, with the §6.2.1 receiver cap dynCap beside it for a schema-unbounded array — applied by seqRefuse exactly as MessageSeq applies them.

A row is placed only once its own field opens, i.e. once every target in the row before it has been filled, so growing the container cannot move a destination the deferred decoder still has bound (see MessageSeq).

Template Parameters
ContainerGrowable container of rows.
ReaderThe row read, as for FixedRowSeq.
CountSchema count N, or -1 to take the bounds as members.

Definition at line 429 of file seq.hpp.

Member Typedef Documentation

◆ Elem

template<typename Container , typename Reader , long Count = -1>
using sofab::RowSeq< Container, Reader, Count >::Elem = typename Container::value_type

Row type: the container's element.

Definition at line 434 of file seq.hpp.

Member Function Documentation

◆ deserialize()

template<typename Container , typename Reader , long Count = -1>
void sofab::RowSeq< Container, Reader, Count >::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 442 of file seq.hpp.

Here is the call graph for this function:

Field Documentation

◆ elemWire

template<typename Container , typename Reader , long Count = -1>
constexpr int sofab::RowSeq< Container, Reader, Count >::elemWire = static_cast<int>(Reader::wire())
staticconstexpr

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

Definition at line 437 of file seq.hpp.

◆ out

Destination, bound by IStreamImpl::readSequence.

Definition at line 439 of file seq.hpp.

◆ readRow

template<typename Container , typename Reader , long Count = -1>
Reader sofab::RowSeq< Container, Reader, Count >::readRow {}

The row read.

Definition at line 440 of file seq.hpp.


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