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

Method Serialize

library/cpp/netliba/v12/udp_host_protocol.h:395–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393 }
394
395 size_t Serialize(char** buf) {
396 //store start position of vector to write size
397 char* start = *buf;
398 ui8 map = 0;
399 //place for size (ui8) and map
400 *buf += sizeof(ui8) + sizeof(map);
401 //map also is element of vector
402 size_t written = sizeof(map);
403 if (!PacketOpt.Empty()) {
404 map |= OV_HAS_PACKET_OPTIONS;
405 written += PacketOpt.Serialize(buf);
406 }
407 if (!TransferOpt.Empty()) {
408 map |= OV_HAS_TRANSFER_OPTIONS;
409 written += TransferOpt.Serialize(buf);
410 }
411 Y_ABORT_UNLESS(written < 255, "TOptionsVector is too long\n");
412 Write(&start, (ui8)written);
413 Write(&start, map);
414 return written;
415 }
416
417 TPacketOptions PacketOpt;
418 TTransferOptions TransferOpt;

Callers

nothing calls this directly

Calls 3

WriteFunction · 0.70
EmptyMethod · 0.45
SerializeMethod · 0.45

Tested by

no test coverage detected