aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/EventManager.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-07 14:19:16 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-07 14:19:16 +0100
commita73ff31b67faa7e6a922cfb5598f56f80bc01d62 (patch)
tree04840dfbdbe6207100fbbc2aba04f48a46de1022 /src/crepe/manager/EventManager.h
parenta0070890fcdb422db85660fc44bcc709832870b8 (diff)
added loopTimer and eventManager to mediator and removed the singletons
Diffstat (limited to 'src/crepe/manager/EventManager.h')
-rw-r--r--src/crepe/manager/EventManager.h24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/crepe/manager/EventManager.h b/src/crepe/manager/EventManager.h
index d634f54..5f8b107 100644
--- a/src/crepe/manager/EventManager.h
+++ b/src/crepe/manager/EventManager.h
@@ -8,6 +8,8 @@
#include "../api/Event.h"
#include "../api/EventHandler.h"
+#include "Manager.h"
+
namespace crepe {
//! Event listener unique ID
@@ -22,27 +24,16 @@ typedef size_t subscription_t;
typedef size_t event_channel_t;
/**
- * \class EventManager
* \brief Manages event subscriptions, triggers, and queues, enabling decoupled event handling.
*
* The `EventManager` acts as a centralized event system. It allows for registering callbacks
* for specific event types, triggering events synchronously, queueing events for later
* processing, and managing subscriptions via unique identifiers.
*/
-class EventManager {
+class EventManager : public Manager {
public:
static constexpr const event_channel_t CHANNEL_ALL = -1;
-
- /**
- * \brief Get the singleton instance of the EventManager.
- *
- * This method returns the unique instance of the EventManager, creating it if it
- * doesn't already exist. Ensures only one instance is active in the program.
- *
- * \return Reference to the singleton instance of the EventManager.
- */
- static EventManager & get_instance();
-
+ EventManager(Mediator & mediator);
/**
* \brief Subscribe to a specific event type.
*
@@ -107,12 +98,7 @@ public:
void clear();
private:
- /**
- * \brief Default constructor for the EventManager.
- *
- * Constructor is private to enforce the singleton pattern.
- */
- EventManager() = default;
+
/**
* \struct QueueEntry