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

Function skip_field_value

cpp/fory/serialization/skip.cc:645–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645void skip_field_value(ReadContext &ctx, const FieldType &field_type,
646 RefMode ref_mode) {
647 // Read ref flag if needed
648 if (ref_mode != RefMode::None) {
649 bool has_value = consume_ref_flag(ctx, ref_mode == RefMode::Tracking,
650 ref_mode == RefMode::NullOnly);
651 if (FORY_PREDICT_FALSE(ctx.has_error())) {
652 return;
653 }
654 if (!has_value) {
655 return; // Null or reference, nothing more to skip
656 }
657 }
658
659 // skip based on the logical TypeId (already in 0..255)
660 TypeId tid = static_cast<TypeId>(field_type.type_id);
661
662 switch (tid) {
663 case TypeId::BOOL:
664 case TypeId::INT8:
665 case TypeId::UINT8:
666 case TypeId::FLOAT8:
667 ctx.buffer().increase_reader_index(1, ctx.error());
668 return;
669
670 case TypeId::INT16:
671 case TypeId::UINT16:
672 case TypeId::BFLOAT16:
673 case TypeId::FLOAT16:
674 ctx.buffer().increase_reader_index(2, ctx.error());
675 return;
676
677 case TypeId::INT32: {
678 ctx.buffer().increase_reader_index(4, ctx.error());
679 return;
680 }
681
682 case TypeId::UINT32: {
683 ctx.buffer().increase_reader_index(4, ctx.error());
684 return;
685 }
686
687 case TypeId::FLOAT32:
688 ctx.buffer().increase_reader_index(4, ctx.error());
689 return;
690
691 case TypeId::INT64: {
692 ctx.buffer().increase_reader_index(8, ctx.error());
693 return;
694 }
695
696 case TypeId::UINT64: {
697 ctx.buffer().increase_reader_index(8, ctx.error());
698 return;
699 }
700
701 case TypeId::FLOAT64:
702 ctx.buffer().increase_reader_index(8, ctx.error());

Callers 9

read_dataMethod · 0.70
skip_struct_dataFunction · 0.70
skip_data_with_type_infoFunction · 0.70
skip_schema_or_type_infoFunction · 0.70
skip_structFunction · 0.70
skip_unknownFunction · 0.70
skip_unionFunction · 0.70
TESTFunction · 0.70

Calls 15

consume_ref_flagFunction · 0.85
skip_varintFunction · 0.85
skip_listFunction · 0.85
skip_setFunction · 0.85
skip_unknownFunction · 0.85
skip_unionFunction · 0.85
increase_reader_indexMethod · 0.80
skip_stringFunction · 0.70
skip_mapFunction · 0.70
skip_structFunction · 0.70
skip_extFunction · 0.70
errorMethod · 0.65

Tested by 1

TESTFunction · 0.56