aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/comptrie/writeable_node.h
blob: 585ef0a5e4c2160c57db64eec654a272fbd3619e (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; 
    }; 

}