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