فهرست منبع

process: prepare migration to allocator-aware model

Michele Caini 7 ماه پیش
والد
کامیت
cbb50c1292
2فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 2 2
      src/entt/process/process.hpp
  2. 4 3
      src/entt/process/scheduler.hpp

+ 2 - 2
src/entt/process/process.hpp

@@ -273,14 +273,14 @@ struct process_adaptor: public basic_process<Delta> {
     /*! @brief Base type. */
     using base_type = basic_process<Delta>;
     /*! @brief Type used to provide elapsed time. */
-    using delta_type = typename basic_process<Delta>::delta_type;
+    using delta_type = typename base_type::delta_type;
 
     /**
      * @brief Constructs a process adaptor from a lambda or a functor.
      * @param proc Actual process to use under the hood.
      */
     process_adaptor(Func proc)
-        : basic_process<Delta>{},
+        : base_type{},
           func{std::move(proc)} {}
 
     /**

+ 4 - 3
src/entt/process/scheduler.hpp

@@ -34,13 +34,14 @@ namespace entt {
  */
 template<typename Delta, typename Allocator>
 class basic_scheduler {
+    using base_type = basic_process<Delta>;
     using alloc_traits = std::allocator_traits<Allocator>;
-    using container_allocator = typename alloc_traits::template rebind_alloc<std::shared_ptr<basic_process<Delta>>>;
-    using container_type = std::vector<std::shared_ptr<basic_process<Delta>>, container_allocator>;
+    using container_allocator = typename alloc_traits::template rebind_alloc<std::shared_ptr<base_type>>;
+    using container_type = std::vector<std::shared_ptr<base_type>, container_allocator>;
 
 public:
     /*! @brief Process type. */
-    using type = basic_process<Delta>;
+    using type = base_type;
     /*! @brief Allocator type. */
     using allocator_type = Allocator;
     /*! @brief Unsigned integer type. */