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

Function consume_ref_flag

cpp/fory/serialization/skip.cc:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool consume_ref_flag(ReadContext &ctx, bool tracking_ref, bool null_only) {
50 if (!tracking_ref && !null_only) {
51 return true;
52 }
53 int8_t ref_flag = ctx.read_int8(ctx.error());
54 if (FORY_PREDICT_FALSE(ctx.has_error())) {
55 return false;
56 }
57 if (ref_flag == NULL_FLAG) {
58 return false;
59 }
60 if (ref_flag == REF_FLAG) {
61 (void)ctx.read_var_uint32(ctx.error());
62 return false;
63 }
64 if (ref_flag == NOT_NULL_VALUE_FLAG || ref_flag == REF_VALUE_FLAG) {
65 return true;
66 }
67 ctx.set_error(Error::invalid_data(
68 "Unknown reference flag: " + std::to_string(static_cast<int>(ref_flag))));
69 return false;
70}
71
72void skip_struct_data(ReadContext &ctx, const TypeInfo &type_info) {
73 if (!type_info.type_meta) {

Callers 3

skip_listFunction · 0.85
skip_mapFunction · 0.85
skip_field_valueFunction · 0.85

Calls 5

errorMethod · 0.65
read_int8Method · 0.45
has_errorMethod · 0.45
read_var_uint32Method · 0.45
set_errorMethod · 0.45

Tested by

no test coverage detected