Просмотр исходного кода

pool: pool_traits/pool_t -> storage_traits/storage_t

Michele Caini 5 лет назад
Родитель
Сommit
4ebdf7a6e8
4 измененных файлов с 101 добавлено и 101 удалено
  1. 47 47
      src/entt/entity/group.hpp
  2. 8 8
      src/entt/entity/pool.hpp
  3. 11 11
      src/entt/entity/registry.hpp
  4. 35 35
      src/entt/entity/view.hpp

+ 47 - 47
src/entt/entity/group.hpp

@@ -69,7 +69,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>> final {
     friend class basic_registry<Entity>;
     friend class basic_registry<Entity>;
 
 
     template<typename Component>
     template<typename Component>
-    using pool_type = pool_t<Entity, Component>;
+    using storage_type = storage_t<Entity, Component>;
 
 
     class iterable_group final {
     class iterable_group final {
         friend class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>>;
         friend class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>>;
@@ -79,7 +79,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>> final {
             friend class iterable_group;
             friend class iterable_group;
 
 
             template<typename... Args>
             template<typename... Args>
-            iterable_group_iterator(It from, const std::tuple<pool_type<Get> *...> &args) ENTT_NOEXCEPT
+            iterable_group_iterator(It from, const std::tuple<storage_type<Get> *...> &args) ENTT_NOEXCEPT
                 : it{from},
                 : it{from},
                   pools{args}
                   pools{args}
             {}
             {}
@@ -102,7 +102,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>> final {
 
 
             [[nodiscard]] reference operator*() const ENTT_NOEXCEPT {
             [[nodiscard]] reference operator*() const ENTT_NOEXCEPT {
                 const auto entt = *it;
                 const auto entt = *it;
-                return std::tuple_cat(std::make_tuple(entt), std::get<pool_type<Get> *>(pools)->get_as_tuple(entt)...);
+                return std::tuple_cat(std::make_tuple(entt), std::get<storage_type<Get> *>(pools)->get_as_tuple(entt)...);
             }
             }
 
 
             [[nodiscard]] bool operator==(const iterable_group_iterator &other) const ENTT_NOEXCEPT {
             [[nodiscard]] bool operator==(const iterable_group_iterator &other) const ENTT_NOEXCEPT {
@@ -115,10 +115,10 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>> final {
 
 
         private:
         private:
             It it;
             It it;
-            const std::tuple<pool_type<Get> *...> pools;
+            const std::tuple<storage_type<Get> *...> pools;
         };
         };
 
 
-        iterable_group(basic_sparse_set<Entity> &ref, const std::tuple<pool_type<Get> *...> &cpools)
+        iterable_group(basic_sparse_set<Entity> &ref, const std::tuple<storage_type<Get> *...> &cpools)
             : handler{&ref},
             : handler{&ref},
               pools{cpools}
               pools{cpools}
         {}
         {}
@@ -145,10 +145,10 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>> final {
 
 
     private:
     private:
         basic_sparse_set<Entity> *handler;
         basic_sparse_set<Entity> *handler;
-        const std::tuple<pool_type<Get> *...> pools;
+        const std::tuple<storage_type<Get> *...> pools;
     };
     };
 
 
-    basic_group(basic_sparse_set<Entity> &ref, pool_type<Get> &... gpool) ENTT_NOEXCEPT
+    basic_group(basic_sparse_set<Entity> &ref, storage_type<Get> &... gpool) ENTT_NOEXCEPT
         : handler{&ref},
         : handler{&ref},
           pools{&gpool...}
           pools{&gpool...}
     {}
     {}
@@ -170,7 +170,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
     [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->size();
+        return std::get<storage_type<Component> *>(pools)->size();
     }
     }
 
 
     /**
     /**
@@ -205,7 +205,7 @@ public:
         if constexpr(sizeof...(Component) == 0) {
         if constexpr(sizeof...(Component) == 0) {
             return handler->empty();
             return handler->empty();
         } else {
         } else {
-            return (std::get<pool_type<Component> *>(pools)->empty() && ...);
+            return (std::get<storage_type<Component> *>(pools)->empty() && ...);
         }
         }
     }
     }
 
 
@@ -225,7 +225,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] Component * raw() const ENTT_NOEXCEPT {
     [[nodiscard]] Component * raw() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->raw();
+        return std::get<storage_type<Component> *>(pools)->raw();
     }
     }
 
 
     /**
     /**
@@ -244,7 +244,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
     [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->data();
+        return std::get<storage_type<Component> *>(pools)->data();
     }
     }
 
 
     /**
     /**
@@ -385,11 +385,11 @@ public:
         ENTT_ASSERT(contains(entt));
         ENTT_ASSERT(contains(entt));
 
 
         if constexpr(sizeof...(Component) == 0) {
         if constexpr(sizeof...(Component) == 0) {
-            return std::tuple_cat(std::get<pool_type<Get> *>(pools)->get_as_tuple(entt)...);
+            return std::tuple_cat(std::get<storage_type<Get> *>(pools)->get_as_tuple(entt)...);
         } else if constexpr(sizeof...(Component) == 1) {
         } else if constexpr(sizeof...(Component) == 1) {
-            return (std::get<pool_type<Component> *>(pools)->get(entt), ...);
+            return (std::get<storage_type<Component> *>(pools)->get(entt), ...);
         } else {
         } else {
-            return std::tuple_cat(std::get<pool_type<Component> *>(pools)->get_as_tuple(entt)...);
+            return std::tuple_cat(std::get<storage_type<Component> *>(pools)->get_as_tuple(entt)...);
         }
         }
     }
     }
 
 
@@ -486,11 +486,11 @@ public:
             handler->sort(std::move(compare), std::move(algo), std::forward<Args>(args)...);
             handler->sort(std::move(compare), std::move(algo), std::forward<Args>(args)...);
         }  else if constexpr(sizeof...(Component) == 1) {
         }  else if constexpr(sizeof...(Component) == 1) {
             handler->sort([this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
             handler->sort([this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
-                return compare((std::get<pool_type<Component> *>(pools)->get(lhs), ...), (std::get<pool_type<Component> *>(pools)->get(rhs), ...));
+                return compare((std::get<storage_type<Component> *>(pools)->get(lhs), ...), (std::get<storage_type<Component> *>(pools)->get(rhs), ...));
             }, std::move(algo), std::forward<Args>(args)...);
             }, std::move(algo), std::forward<Args>(args)...);
         } else {
         } else {
             handler->sort([this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
             handler->sort([this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
-                return compare(std::tuple<decltype(get<Component>({}))...>{std::get<pool_type<Component> *>(pools)->get(lhs)...}, std::tuple<decltype(get<Component>({}))...>{std::get<pool_type<Component> *>(pools)->get(rhs)...});
+                return compare(std::forward_as_tuple(std::get<storage_type<Component> *>(pools)->get(lhs)...), std::forward_as_tuple(std::get<storage_type<Component> *>(pools)->get(rhs)...));
             }, std::move(algo), std::forward<Args>(args)...);
             }, std::move(algo), std::forward<Args>(args)...);
         }
         }
     }
     }
@@ -513,12 +513,12 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     void sort() const {
     void sort() const {
-        handler->respect(*std::get<pool_type<Component> *>(pools));
+        handler->respect(*std::get<storage_type<Component> *>(pools));
     }
     }
 
 
 private:
 private:
     basic_sparse_set<entity_type> *handler;
     basic_sparse_set<entity_type> *handler;
-    const std::tuple<pool_type<Get> *...> pools;
+    const std::tuple<storage_type<Get> *...> pools;
 };
 };
 
 
 
 
@@ -574,7 +574,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...> final
     friend class basic_registry<Entity>;
     friend class basic_registry<Entity>;
 
 
     template<typename Component>
     template<typename Component>
-    using pool_type = pool_t<Entity, Component>;
+    using storage_type = storage_t<Entity, Component>;
 
 
     class iterable_group final {
     class iterable_group final {
         friend class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...>;
         friend class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...>;
@@ -587,7 +587,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...> final
             friend class iterable_group;
             friend class iterable_group;
 
 
             template<typename... Other>
             template<typename... Other>
-            iterable_group_iterator(It from, const std::tuple<Other...> &other, const std::tuple<pool_type<Get> *...> &cpools) ENTT_NOEXCEPT
+            iterable_group_iterator(It from, const std::tuple<Other...> &other, const std::tuple<storage_type<Get> *...> &cpools) ENTT_NOEXCEPT
                 : it{from},
                 : it{from},
                   owned{std::get<OIt>(other)...},
                   owned{std::get<OIt>(other)...},
                   get{cpools}
                   get{cpools}
@@ -613,7 +613,7 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...> final
                 return std::tuple_cat(
                 return std::tuple_cat(
                     std::make_tuple(*it),
                     std::make_tuple(*it),
                     std::forward_as_tuple(*std::get<OIt>(owned)...),
                     std::forward_as_tuple(*std::get<OIt>(owned)...),
-                    std::get<pool_type<Get> *>(get)->get_as_tuple(*it)...
+                    std::get<storage_type<Get> *>(get)->get_as_tuple(*it)...
                 );
                 );
             }
             }
 
 
@@ -628,10 +628,10 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...> final
         private:
         private:
             It it;
             It it;
             std::tuple<OIt...> owned;
             std::tuple<OIt...> owned;
-            std::tuple<pool_type<Get> *...> get;
+            std::tuple<storage_type<Get> *...> get;
         };
         };
 
 
-        iterable_group(std::tuple<pool_type<Owned> *..., pool_type<Get> *...> cpools, const std::size_t &extent)
+        iterable_group(std::tuple<storage_type<Owned> *..., storage_type<Get> *...> cpools, const std::size_t &extent)
             : pools{cpools},
             : pools{cpools},
               length{&extent}
               length{&extent}
         {}
         {}
@@ -639,51 +639,51 @@ class basic_group<Entity, exclude_t<Exclude...>, get_t<Get...>, Owned...> final
     public:
     public:
         using iterator = iterable_group_iterator<
         using iterator = iterable_group_iterator<
             typename basic_sparse_set<Entity>::iterator,
             typename basic_sparse_set<Entity>::iterator,
-            type_list_cat_t<std::conditional_t<std::tuple_size_v<decltype(std::declval<pool_type<Owned>>().get_as_tuple({}))> == 0, type_list<>, type_list<decltype(std::declval<pool_type<Owned>>().end())>>...>
+            type_list_cat_t<std::conditional_t<std::tuple_size_v<decltype(std::declval<storage_type<Owned>>().get_as_tuple({}))> == 0, type_list<>, type_list<decltype(std::declval<storage_type<Owned>>().end())>>...>
         >;
         >;
         using reverse_iterator = iterable_group_iterator<
         using reverse_iterator = iterable_group_iterator<
             typename basic_sparse_set<Entity>::reverse_iterator,
             typename basic_sparse_set<Entity>::reverse_iterator,
-            type_list_cat_t<std::conditional_t<std::tuple_size_v<decltype(std::declval<pool_type<Owned>>().get_as_tuple({}))> == 0, type_list<>, type_list<decltype(std::declval<pool_type<Owned>>().rbegin())>>...>
+            type_list_cat_t<std::conditional_t<std::tuple_size_v<decltype(std::declval<storage_type<Owned>>().get_as_tuple({}))> == 0, type_list<>, type_list<decltype(std::declval<storage_type<Owned>>().rbegin())>>...>
         >;
         >;
 
 
         [[nodiscard]] iterator begin() const ENTT_NOEXCEPT {
         [[nodiscard]] iterator begin() const ENTT_NOEXCEPT {
             return {
             return {
                 std::get<0>(pools)->basic_sparse_set<Entity>::end() - *length,
                 std::get<0>(pools)->basic_sparse_set<Entity>::end() - *length,
-                std::make_tuple((std::get<pool_type<Owned> *>(pools)->end() - *length)...),
-                std::make_tuple(std::get<pool_type<Get> *>(pools)...)
+                std::make_tuple((std::get<storage_type<Owned> *>(pools)->end() - *length)...),
+                std::make_tuple(std::get<storage_type<Get> *>(pools)...)
             };
             };
         }
         }
 
 
         [[nodiscard]] iterator end() const ENTT_NOEXCEPT {
         [[nodiscard]] iterator end() const ENTT_NOEXCEPT {
             return {
             return {
                 std::get<0>(pools)->basic_sparse_set<Entity>::end(),
                 std::get<0>(pools)->basic_sparse_set<Entity>::end(),
-                std::make_tuple((std::get<pool_type<Owned> *>(pools)->end())...),
-                std::make_tuple(std::get<pool_type<Get> *>(pools)...)
+                std::make_tuple((std::get<storage_type<Owned> *>(pools)->end())...),
+                std::make_tuple(std::get<storage_type<Get> *>(pools)...)
             };
             };
         }
         }
 
 
         [[nodiscard]] reverse_iterator rbegin() const ENTT_NOEXCEPT {
         [[nodiscard]] reverse_iterator rbegin() const ENTT_NOEXCEPT {
             return {
             return {
                 std::get<0>(pools)->basic_sparse_set<Entity>::rbegin(),
                 std::get<0>(pools)->basic_sparse_set<Entity>::rbegin(),
-                std::make_tuple((std::get<pool_type<Owned> *>(pools)->rbegin())...),
-                std::make_tuple(std::get<pool_type<Get> *>(pools)...)
+                std::make_tuple((std::get<storage_type<Owned> *>(pools)->rbegin())...),
+                std::make_tuple(std::get<storage_type<Get> *>(pools)...)
             };
             };
         }
         }
 
 
         [[nodiscard]] reverse_iterator rend() const ENTT_NOEXCEPT {
         [[nodiscard]] reverse_iterator rend() const ENTT_NOEXCEPT {
             return {
             return {
                 std::get<0>(pools)->basic_sparse_set<Entity>::rbegin() + *length,
                 std::get<0>(pools)->basic_sparse_set<Entity>::rbegin() + *length,
-                std::make_tuple((std::get<pool_type<Owned> *>(pools)->rbegin() + *length)...),
-                std::make_tuple(std::get<pool_type<Get> *>(pools)...)
+                std::make_tuple((std::get<storage_type<Owned> *>(pools)->rbegin() + *length)...),
+                std::make_tuple(std::get<storage_type<Get> *>(pools)...)
             };
             };
         }
         }
 
 
     private:
     private:
-        const std::tuple<pool_type<Owned> *..., pool_type<Get> *...> pools;
+        const std::tuple<storage_type<Owned> *..., storage_type<Get> *...> pools;
         const std::size_t *length;
         const std::size_t *length;
     };
     };
 
 
-    basic_group(const std::size_t &extent, pool_type<Owned> &... opool, pool_type<Get> &... gpool) ENTT_NOEXCEPT
+    basic_group(const std::size_t &extent, storage_type<Owned> &... opool, storage_type<Get> &... gpool) ENTT_NOEXCEPT
         : pools{&opool..., &gpool...},
         : pools{&opool..., &gpool...},
           length{&extent}
           length{&extent}
     {}
     {}
@@ -705,7 +705,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
     [[nodiscard]] size_type size() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->size();
+        return std::get<storage_type<Component> *>(pools)->size();
     }
     }
 
 
     /**
     /**
@@ -726,7 +726,7 @@ public:
         if constexpr(sizeof...(Component) == 0) {
         if constexpr(sizeof...(Component) == 0) {
             return !*length;
             return !*length;
         } else {
         } else {
-            return (std::get<pool_type<Component> *>(pools)->empty() && ...);
+            return (std::get<storage_type<Component> *>(pools)->empty() && ...);
         }
         }
     }
     }
 
 
@@ -749,7 +749,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] Component * raw() const ENTT_NOEXCEPT {
     [[nodiscard]] Component * raw() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->raw();
+        return std::get<storage_type<Component> *>(pools)->raw();
     }
     }
 
 
     /**
     /**
@@ -771,7 +771,7 @@ public:
      */
      */
     template<typename Component>
     template<typename Component>
     [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
     [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
-        return std::get<pool_type<Component> *>(pools)->data();
+        return std::get<storage_type<Component> *>(pools)->data();
     }
     }
 
 
     /**
     /**
@@ -920,9 +920,9 @@ public:
                 }
                 }
             };
             };
 
 
-            return std::tuple_cat(filter(std::get<pool_type<Owned> *>(pools))..., filter(std::get<pool_type<Get> *>(pools))...);
+            return std::tuple_cat(filter(std::get<storage_type<Owned> *>(pools))..., filter(std::get<storage_type<Get> *>(pools))...);
         } else if constexpr(sizeof...(Component) == 1) {
         } else if constexpr(sizeof...(Component) == 1) {
-            return (std::get<pool_type<Component> *>(pools)->get(entt), ...);
+            return (std::get<storage_type<Component> *>(pools)->get(entt), ...);
         } else {
         } else {
             return std::forward_as_tuple(get<Component>(entt)...);
             return std::forward_as_tuple(get<Component>(entt)...);
         }
         }
@@ -958,10 +958,10 @@ public:
             } else {
             } else {
                 return std::make_tuple(cpool->end() - length);
                 return std::make_tuple(cpool->end() - length);
             }
             }
-        }(std::get<pool_type<Owned> *>(pools))...);
+        }(std::get<storage_type<Owned> *>(pools))...);
 
 
         for(const auto entt: *this) {
         for(const auto entt: *this) {
-            auto args = std::tuple_cat(std::apply([](auto &&... curr) { return std::forward_as_tuple(*curr++...); }, owned), std::get<pool_type<Get> *>(pools)->get_as_tuple(entt)...);
+            auto args = std::tuple_cat(std::apply([](auto &&... curr) { return std::forward_as_tuple(*curr++...); }, owned), std::get<storage_type<Get> *>(pools)->get_as_tuple(entt)...);
 
 
             if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
             if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
                 std::apply(func, std::tuple_cat(std::make_tuple(entt), args));
                 std::apply(func, std::tuple_cat(std::make_tuple(entt), args));
@@ -1034,11 +1034,11 @@ public:
             cpool->sort_n(*length, std::move(compare), std::move(algo), std::forward<Args>(args)...);
             cpool->sort_n(*length, std::move(compare), std::move(algo), std::forward<Args>(args)...);
         } else if constexpr(sizeof...(Component) == 1) {
         } else if constexpr(sizeof...(Component) == 1) {
             cpool->sort_n(*length, [this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
             cpool->sort_n(*length, [this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
-                return compare((std::get<pool_type<Component> *>(pools)->get(lhs), ...), (std::get<pool_type<Component> *>(pools)->get(rhs), ...));
+                return compare((std::get<storage_type<Component> *>(pools)->get(lhs), ...), (std::get<storage_type<Component> *>(pools)->get(rhs), ...));
             }, std::move(algo), std::forward<Args>(args)...);
             }, std::move(algo), std::forward<Args>(args)...);
         } else {
         } else {
             cpool->sort_n(*length, [this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
             cpool->sort_n(*length, [this, compare = std::move(compare)](const entity_type lhs, const entity_type rhs) {
-                return compare(std::tuple<decltype(get<Component>({}))...>{std::get<pool_type<Component> *>(pools)->get(lhs)...}, std::tuple<decltype(get<Component>({}))...>{std::get<pool_type<Component> *>(pools)->get(rhs)...});
+                return compare(std::forward_as_tuple(std::get<storage_type<Component> *>(pools)->get(lhs)...), std::forward_as_tuple(std::get<storage_type<Component> *>(pools)->get(rhs)...));
             }, std::move(algo), std::forward<Args>(args)...);
             }, std::move(algo), std::forward<Args>(args)...);
         }
         }
 
 
@@ -1048,11 +1048,11 @@ public:
                 [[maybe_unused]] const auto entt = head->data()[pos];
                 [[maybe_unused]] const auto entt = head->data()[pos];
                 (other->swap(other->data()[pos], entt), ...);
                 (other->swap(other->data()[pos], entt), ...);
             }
             }
-        }(std::get<pool_type<Owned> *>(pools)...);
+        }(std::get<storage_type<Owned> *>(pools)...);
     }
     }
 
 
 private:
 private:
-    const std::tuple<pool_type<Owned> *..., pool_type<Get> *...> pools;
+    const std::tuple<storage_type<Owned> *..., storage_type<Get> *...> pools;
     const size_type *length;
     const size_type *length;
 };
 };
 
 

+ 8 - 8
src/entt/entity/pool.hpp

@@ -275,27 +275,27 @@ private:
  * @tparam Type Type of objects assigned to the entities.
  * @tparam Type Type of objects assigned to the entities.
  */
  */
 template<typename Entity, typename Type, typename = void>
 template<typename Entity, typename Type, typename = void>
-struct pool_traits {
-    /*! @brief Resulting type after component-to-pool conversion. */
+struct storage_traits {
+    /*! @brief Resulting type after component-to-storage conversion. */
     using value_type = sigh_storage_mixin<storage_adapter_mixin<basic_storage<Entity, Type>>>;
     using value_type = sigh_storage_mixin<storage_adapter_mixin<basic_storage<Entity, Type>>>;
 };
 };
 
 
 
 
-/*! @copydoc pool_traits */
+/*! @copydoc storage_traits */
 template<typename Entity, typename Type>
 template<typename Entity, typename Type>
-struct pool_traits<Entity, const Type> {
-    /*! @brief Resulting type after component-to-pool conversion. */
-    using value_type = std::add_const_t<typename pool_traits<Entity, std::remove_const_t<Type>>::value_type>;
+struct storage_traits<Entity, const Type> {
+    /*! @brief Resulting type after component-to-storage conversion. */
+    using value_type = std::add_const_t<typename storage_traits<Entity, std::remove_const_t<Type>>::value_type>;
 };
 };
 
 
 
 
 /**
 /**
- * @brief Alias declaration to use to make component-to-pool conversions.
+ * @brief Alias declaration to use to make component-to-storage conversions.
  * @tparam Entity A valid entity type (see entt_traits for more details).
  * @tparam Entity A valid entity type (see entt_traits for more details).
  * @tparam Type Type of objects assigned to the entities.
  * @tparam Type Type of objects assigned to the entities.
  */
  */
 template<typename Entity, typename Type>
 template<typename Entity, typename Type>
-using pool_t = typename pool_traits<Entity, Type>::value_type;
+using storage_t = typename storage_traits<Entity, Type>::value_type;
 
 
 
 
 }
 }

+ 11 - 11
src/entt/entity/registry.hpp

@@ -60,7 +60,7 @@ class basic_registry {
         void maybe_valid_if(basic_registry &owner, const Entity entt) {
         void maybe_valid_if(basic_registry &owner, const Entity entt) {
             [[maybe_unused]] const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...);
             [[maybe_unused]] const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...);
 
 
-            const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<pool_t<Entity, Owned> &>(cpools).contains(entt)) && ...)
+            const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<storage_t<Entity, Owned> &>(cpools).contains(entt)) && ...)
                     && ((std::is_same_v<Component, Get> || owner.assure<Get>().contains(entt)) && ...)
                     && ((std::is_same_v<Component, Get> || owner.assure<Get>().contains(entt)) && ...)
                     && ((std::is_same_v<Component, Exclude> || !owner.assure<Exclude>().contains(entt)) && ...);
                     && ((std::is_same_v<Component, Exclude> || !owner.assure<Exclude>().contains(entt)) && ...);
 
 
