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