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