MCPcopy Create free account
hub / github.com/apache/fory / read_fixed_primitive_fields

Function read_fixed_primitive_fields

cpp/fory/serialization/struct_serializer.h:3817–3828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3815/// Optimized: uses compile-time offsets and updates reader_index once at end.
3816template <typename T, size_t... Indices>
3817FORY_ALWAYS_INLINE void
3818read_fixed_primitive_fields(T &obj, Buffer &buffer,
3819 std::index_sequence<Indices...>) {
3820 using Helpers = CompileTimeFieldHelpers<T>;
3821 const uint32_t base_offset = buffer.reader_index();
3822
3823 // Read each field using helper function - no lambda overhead
3824 (read_single_fixed_field<T, Indices>(obj, buffer, base_offset), ...);
3825
3826 // Update reader_index once with total fixed bytes (compile-time constant)
3827 buffer.reader_index(base_offset + Helpers::leading_fixed_size_bytes);
3828}
3829
3830/// Read a single varint field at a given offset.
3831/// Does NOT update reader_index - caller must track offset and update once.

Callers

nothing calls this directly

Calls 1

reader_indexMethod · 0.80

Tested by

no test coverage detected