|
SofaBuffers C/C++ 0.12.0
API Documentation
|
Collects a struct/union or nested-array wrapper sequence into a growable container. More...
#include <seq.hpp>
Public Types | |
| using | Elem = typename Container::value_type |
| Element type: an IStreamMessage, or a row container. | |
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. | |
| long | cap = -1 |
Schema count N, or -1 when the schema declares none. | |
| DynCap | dynCap {} |
| §6.2.1 receiver cap on the index; required where cap is -1. | |
| long | elemCount = -1 |
A ROW element's own schema count, or -1. Ignored for message elements. | |
| DynCap | dynElemCount {} |
| §6.2.1 receiver cap on a row's element count; required where elemCount is -1. | |
Static Public Attributes | |
| static constexpr int | elemWire = seq_elem_wire_v<Elem> |
| Declared element wire type, or -1 (seq_elem_wire_v). | |
| static constexpr int | elemFix = seq_elem_fix_v<Elem> |
| Declared element fixlen sub-type, or -1 (seq_elem_fix_v). | |
Collects a struct/union or nested-array wrapper sequence into a growable container.
The heap counterpart of FixedMessageSeq, for the allow_dynamic storage mode, and the object counterpart of StringSeq: the schema's count still binds, it just is not the container's capacity any more, so it is carried in cap. Placement, gap fill and the §7.3 skip are FixedMessageSeq's, unchanged and documented there; only the bound moves. Named to match sofab::MessageSeq in corelib-cpp so both C++ outputs read alike — the generator emits one call site for the two.
A growable row is bounded by the wire count alone: unlike an inline row it publishes no capacity, and the schema count of the inner array is not something the outer collector is told.
Growing the container may reallocate it, which the deferred decoder would not survive if it moved a destination already bound. It cannot: an element is placed only when its own child field opens, i.e. once the element before it has closed and every target inside it has been filled. That is the same reasoning read(std::vector<std::string>&) relies on; FixedMessageSeq does not need it at all, since inline storage never moves.
| Container | Growable container of messages, or of rows. |
| using sofab::MessageSeq< Container >::Elem = typename Container::value_type |
Element type: an IStreamMessage, or a row container.
|
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).
| _istream | Stream to bind the field's destination on. |
| _id | Field identifier. |
| _size | Field value size in bytes (e.g. string/blob length). |
| _count | Number of array elements (for array fields). |
Implements sofab::IStreamMessage.
Definition at line 269 of file seq.hpp.
| long sofab::MessageSeq< Container >::cap = -1 |
| DynCap sofab::MessageSeq< Container >::dynCap {} |
| DynCap sofab::MessageSeq< Container >::dynElemCount {} |
| long sofab::MessageSeq< Container >::elemCount = -1 |
|
staticconstexpr |
Declared element fixlen sub-type, or -1 (seq_elem_fix_v).
|
staticconstexpr |
Declared element wire type, or -1 (seq_elem_wire_v).
Destination, bound by IStreamImpl::readSequence.