diff options
author | aavdonkin <aavdonkin@yandex-team.ru> | 2022-02-10 16:49:57 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:57 +0300 |
commit | efc32853c4263131bc59412eaf1a9e4aaae2a1f9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/containers | |
parent | fc8d3fe40009fab7705035e6ffdc3eb334307c80 (diff) | |
download | ydb-efc32853c4263131bc59412eaf1a9e4aaae2a1f9.tar.gz |
Restoring authorship annotation for <aavdonkin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers')
-rw-r--r-- | library/cpp/containers/comptrie/protopacker.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/containers/comptrie/protopacker.h b/library/cpp/containers/comptrie/protopacker.h index 8f1c389288..3e15866dc5 100644 --- a/library/cpp/containers/comptrie/protopacker.h +++ b/library/cpp/containers/comptrie/protopacker.h @@ -1,29 +1,29 @@ -#pragma once - +#pragma once + #include <util/stream/mem.h> -#include <util/ysaveload.h> - +#include <util/ysaveload.h> + template <class Proto> class TProtoPacker { -public: +public: TProtoPacker() = default; - + void UnpackLeaf(const char* p, Proto& entry) const { - TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32)); + TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32)); entry.ParseFromArcadiaStream(&in); - } + } void PackLeaf(char* p, const Proto& entry, size_t size) const { - TMemoryOutput out(p, size + sizeof(ui32)); - Save<ui32>(&out, size); + TMemoryOutput out(p, size + sizeof(ui32)); + Save<ui32>(&out, size); entry.SerializeToArcadiaStream(&out); - } + } size_t MeasureLeaf(const Proto& entry) const { return entry.ByteSize() + sizeof(ui32); } - size_t SkipLeaf(const char* p) const { - TMemoryInput in(p, sizeof(ui32)); - ui32 size; - Load<ui32>(&in, size); - return size; - } -}; + size_t SkipLeaf(const char* p) const { + TMemoryInput in(p, sizeof(ui32)); + ui32 size; + Load<ui32>(&in, size); + return size; + } +}; |