Explorar o código

entity: fwd declare basic_reactive_mixin and reactive_mixin

Michele Caini hai 1 ano
pai
achega
0bb22f273a
Modificáronse 2 ficheiros con 12 adicións e 0 borrados
  1. 2 0
      TODO
  2. 10 0
      src/entt/entity/fwd.hpp

+ 2 - 0
TODO

@@ -38,3 +38,5 @@ TODO:
 * organizer support to groups
 * meta range: move id to meta objects and return plain types (?), then remove id from meta base and meta ctor too
 * doc: automatic signal registration
+* refine the storage fallback mechanism for views (ie alloc?)
+* reactive_mixin: auto disconnect mechanism

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

@@ -32,6 +32,9 @@ class basic_storage;
 template<typename, typename>
 class basic_sigh_mixin;
 
+template<typename, typename>
+class basic_reactive_mixin;
+
 template<typename Entity = entity, typename = std::allocator<Entity>>
 class basic_registry;
 
@@ -79,6 +82,13 @@ using storage = basic_storage<Type>;
 template<typename Type>
 using sigh_mixin = basic_sigh_mixin<Type, basic_registry<typename Type::entity_type, typename Type::base_type::allocator_type>>;
 
+/**
+ * @brief Alias declaration for the most common use case.
+ * @tparam Type Underlying storage type.
+ */
+template<typename Type>
+using reactive_mixin = basic_reactive_mixin<Type, basic_registry<typename Type::entity_type, typename Type::base_type::allocator_type>>;
+
 /*! @brief Alias declaration for the most common use case. */
 using registry = basic_registry<>;