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

Collects a string wrapper sequence into inline storage. More...

#include <sofab.hpp>

Inheritance diagram for sofab::FixedStringSeq< Container >:
[legend]
Collaboration diagram for sofab::FixedStringSeq< Container >:
[legend]

Public Member Functions

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

Data Fields

Container * out = nullptr
 

Detailed Description

template<typename Container>
struct sofab::FixedStringSeq< Container >

Collects a string wrapper sequence into inline storage.

An element is placed at its index id rather than appended: a default (empty) element is omitted on the wire (§2), so the vector is grown with empty slots up to the id and the value stored there. Inline storage never reallocates, so an element bound earlier stays address-stable while later slots grow — which the deferred C decoder relies on.

An index at or past the fixed capacity N is a schema-bound violation (§5.1/§7) and is rejected with IStreamImpl::invalidate, before the fill loop. That also bounds an over-index amplification: InlineVector's emplace_back is a no-op once full, so an unguarded loop would spin forever on such an index (issue #126).

Template Parameters
ContainerInline vector of FixedString.

Definition at line 3775 of file sofab.hpp.

Member Function Documentation

◆ deserialize()

template<typename Container >
void sofab::FixedStringSeq< Container >::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 3779 of file sofab.hpp.

Here is the call graph for this function:

Field Documentation

◆ out

Definition at line 3777 of file sofab.hpp.


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