aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/comptrie/comptrie_packer.h
blob: f997d89dd15ff597b733edb02b9aa53e17df9b26 (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);
    }
};