Explorar o código

storage: minor changes

Michele Caini %!s(int64=4) %!d(string=hai) anos
pai
achega
7fd1858db0
Modificáronse 2 ficheiros con 22 adicións e 5 borrados
  1. 4 2
      TODO
  2. 18 3
      src/entt/entity/storage.hpp

+ 4 - 2
TODO

@@ -5,6 +5,7 @@
 * custom pools example (multi instance, tables, enable/disable, and so on...)
 * custom pools example (multi instance, tables, enable/disable, and so on...)
 
 
 WIP:
 WIP:
+* make sparse_set/storage adhere to AllocatorAwareContainer requirements
 * fast-contains for sparse sets (low prio but nice-to-have)
 * fast-contains for sparse sets (low prio but nice-to-have)
 * runtime components (registry), runtime events (dispatcher/emitter), ...
 * runtime components (registry), runtime events (dispatcher/emitter), ...
 * runtime_view/registry, remove reference to basic_sparse_set<E>
 * runtime_view/registry, remove reference to basic_sparse_set<E>
@@ -14,10 +15,11 @@ WIP:
 * custom allocators all over
 * custom allocators all over
 
 
 WIP:
 WIP:
+* customizable any_vtable, sfinae-friendly definition and op::custom for user-def
+* remove Entity from views and groups
+* registry: fake vtable (mixin injected) to get rid of poly storage, use pointer to sparse set only for pools, discard pool_data type.
 * general purpose paged vector container
 * general purpose paged vector container
-* make sparse_set/storage adhere to AllocatorAwareContainer requirements
 * make it possible to register externally managed pools with the registry (allow for system centric mode)
 * make it possible to register externally managed pools with the registry (allow for system centric mode)
-* registry: switch to the udata/mixin model and get rid of poly storage, use pointer to sparse set only for pools, discard pool_data type.
 * resource, forward the id to the loader from the cache and if constexpr the call to load, update doc and describe customization points
 * resource, forward the id to the loader from the cache and if constexpr the call to load, update doc and describe customization points
 * make it possible to create views of the type `view<T, T>`, add get by index and such, allow to register custom pools by name with the registry
 * make it possible to create views of the type `view<T, T>`, add get by index and such, allow to register custom pools by name with the registry
 * add user data to type_info
 * add user data to type_info

+ 18 - 3
src/entt/entity/storage.hpp

@@ -343,7 +343,9 @@ public:
 
 
     /*! @brief Default constructor. */
     /*! @brief Default constructor. */
     basic_storage()
     basic_storage()
-        : basic_storage{allocator_type{}}
+        : base_type{deletion_policy{comp_traits::in_place_delete::value}},
+          bucket{allocator_type{}, size_type{}},
+          packed{}
     {}
     {}
 
 
     /**
     /**
@@ -374,7 +376,7 @@ public:
     /**
     /**
      * @brief Move assignment operator.
      * @brief Move assignment operator.
      * @param other The instance to move from.
      * @param other The instance to move from.
-     * @return This sparse set.
+     * @return This storage.
      */
      */
     basic_storage & operator=(basic_storage &&other) ENTT_NOEXCEPT {
     basic_storage & operator=(basic_storage &&other) ENTT_NOEXCEPT {
         release_memory();
         release_memory();
@@ -705,7 +707,7 @@ public:
 
 
     /*! @brief Default constructor. */
     /*! @brief Default constructor. */
     basic_storage()
     basic_storage()
-        : basic_storage{allocator_type{}}
+        : base_type{deletion_policy{comp_traits::in_place_delete::value}}
     {}
     {}
 
 
     /**
     /**
@@ -716,6 +718,19 @@ public:
         : base_type{deletion_policy{comp_traits::in_place_delete::value}, allocator}
         : base_type{deletion_policy{comp_traits::in_place_delete::value}, allocator}
     {}
     {}
 
 
+    /**
+     * @brief Move constructor.
+     * @param other The instance to move from.
+     */
+    basic_storage(basic_storage &&other) ENTT_NOEXCEPT = default;
+
+    /**
+     * @brief Move assignment operator.
+     * @param other The instance to move from.
+     * @return This storage.
+     */
+    basic_storage & operator=(basic_storage &&other) ENTT_NOEXCEPT = default;
+
     /**
     /**
      * @brief Returns the associated allocator.
      * @brief Returns the associated allocator.
      * @return The associated allocator.
      * @return The associated allocator.