From 5f76ad1dde34fc0cf7b8ea63befa8917da94fe5c Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 20 Nov 2024 16:35:58 +0100 Subject: save before big refactor --- src/crepe/api/EventManager.h | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/crepe/api/EventManager.h') diff --git a/src/crepe/api/EventManager.h b/src/crepe/api/EventManager.h index 8fd22f4..eccb0bf 100644 --- a/src/crepe/api/EventManager.h +++ b/src/crepe/api/EventManager.h @@ -91,35 +91,28 @@ public: */ void clear(); private: + + /** + * \brief Default constructor for the EventManager. + * + * This constructor is private to enforce the singleton pattern. + */ + EventManager() = default; struct QueueEntry { std::unique_ptr event; - int channel = 0; + int channel = CHANNEL_ALL; std::type_index type; int priority = 0; }; struct CallbackEntry { std::unique_ptr callback; - int channel = 0; - std::type_index type; + int channel = CHANNEL_ALL; int priority = 0; }; - /** - * \brief Default constructor for the EventManager. - * - * This constructor is private to enforce the singleton pattern. - */ - EventManager() = default; - //! The queue of events to be processed. std::vector events_queue; //! Registered event handlers. - std::unordered_map>> - subscribers; - //! Event handlers indexed by event ID. - std::unordered_map< - std::type_index, - std::unordered_map>>> - subscribers_by_event_id; + std::unordered_map> subscribers; }; -- cgit v1.2.3