@@ -71,7 +71,7 @@ class basic_registry {
             } else {
             } else {
                 if(is_valid && !(std::get<0>(cpools).index(entt) < current)) {
                 if(is_valid && !(std::get<0>(cpools).index(entt) < current)) {
                     const auto pos = current++;
                     const auto pos = current++;
-                    (std::get<pool_t<Entity, Owned> &>(cpools).swap(std::get<pool_t<Entity, Owned> &>(cpools).data()[pos], entt), ...);
+                    (std::get<storage_t<Entity, Owned> &>(cpools).swap(std::get<storage_t<Entity, Owned> &>(cpools).data()[pos], entt), ...);
                 }
                 }
             }
             }
         }
         }
@@ -84,7 +84,7 @@ class basic_registry {
             } else {
             } else {
                 if(const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...); std::get<0>(cpools).contains(entt) && (std::get<0>(cpools).index(entt) < current)) {
                 if(const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...); std::get<0>(cpools).contains(entt) && (std::get<0>(cpools).index(entt) < current)) {
                     const auto pos = --current;
                     const auto pos = --current;
-                    (std::get<pool_t<Entity, Owned> &>(cpools).swap(std::get<pool_t<Entity, Owned> &>(cpools).data()[pos], entt), ...);
+                    (std::get<storage_t<Entity, Owned> &>(cpools).swap(std::get<storage_t<Entity, Owned> &>(cpools).data()[pos], entt), ...);
                 }
                 }
             }
             }
         }
         }
