Platform.Data.Doublets C++
Loading...
Searching...
No Matches
InternalLinksSourcesSizeBalancedTreeMethods.h
Go to the documentation of this file.
2{
3 template <typename TLinksOptions>
5 : public InternalLinksSizeBalancedTreeMethodsBase<InternalLinksSourcesSizeBalancedTreeMethods<TLinksOptions>,
6 TLinksOptions>
7 {
8 public:
9 using LinksOptionsType = TLinksOptions;
10 using LinkAddressType = typename LinksOptionsType::LinkAddressType;
11 using LinkType = typename LinksOptionsType::LinkType;
12 using WriteHandlerType = typename LinksOptionsType::WriteHandlerType;
13 using ReadHandlerType = typename LinksOptionsType::ReadHandlerType;
14 // Intentional CRTP customization of the base tree algorithm.
15 // cppcheck-suppress duplInheritedMember
16 static constexpr auto Constants = LinksOptionsType::Constants;
17 using base =
19 TLinksOptions>;
20
21 public:
22 InternalLinksSourcesSizeBalancedTreeMethods(std::byte* linksDataParts, std::byte* linksIndexParts,
23 std::byte* header)
24 : base(linksDataParts, linksIndexParts, header)
25 {
26 }
27
28 public:
30 {
31 return &(this->GetLinkIndexPartReference(node).LeftAsSource);
32 }
33
34 public:
36 {
37 return &(this->GetLinkIndexPartReference(node).RightAsSource);
38 }
39
40 public:
42 {
43 return this->GetLinkIndexPartReference(node).LeftAsSource;
44 }
45
46 public:
48 {
49 return this->GetLinkIndexPartReference(node).RightAsSource;
50 }
51
52 public:
54 {
55 this->GetLinkIndexPartReference(node).LeftAsSource = left;
56 }
57
58 public:
60 {
61 this->GetLinkIndexPartReference(node).RightAsSource = right;
62 }
63
64 public:
66 {
67 return this->GetLinkIndexPartReference(node).SizeAsSource;
68 }
69
70 public:
72 {
73 this->GetLinkIndexPartReference(node).SizeAsSource = size;
74 }
75
76 public:
77 // Intentional CRTP customization of the base tree algorithm.
78 // cppcheck-suppress duplInheritedMember
80 {
81 return this->GetLinkIndexPartReference(link).RootAsSource;
82 }
83
84 public:
85 // Intentional CRTP customization of the base tree algorithm.
86 // cppcheck-suppress duplInheritedMember
88 {
89 return this->GetLinkDataPartReference(link).Source;
90 }
91
92 public:
93 // Intentional CRTP customization of the base tree algorithm.
94 // cppcheck-suppress duplInheritedMember
96 {
97 return this->GetLinkDataPartReference(link).Target;
98 }
99
100 public:
102 {
103 auto& link = this->GetLinkIndexPartReference(node);
104 link.LeftAsSource = 0;
105 link.RightAsSource = 0;
106 link.SizeAsSource = 0;
107 }
108
109 public:
110 // Intentional CRTP customization of the base tree algorithm.
111 // cppcheck-suppress duplInheritedMember
113 {
114 return this->SearchCore(this->GetTreeRoot(source), target);
115 }
116 };
117} // namespace Platform::Data::Doublets::Memory::Split::Generic
const RawLinkIndexPart< LinkAddressType > & GetLinkIndexPartReference(LinkAddressType link) const
Definition InternalLinksSizeBalancedTreeMethodsBase.h:74
LinkAddressType SearchCore(LinkAddressType root, LinkAddressType key)
Definition InternalLinksSizeBalancedTreeMethodsBase.h:113
const RawLinkDataPart< LinkAddressType > & GetLinkDataPartReference(LinkAddressType link) const
Definition InternalLinksSizeBalancedTreeMethodsBase.h:60
LinkAddressType GetTreeRoot(LinkAddressType link)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:79
TLinksOptions LinksOptionsType
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:9
LinkAddressType GetLeft(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:41
void ClearNode(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:101
static constexpr auto Constants
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:16
void SetLeft(LinkAddressType node, LinkAddressType left)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:53
void SetRight(LinkAddressType node, LinkAddressType right)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:59
typename LinksOptionsType::LinkAddressType LinkAddressType
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:10
InternalLinksSourcesSizeBalancedTreeMethods(std::byte *linksDataParts, std::byte *linksIndexParts, std::byte *header)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:22
void SetSize(LinkAddressType node, LinkAddressType size)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:71
LinkAddressType GetRight(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:47
LinkAddressType GetBasePartValue(LinkAddressType link)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:87
typename LinksOptionsType::LinkType LinkType
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:11
LinkAddressType GetKeyPartValue(LinkAddressType link)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:95
LinkAddressType Search(LinkAddressType source, LinkAddressType target)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:112
LinkAddressType * GetLeftReference(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:29
typename LinksOptionsType::ReadHandlerType ReadHandlerType
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:13
typename LinksOptionsType::WriteHandlerType WriteHandlerType
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:12
LinkAddressType GetSize(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:65
LinkAddressType * GetRightReference(LinkAddressType node)
Definition InternalLinksSourcesSizeBalancedTreeMethods.h:35
Definition ExternalLinksRecursionlessSizeBalancedTreeMethodsBase.h:2