|
|
@@ -28,46 +28,8 @@ class basic_sparse_set;
|
|
|
template<typename Type, typename = entity, typename = std::allocator<Type>, typename = void>
|
|
|
class basic_storage;
|
|
|
|
|
|
-template<typename Type>
|
|
|
-class sigh_mixin;
|
|
|
-
|
|
|
-/**
|
|
|
- * @brief Provides a common way to define storage types.
|
|
|
- * @tparam Type Storage value type.
|
|
|
- * @tparam Entity A valid entity type.
|
|
|
- * @tparam Allocator Type of allocator used to manage memory and elements.
|
|
|
- */
|
|
|
-template<typename Type, typename Entity = entity, typename Allocator = std::allocator<Type>, typename = void>
|
|
|
-struct storage_type {
|
|
|
- /*! @brief Type-to-storage conversion result. */
|
|
|
- using type = sigh_mixin<basic_storage<Type, Entity, Allocator>>;
|
|
|
-};
|
|
|
-
|
|
|
-/**
|
|
|
- * @brief Helper type.
|
|
|
- * @tparam Args Arguments to forward.
|
|
|
- */
|
|
|
-template<typename... Args>
|
|
|
-using storage_type_t = typename storage_type<Args...>::type;
|
|
|
-
|
|
|
-/**
|
|
|
- * Type-to-storage conversion utility that preserves constness.
|
|
|
- * @tparam Type Storage value type, eventually const.
|
|
|
- * @tparam Entity A valid entity type.
|
|
|
- * @tparam Allocator Type of allocator used to manage memory and elements.
|
|
|
- */
|
|
|
-template<typename Type, typename Entity = entity, typename Allocator = std::allocator<std::remove_const_t<Type>>>
|
|
|
-struct storage_for {
|
|
|
- /*! @brief Type-to-storage conversion result. */
|
|
|
- using type = constness_as_t<storage_type_t<std::remove_const_t<Type>, Entity, Allocator>, Type>;
|
|
|
-};
|
|
|
-
|
|
|
-/**
|
|
|
- * @brief Helper type.
|
|
|
- * @tparam Args Arguments to forward.
|
|
|
- */
|
|
|
-template<typename... Args>
|
|
|
-using storage_for_t = typename storage_for<Args...>::type;
|
|
|
+template<typename, typename>
|
|
|
+class basic_sigh_mixin;
|
|
|
|
|
|
template<typename Entity = entity, typename = std::allocator<Entity>>
|
|
|
class basic_registry;
|
|
|
@@ -99,6 +61,67 @@ class basic_snapshot_loader;
|
|
|
template<typename>
|
|
|
class basic_continuous_loader;
|
|
|
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using sparse_set = basic_sparse_set<>;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Alias declaration for the most common use case.
|
|
|
+ * @tparam Type Type of objects assigned to the entities.
|
|
|
+ */
|
|
|
+template<typename Type>
|
|
|
+using storage = basic_storage<Type>;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Alias declaration for the most common use case.
|
|
|
+ * @tparam Type Underlying 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. */
|
|
|
+using registry = basic_registry<>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using observer = basic_observer<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using organizer = basic_organizer<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using handle = basic_handle<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using const_handle = basic_handle<const registry>;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Alias declaration for the most common use case.
|
|
|
+ * @tparam Args Other template parameters.
|
|
|
+ */
|
|
|
+template<typename... Args>
|
|
|
+using handle_view = basic_handle<registry, Args...>;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Alias declaration for the most common use case.
|
|
|
+ * @tparam Args Other template parameters.
|
|
|
+ */
|
|
|
+template<typename... Args>
|
|
|
+using const_handle_view = basic_handle<const registry, Args...>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using snapshot = basic_snapshot<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using snapshot_loader = basic_snapshot_loader<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using continuous_loader = basic_continuous_loader<registry>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using runtime_view = basic_runtime_view<sparse_set>;
|
|
|
+
|
|
|
+/*! @brief Alias declaration for the most common use case. */
|
|
|
+using const_runtime_view = basic_runtime_view<const sparse_set>;
|
|
|
+
|
|
|
/**
|
|
|
* @brief Alias for exclusion lists.
|
|
|
* @tparam Type List of types.
|
|
|
@@ -183,53 +206,43 @@ struct type_list_transform<owned_t<Type...>, Op> {
|
|
|
using type = owned_t<typename Op<Type>::type...>;
|
|
|
};
|
|
|
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using sparse_set = basic_sparse_set<>;
|
|
|
-
|
|
|
/**
|
|
|
- * @brief Alias declaration for the most common use case.
|
|
|
- * @tparam Type Type of objects assigned to the entities.
|
|
|
+ * @brief Provides a common way to define storage types.
|
|
|
+ * @tparam Type Storage value type.
|
|
|
+ * @tparam Entity A valid entity type.
|
|
|
+ * @tparam Allocator Type of allocator used to manage memory and elements.
|
|
|
*/
|
|
|
-template<typename Type>
|
|
|
-using storage = basic_storage<Type>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using registry = basic_registry<>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using observer = basic_observer<registry>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using organizer = basic_organizer<registry>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using handle = basic_handle<registry>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using const_handle = basic_handle<const registry>;
|
|
|
+template<typename Type, typename Entity = entity, typename Allocator = std::allocator<Type>, typename = void>
|
|
|
+struct storage_type {
|
|
|
+ /*! @brief Type-to-storage conversion result. */
|
|
|
+ using type = sigh_mixin<basic_storage<Type, Entity, Allocator>>;
|
|
|
+};
|
|
|
|
|
|
/**
|
|
|
- * @brief Alias declaration for the most common use case.
|
|
|
- * @tparam Args Other template parameters.
|
|
|
+ * @brief Helper type.
|
|
|
+ * @tparam Args Arguments to forward.
|
|
|
*/
|
|
|
template<typename... Args>
|
|
|
-using handle_view = basic_handle<registry, Args...>;
|
|
|
+using storage_type_t = typename storage_type<Args...>::type;
|
|
|
|
|
|
/**
|
|
|
- * @brief Alias declaration for the most common use case.
|
|
|
- * @tparam Args Other template parameters.
|
|
|
+ * Type-to-storage conversion utility that preserves constness.
|
|
|
+ * @tparam Type Storage value type, eventually const.
|
|
|
+ * @tparam Entity A valid entity type.
|
|
|
+ * @tparam Allocator Type of allocator used to manage memory and elements.
|
|
|
*/
|
|
|
-template<typename... Args>
|
|
|
-using const_handle_view = basic_handle<const registry, Args...>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using snapshot = basic_snapshot<registry>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using snapshot_loader = basic_snapshot_loader<registry>;
|
|
|
+template<typename Type, typename Entity = entity, typename Allocator = std::allocator<std::remove_const_t<Type>>>
|
|
|
+struct storage_for {
|
|
|
+ /*! @brief Type-to-storage conversion result. */
|
|
|
+ using type = constness_as_t<storage_type_t<std::remove_const_t<Type>, Entity, Allocator>, Type>;
|
|
|
+};
|
|
|
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using continuous_loader = basic_continuous_loader<registry>;
|
|
|
+/**
|
|
|
+ * @brief Helper type.
|
|
|
+ * @tparam Args Arguments to forward.
|
|
|
+ */
|
|
|
+template<typename... Args>
|
|
|
+using storage_for_t = typename storage_for<Args...>::type;
|
|
|
|
|
|
/**
|
|
|
* @brief Alias declaration for the most common use case.
|
|
|
@@ -239,12 +252,6 @@ using continuous_loader = basic_continuous_loader<registry>;
|
|
|
template<typename Get, typename Exclude = exclude_t<>>
|
|
|
using view = basic_view<type_list_transform_t<Get, storage_for>, type_list_transform_t<Exclude, storage_for>>;
|
|
|
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using runtime_view = basic_runtime_view<sparse_set>;
|
|
|
-
|
|
|
-/*! @brief Alias declaration for the most common use case. */
|
|
|
-using const_runtime_view = basic_runtime_view<const sparse_set>;
|
|
|
-
|
|
|
/**
|
|
|
* @brief Alias declaration for the most common use case.
|
|
|
* @tparam Owned Types of storage _owned_ by the group.
|