@@ -104,7 +104,7 @@ class basic_registry {
     };
     };
 
 
     template<typename Component>
     template<typename Component>
-    [[nodiscard]] const pool_t<Entity, Component> & assure() const {
+    [[nodiscard]] const storage_t<Entity, Component> & assure() const {
         const auto index = type_seq<Component>::value();
         const auto index = type_seq<Component>::value();
 
 
         if(!(index < pools.size())) {
         if(!(index < pools.size())) {
@@ -113,18 +113,18 @@ class basic_registry {
 
 
         if(auto &&pdata = pools[index]; !pdata.pool) {
         if(auto &&pdata = pools[index]; !pdata.pool) {
             pdata.info = type_id<Component>();
             pdata.info = type_id<Component>();
-            pdata.pool.reset(new pool_t<Entity, Component>());
+            pdata.pool.reset(new storage_t<Entity, Component>());
             pdata.remove = +[](basic_sparse_set<Entity> &cpool, basic_registry &owner, const Entity *first, const Entity *last) {
             pdata.remove = +[](basic_sparse_set<Entity> &cpool, basic_registry &owner, const Entity *first, const Entity *last) {
-                static_cast<pool_t<Entity, Component> &>(cpool).remove(owner, first, last);
+                static_cast<storage_t<Entity, Component> &>(cpool).remove(owner, first, last);
             };
             };
         }
         }
 
 
-        return static_cast<const pool_t<Entity, Component> &>(*pools[index].pool);
+        return static_cast<const storage_t<Entity, Component> &>(*pools[index].pool);
     }
     }
 
 
     template<typename Component>
     template<typename Component>
-    [[nodiscard]] pool_t<Entity, Component> & assure() {
-        return const_cast<pool_t<Entity, Component> &>(std::as_const(*this).template assure<Component>());
+    [[nodiscard]] storage_t<Entity, Component> & assure() {
+        return const_cast<storage_t<Entity, Component> &>(std::as_const(*this).template assure<Component>());
     }
     }
 
 
     Entity generate_identifier() {
     Entity generate_identifier() {
@@ -1257,9 +1257,9 @@ public:
         }
         }
 
 
         if constexpr(sizeof...(Owned) == 0) {
         if constexpr(sizeof...(Owned) == 0) {
-            return { handler->current, std::get<pool_t<Entity, std::decay_t<Get>> &>(cpools)... };
+            return { handler->current, std::get<storage_t<Entity, std::decay_t<Get>> &>(cpools)... };
         } else {
         } else {
-            return { handler->current, std::get<pool_t<Entity, std::decay_t<Owned>> &>(cpools)... , std::get<pool_t<Entity, std::decay_t<Get>> &>(cpools)... };
+            return { handler->current, std::get<storage_t<Entity, std::decay_t<Owned>> &>(cpools)... , std::get<storage_t<Entity, std::decay_t<Get>> &>(cpools)... };
         }
         }
     }
     }
 
 

+ 35 - 35
src/entt/entity/view.hpp

@@ -69,7 +69,7 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
     friend class basic_registry<Entity>;
     friend class basic_registry<Entity>;
 
 
     template<typename Comp>
     template<typename Comp>
-    using pool_type = pool_t<Entity, Comp>;
+    using storage_type = storage_t<Entity, Comp>;
 
 
     using unchecked_type = std::array<const basic_sparse_set<Entity> *, (sizeof...(Component) - 1)>;
     using unchecked_type = std::array<const basic_sparse_set<Entity> *, (sizeof...(Component) - 1)>;
 
 
@@ -77,7 +77,7 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
     class view_iterator final {
     class view_iterator final {
         friend class basic_view<Entity, exclude_t<Exclude...>, Component...>;
         friend class basic_view<Entity, exclude_t<Exclude...>, Component...>;
 
 
-        view_iterator(It from, It to, It curr, unchecked_type other, const std::tuple<const pool_type<Exclude> *...> &ignore) ENTT_NOEXCEPT
+        view_iterator(It from, It to, It curr, unchecked_type other, const std::tuple<const storage_type<Exclude> *...> &ignore) ENTT_NOEXCEPT
             : first{from},
             : first{from},
               last{to},
               last{to},
               it{curr},
               it{curr},
@@ -93,7 +93,7 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
             const auto entt = *it;
             const auto entt = *it;
 
 
             return std::all_of(unchecked.cbegin(), unchecked.cend(), [entt](const basic_sparse_set<Entity> *curr) { return curr->contains(entt); })
             return std::all_of(unchecked.cbegin(), unchecked.cend(), [entt](const basic_sparse_set<Entity> *curr) { return curr->contains(entt); })
-                && !(std::get<const pool_type<Exclude> *>(filter)->contains(entt) || ...);
+                && !(std::get<const storage_type<Exclude> *>(filter)->contains(entt) || ...);
         }
         }
 
 
     public:
     public:
@@ -146,7 +146,7 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
         It last;
         It last;
         It it;
         It it;
         unchecked_type unchecked;
         unchecked_type unchecked;
-        std::tuple<const pool_type<Exclude> *...> filter;
+        std::tuple<const storage_type<Exclude> *...> filter;
     };
     };
 
 
     class iterable_view final {
     class iterable_view final {
@@ -222,14 +222,14 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
         const basic_view view;
         const basic_view view;
     };
     };
 
 
