3 template <
typename TSelf,
typename TLinksOptions>
5 :
public Platform::Collections::Methods::Trees::SizeBalancedTreeMethods<
6 TSelf, typename TLinksOptions::LinkAddressType>
9 using Polymorph<TSelf>::object;
11 static constexpr auto Constants = LinksOptionsType::Constants;
13 using LinkType =
typename LinksOptionsType::LinkType;
34 return this->object().GetTreeRoot();
40 return this->object().GetBasePartValue(link);
47 return this->object().FirstIsToTheRightOfSecond(source, target, rootSource, rootTarget);
54 return this->object().FirstIsToTheLeftOfSecond(source, target, rootSource, rootTarget);
95 return LinkType{linkIndex, link.Source, link.Target};
120 if ((index >= this->
object().GetSize(root)))
126 auto left = GetLeftOrDefault(root);
127 auto leftSize = GetSizeOrZero(left);
128 if ((index < leftSize))
133 if ((index == leftSize))
137 root = GetRightOrDefault(root);
138 index = (index - (leftSize + 1));
150 auto rootSource = rootLink.Source;
151 auto rootTarget = rootLink.Target;
154 root = this->GetLeftOrDefault(root);
158 root = this->GetRightOrDefault(root);
172 auto total = this->object().GetSize(root);
173 auto totalRightIgnore = 0;
179 root = this->GetRightOrDefault(root);
183 totalRightIgnore = totalRightIgnore + (this->GetRightSize(root) + 1);
184 root = this->GetLeftOrDefault(root);
188 auto totalLeftIgnore = 0;
194 root = this->GetLeftOrDefault(root);
198 totalLeftIgnore = totalLeftIgnore + (this->GetLeftSize(root) + 1);
199 root = this->GetRightOrDefault(root);
202 return (total - totalRightIgnore) - totalLeftIgnore;
208 return this->EachUsageCore(base, this->
GetTreeRoot(), handler);
219 if (linkBasePart > (base))
221 if ((this->EachUsageCore(base, this->GetLeftOrDefault(link), handler) ==
Break))
226 else if (linkBasePart < base)
228 if ((this->EachUsageCore(base, this->GetRightOrDefault(link), handler) ==
Break))
239 if ((this->EachUsageCore(base, this->GetLeftOrDefault(link), handler) ==
Break))
243 if ((this->EachUsageCore(base, this->GetRightOrDefault(link), handler) ==
Break))