#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#ifndef CC_BASE_RTREE_H_
#define CC_BASE_RTREE_H_
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <map>
#include <optional>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/numerics/clamped_math.h"
#include "ui/gfx/geometry/rect.h"
namespace cc {
template <typename T>
class RTree { … };
template <typename T>
RTree<T>::RTree() = default;
template <typename T>
RTree<T>::~RTree() = default;
template <typename T>
template <typename Container>
void RTree<T>::Build(const Container& items) { … }
template <typename T>
template <typename BoundsFunctor, typename PayloadFunctor>
void RTree<T>::Build(size_t item_count,
const BoundsFunctor& bounds_getter,
const PayloadFunctor& payload_getter) { … }
template <typename T>
auto RTree<T>::AllocateNodeAtLevel(int level) -> Node<T>* { … }
template <typename T>
auto RTree<T>::BuildRecursive(std::vector<Branch<T>>* branches, int level)
-> Branch<T> { … }
template <typename T>
template <typename ResultFunctor>
void RTree<T>::Search(const gfx::Rect& query,
const ResultFunctor& result_handler) const { … }
template <typename T>
void RTree<T>::Search(const gfx::Rect& query,
std::vector<T>* results,
std::vector<gfx::Rect>* rects) const { … }
template <typename T>
void RTree<T>::SearchRefs(const gfx::Rect& query,
std::vector<const T*>* results) const { … }
template <typename T>
template <typename ResultFunctor>
void RTree<T>::SearchRecursive(Node<T>* node,
const gfx::Rect& query,
const ResultFunctor& result_handler) const { … }
template <typename T>
template <typename ResultFunctor>
void RTree<T>::SearchRecursiveFallback(
Node<T>* node,
const gfx::Rect& query,
const ResultFunctor& result_handler) const { … }
template <typename T>
std::optional<gfx::Rect> RTree<T>::bounds() const { … }
template <typename T>
std::map<T, gfx::Rect> RTree<T>::GetAllBoundsForTracing() const { … }
template <typename T>
void RTree<T>::GetAllBoundsRecursive(Node<T>* node,
std::map<T, gfx::Rect>* results) const { … }
}
#endif