Răsfoiți Sursa

group/registry: minor changes

Michele Caini 3 ani în urmă
părinte
comite
61f28298c9
2 a modificat fișierele cu 6 adăugiri și 6 ștergeri
  1. 3 3
      src/entt/entity/group.hpp
  2. 3 3
      src/entt/entity/registry.hpp

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

@@ -92,7 +92,7 @@ template<typename... Lhs, typename... Rhs>
     return !(lhs == rhs);
 }
 
-struct basic_group_handler {
+struct owning_group_descriptor {
     const std::size_t size;
     bool (*const owned)(const id_type) noexcept;
     bool (*const get)(const id_type) noexcept;
@@ -103,7 +103,7 @@ template<typename, typename, typename>
 class group_handler;
 
 template<typename... Owned, typename... Get, typename... Exclude>
-class group_handler<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> final: public basic_group_handler {
+class group_handler<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> final: public owning_group_descriptor {
     // nasty workaround for an issue with the toolset v141 that doesn't accept a fold expression here
     static_assert(!std::disjunction_v<std::bool_constant<Owned::traits_type::in_place_delete>...>, "Groups do not support in-place delete");
     static_assert(!std::disjunction_v<std::is_const<Owned>..., std::is_const<Get>..., std::is_const<Exclude>...>, "Const storage type not allowed");
@@ -137,7 +137,7 @@ class group_handler<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> fin
 
 public:
     group_handler(Owned &...opool, Get &...gpool, Exclude &...epool, const void *prev, const void *next)
-        : basic_group_handler{
+        : owning_group_descriptor{
             sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude),
             +[](const id_type ctype) noexcept { return ((ctype == entt::type_hash<typename Owned::value_type>::value()) || ...); },
             +[]([[maybe_unused]] const id_type ctype) noexcept { return ((ctype == entt::type_hash<typename Get::value_type>::value()) || ...); },

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

@@ -248,7 +248,7 @@ class basic_registry {
 
     // std::shared_ptr because of its type erased allocator which is useful here
     using pool_container_type = dense_map<id_type, std::shared_ptr<base_type>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<base_type>>>>;
-    using owning_group_container_type = dense_map<id_type, std::shared_ptr<internal::basic_group_handler>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<internal::basic_group_handler>>>>;
+    using owning_group_container_type = dense_map<id_type, std::shared_ptr<internal::owning_group_descriptor>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<internal::owning_group_descriptor>>>>;
     using non_owning_group_container_type = dense_map<id_type, std::shared_ptr<void>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<void>>>>;
 
     template<typename Type>
@@ -1231,8 +1231,8 @@ public:
                         }),
                         "Conflicting groups");
 
-            const internal::basic_group_handler *prev = nullptr;
-            const internal::basic_group_handler *next = nullptr;
+            const internal::owning_group_descriptor *prev = nullptr;
+            const internal::owning_group_descriptor *next = nullptr;
 
             for(auto &&data: owning_groups) {
                 if((data.second->owned(type_hash<std::remove_const_t<Owned>>::value()) || ...)) {