CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
SerReaderOps Struct Reference

#include <serreader.h>

Data Fields

bool(* readInt )(SerReader *r, int64 *out, stype declared)
 
bool(* readUint )(SerReader *r, uint64 *out, stype declared)
 
bool(* readReal )(SerReader *r, float64 *out, stype declared)
 
bool(* arrBegin )(SerReader *r, int32 *count)
 
bool(* arrNext )(SerReader *r)
 false once the array is exhausted
 
bool(* mapBegin )(SerReader *r, int32 *count)
 
bool(* mapNext )(SerReader *r, string *key)
 false at end of map
 
void(* destroy )(SerReader *r)
 frees private state and the struct
 

Detailed Description

A serialization format, defined as a set of operations for reading each kind of value.

The traverser asks for whatever should come next according to the schema, and the backend checks and consumes it. peek is only needed when the next value's type isn't already known (a dynamic slot, an optional member); skip is for fields the schema doesn't recognize.

Definition at line 24 of file serreader.h.

Field Documentation

◆ arrBegin

bool(* SerReaderOps::arrBegin) (SerReader *r, int32 *count)
Parameters
countReceives the element count, or < 0 if the format does not carry one

Definition at line 40 of file serreader.h.

◆ mapBegin

bool(* SerReaderOps::mapBegin) (SerReader *r, int32 *count)
Parameters
countReceives the entry count, or < 0 if the format does not carry one

Definition at line 44 of file serreader.h.

◆ readInt

bool(* SerReaderOps::readInt) (SerReader *r, int64 *out, stype declared)

declared matters because some formats (e.g. compact binary) don't store a value's width on the wire – only the schema knows it. The value always comes back in its widest form; narrowing to the member's actual type happens elsewhere.

Definition at line 33 of file serreader.h.

◆ readReal

bool(* SerReaderOps::readReal) (SerReader *r, float64 *out, stype declared)

declared matters because some formats (e.g. compact binary) don't store a value's width on the wire – only the schema knows it. The value always comes back in its widest form; narrowing to the member's actual type happens elsewhere.

Definition at line 35 of file serreader.h.

◆ readUint

bool(* SerReaderOps::readUint) (SerReader *r, uint64 *out, stype declared)

declared matters because some formats (e.g. compact binary) don't store a value's width on the wire – only the schema knows it. The value always comes back in its widest form; narrowing to the member's actual type happens elsewhere.

Definition at line 34 of file serreader.h.


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