aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/comptrie/write_trie_backwards.h
blob: 84f69f078f39fb7ca4f409713126c81c7aae67bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include "minimize.h"

#include <util/generic/vector.h> 
#include <util/stream/output.h>
#include <cstddef>

namespace NCompactTrie {
    class TReverseNodeEnumerator {
    public:
        virtual ~TReverseNodeEnumerator() = default;
        virtual bool Move() = 0;
        virtual size_t GetLeafLength() const = 0;
        virtual size_t RecreateNode(char* buffer, size_t resultLength) = 0;
    };

    struct TOpaqueTrie;

    size_t WriteTrieBackwards(IOutputStream& os, TReverseNodeEnumerator& enumerator, bool verbose);
    size_t WriteTrieBackwardsNoAlloc(IOutputStream& os, TReverseNodeEnumerator& enumerator, TOpaqueTrie& trie, EMinimizeMode mode);

}