SofaBuffers TypeScript - v0.12.0
    Preparing search index...

    Variable BulkModeConst

    BulkMode: {
        Bool: 4;
        F32: 5;
        F32Bits: 6;
        F64: 7;
        Halves: 3;
        Longs: 2;
        Typed: 1;
        Values: 0;
    } = ...

    Which destination field an ArrayTarget sets — stated by the caller, so the decoder does not have to work it out again for every array of every message.

    It is an assertion, not a hint. A target that states its mode is taken at its word: the decoder stops looking at the other destination fields, stops checking that exactly one of them is set, and stops re-reading whether the stated bound is four well-formed halves or whether a typed destination's width covers it. What it still does, every time, is the one thing that changes per message — compare the destination's length against the element count — because that is the only check that is about this array rather than about the schema.

    So a wrong mode is a caller mistake of the same severity as a wrong bound, and it fails the same way: the decoder fills the destination the mode names, with the bound the target states, and a mode that does not match the object either refuses a legal message or writes into the wrong field. Generated code derives both from the same schema field and cannot disagree with itself; a hand-written visitor that is not sure should simply leave it out, which is every target that exists today and which keeps the full per-array validation (§6.3).

    The members name fields, not fill strategies: the decoder still picks the 32-bit drain over the wide one from the bound it was given, and the halves-filled 64-bit store from the destination's own element width. Those two are a compare each; the work this saves is the search for the field in the first place.

    Type Declaration