-    basic_view(pool_type<Component> &... component, const pool_type<Exclude> &... epool) ENTT_NOEXCEPT
+    basic_view(storage_type<Component> &... component, const storage_type<Exclude> &... epool) ENTT_NOEXCEPT
         : pools{&component...},
         : pools{&component...},
           filter{&epool...},
           filter{&epool...},
           view{candidate()}
           view{candidate()}
     {}
     {}
 
 
     [[nodiscard]] const basic_sparse_set<Entity> * candidate() const ENTT_NOEXCEPT {
     [[nodiscard]] const basic_sparse_set<Entity> * candidate() const ENTT_NOEXCEPT {
-        return (std::min)({ static_cast<const basic_sparse_set<entity_type> *>(std::get<pool_type<Component> *>(pools))... }, [](const auto *lhs, const auto *rhs) {
+        return (std::min)({ static_cast<const basic_sparse_set<entity_type> *>(std::get<storage_type<Component> *>(pools))... }, [](const auto *lhs, const auto *rhs) {
             return lhs->size() < rhs->size();
             return lhs->size() < rhs->size();
         });
         });
     }
     }
@@ -237,7 +237,7 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
     [[nodiscard]] unchecked_type unchecked(const basic_sparse_set<Entity> *cpool) const {
     [[nodiscard]] unchecked_type unchecked(const basic_sparse_set<Entity> *cpool) const {
         std::size_t pos{};
         std::size_t pos{};
         unchecked_type other{};
         unchecked_type other{};
-        ((std::get<pool_type<Component> *>(pools) == cpool ? nullptr : (other[pos] = std::get<pool_type<Component> *>(pools), other[pos++])), ...);
+        ((std::get<storage_type<Component> *>(pools) == cpool ? nullptr : (other[pos] = std::get<storage_type<Component> *>(pools), other[pos++])), ...);
         return other;
         return other;
     }
     }
 
 
