b-tree-plus-alpha
Loading...
Searching...
No Matches
stack_node.hpp
1#pragma once
2#include "./bp_node_pointer.hpp"
3namespace stool
4{
5 namespace bptree
6 {
12 template <typename LEAF_CONTAINER, typename VALUE, uint64_t MAX_DEGREE>
13 struct StackNode
14 {
15 public:
17 uint64_t position;
18 bool checked;
19
20 StackNode()
21 {
22 }
23 StackNode(BPNodePointer<LEAF_CONTAINER, VALUE, MAX_DEGREE> _pointer, uint64_t _position, bool _checked) : pointer(_pointer), position(_position), checked(_checked)
24 {
25 }
26
27 StackNode copy() const {
28 return StackNode(pointer, position, checked);
29
30 }
31
32 std::string to_string() const
33 {
34 std::string s;
35 s += "[";
36 s += std::to_string((uint64_t)this->pointer.get_node());
37 s += ", ";
38 s += std::to_string(this->position);
39 if (this->checked)
40 {
41 s += "T";
42 }
43 else
44 {
45 s += "F";
46 }
47 s += "]";
48 return s;
49 }
50 };
51 }
52}
A pointer to a node of BPTree.
Definition bp_node_pointer.hpp:15
The item of the stack for traversing BPTree.
Definition stack_node.hpp:14