From 950f96f4ded53a6b5753824b280550b722933e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Mon, 4 Nov 2024 17:03:50 +0100 Subject: [PATCH] basic_rtree -> cista::raw::rtree + cista::offset::rtree --- include/cista/containers/rtree.h | 35 +++++++++++++++------- include/cista/type_hash/static_type_hash.h | 11 ++++--- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/include/cista/containers/rtree.h b/include/cista/containers/rtree.h index 28b88d37..7d0b5235 100644 --- a/include/cista/containers/rtree.h +++ b/include/cista/containers/rtree.h @@ -16,13 +16,12 @@ template void serialize(Ctx& c, T const* origin, offset_t const pos); template typename VectorType = - offset::vector_map> -struct rtree { + template typename VectorType, // + std::uint32_t Dims, // + typename NumType, // + std::uint32_t MaxItems, // + typename SizeType> +struct basic_rtree { static constexpr auto const kInfinity = std::numeric_limits::max(); static constexpr auto const kSplitMinItemsPercentage = 10U; @@ -631,9 +630,25 @@ struct rtree { VectorType nodes_; }; -template -using mm_rtree = cista::rtree; +using mm_rtree = cista::basic_rtree; + +namespace raw { + +template +using rtree = basic_rtree; + +} + +namespace offset { + +template +using rtree = basic_rtree; + +} } // namespace cista \ No newline at end of file diff --git a/include/cista/type_hash/static_type_hash.h b/include/cista/type_hash/static_type_hash.h index 30dbe55d..e396a3b7 100644 --- a/include/cista/type_hash/static_type_hash.h +++ b/include/cista/type_hash/static_type_hash.h @@ -265,12 +265,15 @@ template constexpr hash_t static_type_hash() noexcept { return static_type_hash(null(), hash_data{}).h_; } -template +template typename VectorType> constexpr auto static_type_hash( - typename rtree::node const*, + typename basic_rtree::node const*, hash_data h) noexcept { - using rtree_t = rtree; + using rtree_t = + basic_rtree; h = h.combine(hash("rtree")); h = h.combine(MaxItems); h = static_type_hash(null(), h);