1
0
Эх сурвалжийг харах

dispatcher: reintroduced type_id for the internal pool

Michele Caini 6 жил өмнө
parent
commit
1e79f2441c

+ 5 - 0
src/entt/signal/dispatcher.hpp

@@ -33,6 +33,7 @@ class dispatcher {
         virtual ~basic_pool() = default;
         virtual void publish() = 0;
         virtual void clear() ENTT_NOEXCEPT = 0;
+        virtual id_type type_id() const ENTT_NOEXCEPT = 0;
     };
 
     template<typename Event>
@@ -68,6 +69,10 @@ class dispatcher {
             events.emplace_back(std::forward<Args>(args)...);
         }
 
+        id_type type_id() const ENTT_NOEXCEPT override {
+            return type_info<Event>::id();
+        }
+
     private:
         signal_type signal{};
         std::vector<Event> events;