@@ -252,10 +252,10 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
 
 
     template<typename Comp, typename Func>
     template<typename Comp, typename Func>
     void traverse(Func func) const {
     void traverse(Func func) const {
-        if constexpr(std::tuple_size_v<decltype(std::declval<pool_type<Comp>>().get_as_tuple({}))> == 0) {
-            for(const auto entt: static_cast<const basic_sparse_set<entity_type> &>(*std::get<pool_type<Comp> *>(pools))) {
-                if(((std::is_same_v<Comp, Component> || std::get<pool_type<Component> *>(pools)->contains(entt)) && ...)
-                    && !(std::get<const pool_type<Exclude> *>(filter)->contains(entt) || ...))
+        if constexpr(std::tuple_size_v<decltype(std::declval<storage_type<Comp>>().get_as_tuple({}))> == 0) {
+            for(const auto entt: static_cast<const basic_sparse_set<entity_type> &>(*std::get<storage_type<Comp> *>(pools))) {
+                if(((std::is_same_v<Comp, Component> || std::get<storage_type<Component> *>(pools)->contains(entt)) && ...)
+                    && !(std::get<const storage_type<Exclude> *>(filter)->contains(entt) || ...))
                 {
                 {
                     if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
                     if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
                         std::apply(func, std::tuple_cat(std::make_tuple(entt), get(entt)));
                         std::apply(func, std::tuple_cat(std::make_tuple(entt), get(entt)));
@@ -265,16 +265,16 @@ class basic_view<Entity, exclude_t<Exclude...>, Component...> final {
                 }
                 }
             }
             }
         } else {
         } else {
-            auto it = std::get<pool_type<Comp> *>(pools)->begin();
+            auto it = std::get<storage_type<Comp> *>(pools)->begin();
 
 
-            for(const auto entt: static_cast<const basic_sparse_set<entity_type> &>(*std::get<pool_type<Comp> *>(pools))) {
-                if(((std::is_same_v<Comp, Component> || std::get<pool_type<Component> *>(pools)->contains(entt)) && ...)
-                    && !(std::get<const pool_type<Exclude> *>(filter)->contains(entt) || ...))
+            for(const auto entt: static_cast<const basic_sparse_set<entity_type> &>(*std::get<storage_type<Comp> *>(pools))) {
+                if(((std::is_same_v<Comp, Component> || std::get<storage_type<Component> *>(pools)->contains(entt)) && ...)
+                    && !(std::get<const storage_type<Exclude> *>(filter)->contains(entt) || ...))
                 {
                 {
                     if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
                     if constexpr(is_applicable_v<Func, decltype(std::tuple_cat(std::make_tuple(entt), get({})))>) {
-                        std::apply(func, std::tuple_cat(std::make_tuple(entt), get_as_tuple(it, std::get<pool_type<Component> *>(pools), entt)...));
+                        std::apply(func, std::tuple_cat(std::make_tuple(entt), get_as_tuple(it, std::get<storage_type<Component> *>(pools), entt)...));
                     } else {
                     } else {
-                        std::apply(func, std::tuple_cat(get_as_tuple(it, std::get<pool_type<Component> *>(pools), entt)...));
+                        std::apply(func, std::tuple_cat(get_as_tuple(it, std::get<storage_type<Component> *>(pools), entt)...));
                     }
                     }
                 }
                 }
 
 
@@ -299,7 +299,7 @@ public:
      */
      */
     template<typename Comp>
     template<typename Comp>
     void use() const ENTT_NOEXCEPT {
     void use() const ENTT_NOEXCEPT {
-        view = std::get<pool_type<Comp> *>(pools);
+        view = std::get<storage_type<Comp> *>(pools);
     }
     }
 
 
     /**
     /**
@@ -307,7 +307,7 @@ public:
      * @return Estimated number of entities iterated by the view.
      * @return Estimated number of entities iterated by the view.
      */
      */
     [[nodiscard]] size_type size_hint() const ENTT_NOEXCEPT {
     [[nodiscard]] size_type size_hint() const ENTT_NOEXCEPT {
-        return (std::min)({ std::get<pool_type<Component> *>(pools)->size()... });
+        return (std::min)({ std::get<storage_type<Component> *>(pools)->size()... });
     }
     }
 
 
     /**
     /**
@@ -399,7 +399,7 @@ public:
      * @return True if the view contains the given entity, false otherwise.
      * @return True if the view contains the given entity, false otherwise.
      */
      */
     [[nodiscard]] bool contains(const entity_type entt) const {
     [[nodiscard]] bool contains(const entity_type entt) const {
-        return (std::get<pool_type<Component> *>(pools)->contains(entt) && ...) && !(std::get<const pool_type<Exclude> *>(filter)->contains(entt) || ...);
+        return (std::get<storage_type<Component> *>(pools)->contains(entt) && ...) && !(std::get<const storage_type<Exclude> *>(filter)->contains(entt) || ...);
     }
     }
 
 
     /**
     /**
@@ -422,11 +422,11 @@ public:
         ENTT_ASSERT(contains(entt));
         ENTT_ASSERT(contains(entt));
 
 
         if constexpr(sizeof...(Comp) == 0) {
         if constexpr(sizeof...(Comp) == 0) {
-            return std::tuple_cat(std::get<pool_type<Component> *>(pools)->get_as_tuple(entt)...);
+            return std::tuple_cat(std::get<storage_type<Component> *>(pools)->get_as_tuple(entt)...);
         } else if constexpr(sizeof...(Comp) == 1) {
         } else if constexpr(sizeof...(Comp) == 1) {
-            return (std::get<pool_type<Comp> *>(pools)->get(entt), ...);
+            return (std::get<storage_type<Comp> *>(pools)->get(entt), ...);
         } else {
         } else {
-            return std::tuple_cat(std::get<pool_type<Comp> *>(pools)->get_as_tuple(entt)...);
+            return std::tuple_cat(std::get<storage_type<Comp> *>(pools)->get_as_tuple(entt)...);
         }
         }
     }
     }
 
 
@@ -454,7 +454,7 @@ public:
      */
      */
     template<typename Func>
     template<typename Func>
     void each(Func func) const {
     void each(Func func) const {
-        ((std::get<pool_type<Component> *>(pools) == view ? traverse<Component>(std::move(func)) : void()), ...);
+        ((std::get<storage_type<Component> *>(pools) == view ? traverse<Component>(std::move(func)) : void()), ...);
     }
     }
 
 
     /**
     /**
@@ -517,8 +517,8 @@ public:
     }
     }
 
 
 private:
 private:
-    const std::tuple<pool_type<Component> *...> pools;
-    const std::tuple<const pool_type<Exclude> *...> filter;
+    const std::tuple<storage_type<Component> *...> pools;
+    const std::tuple<const storage_type<Exclude> *...> filter;
     mutable const basic_sparse_set<entity_type>* view;
     mutable const basic_sparse_set<entity_type>* view;
 };
 };
 
 
@@ -559,7 +559,7 @@ class basic_view<Entity, exclude_t<>, Component> final {
     /*! @brief A registry is allowed to create views. */
     /*! @brief A registry is allowed to create views. */
     friend class basic_registry<Entity>;
     friend class basic_registry<Entity>;
 
 
-    using pool_type = pool_t<Entity, Component>;
+    using storage_type = storage_t<Entity, Component>;
 
 
     class iterable_view {
     class iterable_view {
         friend class basic_view<Entity, exclude_t<>, Component>;
         friend class basic_view<Entity, exclude_t<>, Component>;
@@ -605,20 +605,20 @@ class basic_view<Entity, exclude_t<>, Component> final {
             std::tuple<It...> it;
             std::tuple<It...> it;
         };
         };
 
 
-        iterable_view(pool_type &ref)
+        iterable_view(storage_type &ref)
             : pool{&ref}
             : pool{&ref}
         {}
         {}
 
 
     public:
     public:
         using iterator = std::conditional_t<
         using iterator = std::conditional_t<
-            std::tuple_size_v<decltype(std::declval<pool_type>().get_as_tuple({}))> == 0,
+            std::tuple_size_v<decltype(std::declval<storage_type>().get_as_tuple({}))> == 0,
             iterable_view_iterator<typename basic_sparse_set<Entity>::iterator>,
             iterable_view_iterator<typename basic_sparse_set<Entity>::iterator>,
-            iterable_view_iterator<typename basic_sparse_set<Entity>::iterator, decltype(std::declval<pool_type>().begin())>
+            iterable_view_iterator<typename basic_sparse_set<Entity>::iterator, decltype(std::declval<storage_type>().begin())>
         >;
         >;
         using reverse_iterator = std::conditional_t<
         using reverse_iterator = std::conditional_t<
-            std::tuple_size_v<decltype(std::declval<pool_type>().get_as_tuple({}))> == 0,
+            std::tuple_size_v<decltype(std::declval<storage_type>().get_as_tuple({}))> == 0,
             iterable_view_iterator<typename basic_sparse_set<Entity>::reverse_iterator>,
             iterable_view_iterator<typename basic_sparse_set<Entity>::reverse_iterator>,
-            iterable_view_iterator<typename basic_sparse_set<Entity>::reverse_iterator, decltype(std::declval<pool_type>().rbegin())>
+            iterable_view_iterator<typename basic_sparse_set<Entity>::reverse_iterator, decltype(std::declval<storage_type>().rbegin())>
         >;
         >;
 
 
         [[nodiscard]] iterator begin() const ENTT_NOEXCEPT {
         [[nodiscard]] iterator begin() const ENTT_NOEXCEPT {
@@ -638,10 +638,10 @@ class basic_view<Entity, exclude_t<>, Component> final {
         }
         }
 
 
     private:
     private:
-        pool_type *pool;
+        storage_type *pool;
     };
     };
 
 
-    basic_view(pool_type &ref) ENTT_NOEXCEPT
+    basic_view(storage_type &ref) ENTT_NOEXCEPT
         : pool{&ref}
         : pool{&ref}
     {}
     {}
 
 
@@ -896,7 +896,7 @@ public:
     }
     }
 
 
 private:
 private:
-    pool_type *pool;
+    storage_type *pool;
 };
 };