SofaBuffers C/C++ 0.12.0
API Documentation
Loading...
Searching...
No Matches
sofab_ostream Struct Reference

#include <ostream.h>

Collaboration diagram for sofab_ostream:
[legend]

Data Fields

uint8_t * buffer
 
uint8_t * bufend
 
uint8_t * offset
 
sofab_ostream_flush_cb_t flush
 
void * usrptr
 
sofab_id_t pending [SOFAB_LAZY_SEQ_DEPTH]
 
uint8_t npending
 

Detailed Description

Definition at line 146 of file ostream.h.

Field Documentation

◆ bufend

uint8_t* sofab_ostream::bufend

Pointer one-past-the-end of the active buffer.

Definition at line 149 of file ostream.h.

◆ buffer

uint8_t* sofab_ostream::buffer

Pointer to the start of the active buffer.

Definition at line 148 of file ostream.h.

◆ flush

sofab_ostream_flush_cb_t sofab_ostream::flush

Optional flush callback invoked when buffer data must be handled.

Definition at line 151 of file ostream.h.

◆ npending

uint8_t sofab_ostream::npending

Valid entries in pending.

Definition at line 167 of file ostream.h.

◆ offset

uint8_t* sofab_ostream::offset

Current write cursor within the buffer.

Definition at line 150 of file ostream.h.

◆ pending

sofab_id_t sofab_ostream::pending[SOFAB_LAZY_SEQ_DEPTH]

Ids of the innermost open sequences whose header is still held back (see sofab_ostream_write_sequence_begin_lazy). Always a contiguous suffix of the open sequences: writing any field, opening an eager frame, or overflowing the window commits the whole run.

Costs 4 * SOFAB_LAZY_SEQ_DEPTH bytes plus the counter – 36 B per stream at the default depth of 8 on a 32-bit target. A pure-C consumer that encodes through sofab_object_encode() never needs it – the descriptor decides omission per field before opening anything – so a footprint build can compile the whole mechanism out with SOFAB_DISABLE_LAZY_SEQ_SUPPORT. The macro changes this struct's layout, so it MUST be defined identically for the library and every one of its users.

Definition at line 166 of file ostream.h.

◆ usrptr

void* sofab_ostream::usrptr

User-provided pointer passed to the flush callback.

Definition at line 152 of file ostream.h.


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