MCPcopy Create free account
hub / github.com/catboost/catboost / ForAllFields

Function ForAllFields

contrib/libs/flatbuffers/src/reflection.cpp:360–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360void ForAllFields(const reflection::Object *object, bool reverse,
361 std::function<void(const reflection::Field *)> func) {
362 std::vector<uint32_t> field_to_id_map;
363 field_to_id_map.resize(object->fields()->size());
364
365 // Create the mapping of field ID to the index into the vector.
366 for (uint32_t i = 0; i < object->fields()->size(); ++i) {
367 auto field = object->fields()->Get(i);
368 field_to_id_map[field->id()] = i;
369 }
370
371 for (size_t i = 0; i < field_to_id_map.size(); ++i) {
372 func(object->fields()->Get(
373 field_to_id_map[reverse ? field_to_id_map.size() - i + 1 : i]));
374 }
375}
376
377void SetAnyValueI(reflection::BaseType type, uint8_t *data, int64_t val) {
378 // clang-format off

Callers 8

GenerateObjectsMethod · 0.85
GetOrBuildVTableMethod · 0.85
BuildStructMethod · 0.85
GenerateObjectMethod · 0.85

Calls 5

funcFunction · 0.85
idMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected