Platform.Data.Doublets C++
Loading...
Searching...
No Matches
ExternalLinksSourcesSizeBalancedTreeMethods.h
Go to the documentation of this file.
2{
3 template <typename TLinksOptions>
5 : public ExternalLinksSizeBalancedTreeMethodsBase<ExternalLinksSourcesSizeBalancedTreeMethods<TLinksOptions>,
6 TLinksOptions>
7 {
8 public:
9 using base =
11 TLinksOptions>;
12 using LinksOptionsType = TLinksOptions;
13 using LinkAddressType = typename LinksOptionsType::LinkAddressType;
14 using LinkType = typename LinksOptionsType::LinkType;
15 using WriteHandlerType = typename LinksOptionsType::WriteHandlerType;
16 using ReadHandlerType = typename LinksOptionsType::ReadHandlerType;
17 // Intentional CRTP customization of the base tree algorithm.
18 // cppcheck-suppress duplInheritedMember
19 static constexpr auto Constants = LinksOptionsType::Constants;
20
21 public:
22 ExternalLinksSourcesSizeBalancedTreeMethods(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->GetHeaderReference().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 LinkAddressType secondSource, LinkAddressType secondTarget)
97 {
98 return (firstSource < secondSource) || (firstSource == secondSource && (firstTarget < secondTarget));
99 }
101
102 public:
103 // Intentional CRTP customization of the base tree algorithm.
104 // cppcheck-suppress duplInheritedMember
106 LinkAddressType secondSource, LinkAddressType secondTarget)
107 {
108 return firstSource > secondSource || (firstSource == secondSource && firstTarget > secondTarget);
109 }
111
112 public:
114 {
115 auto& link = this->GetLinkIndexPartReference(node);
116 link.LeftAsSource = 0;
117 link.RightAsSource = 0;
118 link.SizeAsSource = 0;
119 }
120 };
121} // namespace Platform::Data::Doublets::Memory::Split::Generic
bool FirstIsToTheLeftOfSecond(LinkAddressType source, LinkAddressType target, LinkAddressType rootSource, LinkAddressType rootTarget)
Definition ExternalLinksSizeBalancedTreeMethodsBase.h:51
const RawLinkDataPart< LinkAddressType > & GetLinkDataPartReference(LinkAddressType link) const
Definition ExternalLinksSizeBalancedTreeMethodsBase.h:64
const RawLinkIndexPart< LinkAddressType > & GetLinkIndexPartReference(LinkAddressType link) const
Definition ExternalLinksSizeBalancedTreeMethodsBase.h:78
bool FirstIsToTheRightOfSecond(LinkAddressType source, LinkAddressType target, LinkAddressType rootSource, LinkAddressType rootTarget)
Definition ExternalLinksSizeBalancedTreeMethodsBase.h:44
LinkAddressType GetBasePartValue(LinkAddressType link)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:87
LinkAddressType GetRight(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:47
typename LinksOptionsType::WriteHandlerType WriteHandlerType
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:15
ExternalLinksSourcesSizeBalancedTreeMethods(std::byte *linksDataParts, std::byte *linksIndexParts, std::byte *header)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:22
void SetRight(LinkAddressType node, LinkAddressType right)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:59
void SetLeft(LinkAddressType node, LinkAddressType left)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:53
static constexpr auto Constants
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:19
bool FirstIsToTheLeftOfSecond(LinkAddressType firstSource, LinkAddressType firstTarget, LinkAddressType secondSource, LinkAddressType secondTarget)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:95
LinkAddressType GetLeft(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:41
void ClearNode(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:113
bool FirstIsToTheRightOfSecond(LinkAddressType firstSource, LinkAddressType firstTarget, LinkAddressType secondSource, LinkAddressType secondTarget)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:105
LinkAddressType GetSize(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:65
TLinksOptions LinksOptionsType
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:12
typename LinksOptionsType::ReadHandlerType ReadHandlerType
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:16
LinkAddressType GetTreeRoot()
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:79
LinkAddressType * GetLeftReference(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:29
void SetSize(LinkAddressType node, LinkAddressType size)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:71
LinkAddressType * GetRightReference(LinkAddressType node)
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:35
typename LinksOptionsType::LinkType LinkType
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:14
typename LinksOptionsType::LinkAddressType LinkAddressType
Definition ExternalLinksSourcesSizeBalancedTreeMethods.h:13
Definition ExternalLinksRecursionlessSizeBalancedTreeMethodsBase.h:2