blob: 0341eeeae3820aa6333589e76f80eb75cbe496f3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
#include <library/cpp/packers/packers.h>
template <class T>
class TCompactTriePacker {
public:
void UnpackLeaf(const char* p, T& t) const {
NPackers::TPacker<T>().UnpackLeaf(p, t);
}
void PackLeaf(char* buffer, const T& data, size_t computedSize) const {
NPackers::TPacker<T>().PackLeaf(buffer, data, computedSize);
}
size_t MeasureLeaf(const T& data) const {
return NPackers::TPacker<T>().MeasureLeaf(data);
}
size_t SkipLeaf(const char* p) const // this function better be fast because it is very frequently used
{
return NPackers::TPacker<T>().SkipLeaf(p);
}
};
|