Ocular Engine
EventManager.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_EVENTS_EVENT_MANAGER__H__
19 #define __H__OCULAR_EVENTS_EVENT_MANAGER__H__
20 
21 #include <memory>
22 #include "AEventListener.hpp"
23 #include "Utilities/Structures/PriorityMultiQueue.hpp"
24 #include "Utilities/Structures/PriorityList.hpp"
25 
26 //------------------------------------------------------------------------------------------
27 
32 namespace Ocular
33 {
38  namespace Core
39  {
44  {
45  public:
46 
47  EventManager();
48  ~EventManager();
49 
50  void processEvents(uint64_t duration);
51 
52  void registerListener(AEventListener* listener, uint32_t const priority);
53  void unregisterListener(AEventListener* listener);
54 
55  void queueEvent(std::shared_ptr<AEvent> event);
56  void fireEvent(std::shared_ptr<AEvent> event);
57 
58  protected:
59 
60  private:
61 
62  int findListener(AEventListener* pListener);
63  void triggerEvent(std::shared_ptr<AEvent> event);
64 
67 
68  };
69  }
73 }
78 //------------------------------------------------------------------------------------------
79 
80 #endif
Definition: AEventListener.hpp:43
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: PriorityList.hpp:45
Definition: PriorityMultiQueue.hpp:50
Abstract base class of all event objects.
Definition: EventManager.hpp:43