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 {
11 template <typename LEAF_CONTAINER, typename VALUE, uint64_t MAX_DEGREE, bool USE_PSUM>
12 struct StackNode
13 {
14 public:
16 uint64_t position;
17 bool checked;
18
19 StackNode()
20 {
21 }
22 StackNode(BPNodePointer<LEAF_CONTAINER, VALUE, MAX_DEGREE, USE_PSUM> _pointer, uint64_t _position, bool _checked) : pointer(_pointer), position(_position), checked(_checked)
23 {
24 }
25
26 StackNode copy() const {
27 return StackNode(pointer, position, checked);
28
29 }
30
31 std::string to_string() const
32 {
33 std::string s;
34 s += "[";
35 s += std::to_string((uint64_t)this->pointer.get_node());
36 s += ", ";
37 s += std::to_string(this->position);
38 if (this->checked)
39 {
40 s += "T";
41 }
42 else
43 {
44 s += "F";
45 }
46 s += "]";
47 return s;
48 }
49 };
50 }
51}
A pointer to a node of BPTree [Unchecked AI's Comment].
Definition bp_node_pointer.hpp:14
The item of the stack for traversing BPTree [Unchecked AI's Comment].
Definition stack_node.hpp:13