Skip to content

Frame-based implementation of GMQ binary format #1

@divanchykhin

Description

@divanchykhin

To solve, among others, problems with extendable structure skipping (in particular, vector elements) in case of GMQ, its binary format is to be based on the following principles:

  1. Basic units are binary representation of IDL elementary types (such as integers, strings, reals, etc).
  2. Basic units are organized in frames; the whole message is a sequence of frames.
    2.1. Frame size must not exceed a predefined value
  3. Each frame has its header that tells its size and flags; header encoding allows compact representation (e.g., utf8-like) in case of small sizes, but does not require it (that is, in all cases to continue header parsing it suffices to parse previous bytes). Exact encoding algorithm is TBD.
  4. Currently the following flags are seen:
    4.1. frame sequence termination flag
    4.2. frame-size-from-its-content flag (used in case of long strings, blobs, etc that tell their size themselves)
  5. When composing,
    5.1. in general, it is Composer's decision to begin and end a frame while writing an entry of elementary type (based on a number of bytes remaining in frame up to its maximal size, number of bytes that might be necessary to write an entry, etc);
    5.2. in particular, it can be terminated base on an caller's request;
    5.2.1. in this case caller may request to add 'frame sequence termination flag' to the frame header.

Important usage point: when an extendable structure has been composed, caller requests to terminate a frame with adding 'frame sequence termination flag' flag; then, while parsing, to skip this structure meand to follow until a frame with 'frame sequence termination flag'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions