Răsfoiți Sursa

entity: make deletion_policy publicly available via fwd.hpp

Michele Caini 3 ani în urmă
părinte
comite
c68cb33751
3 a modificat fișierele cu 10 adăugiri și 8 ștergeri
  1. 1 0
      TODO
  2. 9 0
      src/entt/entity/fwd.hpp
  3. 0 8
      src/entt/entity/sparse_set.hpp

+ 1 - 0
TODO

@@ -15,6 +15,7 @@ TODO (high prio):
 * check natvis files (periodically :)
 * remove the static storage from the const assure in the registry
 * use sparse set iterator ::data to optimize range functionalities in the mixins and the registry (exploit the zero-check model)
+* can pass is_packed to clear_all to further optimize it in the derived classes
 
 WIP:
 * get rid of observers, storage based views made them pointless - document alternatives

+ 9 - 0
src/entt/entity/fwd.hpp

@@ -1,6 +1,7 @@
 #ifndef ENTT_ENTITY_FWD_HPP
 #define ENTT_ENTITY_FWD_HPP
 
+#include <cstdint>
 #include <memory>
 #include <type_traits>
 #include "../core/fwd.hpp"
@@ -11,6 +12,14 @@ namespace entt {
 /*! @brief Default entity identifier. */
 enum class entity : id_type {};
 
+/*! @brief Storage deletion policy. */
+enum class deletion_policy : std::uint8_t {
+    /*! @brief Swap-and-pop deletion policy. */
+    swap_and_pop = 0u,
+    /*! @brief In-place deletion policy. */
+    in_place = 1u
+};
+
 template<typename Entity = entity, typename = std::allocator<Entity>>
 class basic_sparse_set;
 

+ 0 - 8
src/entt/entity/sparse_set.hpp

@@ -143,14 +143,6 @@ template<typename Container>
  * @endcond
  */
 
-/*! @brief Sparse set deletion policy. */
-enum class deletion_policy : std::uint8_t {
-    /*! @brief Swap-and-pop deletion policy. */
-    swap_and_pop = 0u,
-    /*! @brief In-place deletion policy. */
-    in_place = 1u
-};
-
 /**
  * @brief Basic sparse set implementation.
  *