|
SofaBuffers C++ 0.12.0
Pure-C++20 SofaBuffers — API Documentation
|
The held-back sequence run: ids of the innermost open sequences whose header has not been written yet (sequenceBeginLazy). More...
#include <sofab.hpp>
Public Member Functions | |
| bool | empty () const noexcept |
| size_t | size () const noexcept |
| sofab::id | operator[] (size_t i) const noexcept |
| bool | push (sofab::id v) noexcept |
| Hold back one more id (the new innermost open sequence). | |
| void | pop () noexcept |
| Drop the innermost held-back id — its sequence got no content. | |
| void | clear () noexcept |
| Forget the whole run (it has just been written out). | |
The held-back sequence run: ids of the innermost open sequences whose header has not been written yet (sequenceBeginLazy).
Always a contiguous suffix of the open sequences — writing any field commits the whole run at once — and it is fixed-size state (CORELIB_PLAN §6.6.2), sized to its full extent when the stream is constructed: "The pending run is fixed-size state (§6.6.2): at most <tt>MAX_DEPTH</tt> ids, <strong>sized at construction</strong>. An implementation <strong>MUST</strong> hold back to the full <tt>MAX_DEPTH</tt> (§6.2) and is thereby canonical at every depth." (§6.0.1, "How deep the hold-back reaches"). MAX_DEPTH is what bounds the nesting, hence the run; sequenceBeginLazy refuses past it, so the array below can never be outrun.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Hold back one more id (the new innermost open sequence).
Allocates nothing — the run was sized at construction. The false return is kept for the caller that already handles it, but it can only be reached by a push past MAX_DEPTH, which OStreamImpl::sequenceBeginLazy rejects one step earlier.
true if the id is held back, false if the run is full.
|
inlinenoexcept |