aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/comptrie/writeable_node.h
blob: 5454e579ef01d35faf4a349966575885df8d8989 (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
24
25
26
#pragma once

#include <cstddef>

namespace NCompactTrie {
    class TNode;

    class TWriteableNode {
    public:
        const char* LeafPos;
        size_t LeafLength;

        size_t ForwardOffset;
        size_t LeftOffset;
        size_t RightOffset;
        char Label;

        TWriteableNode();
        TWriteableNode(const TNode& node, const char* data);

        // When you call this, the offsets should be relative to the end of the node. Use NPOS to indicate an absent offset.
        size_t Pack(char* buffer) const;
        size_t Measure() const;
    };

}