ShishGL  1.0
A simple modular cross-platform graphics library
EventSystem.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_EVENT_SYSTEM_HPP
3 #define SHISHGL_EVENT_SYSTEM_HPP
4 /*============================================================================*/
5 #include "EventManager.hpp"
6 /*============================================================================*/
7 namespace Sh {
8 
9  class EventSystem {
10  public:
11 
12  static constexpr Listener* SystemEvents = nullptr;
13 
14  template <typename SomeEvent, typename... Args>
15  static bool sendEvent(Listener* sender, Args&&... args);
16 
17  static bool sendEvent(Listener* sender, Event& event);
18 
19  static bool dispatchAll();
20 
21  static bool dispatchOne();
22 
23  virtual ~EventSystem() = default;
24 
25  protected:
26 
27  EventSystem() = default;
28 
29  };
30 
31 }
32 /*============================================================================*/
33 #include "EventSystem.ipp"
34 /*============================================================================*/
35 #endif //SHISHGL_EVENT_SYSTEM_HPP
36 /*============================================================================*/
Sh::EventSystem::EventSystem
EventSystem()=default
Sh::EventSystem::SystemEvents
static constexpr Listener * SystemEvents
Definition: EventSystem.hpp:12
Sh::EventSystem::dispatchAll
static bool dispatchAll()
Definition: EventSystem.cpp:24
Sh::EventSystem::dispatchOne
static bool dispatchOne()
Definition: EventSystem.cpp:39
EventManager.hpp
Sh::EventSystem::~EventSystem
virtual ~EventSystem()=default
Sh::Event
Definition: Event.hpp:26
Sh::EventSystem::sendEvent
static bool sendEvent(Listener *sender, Args &&... args)
Definition: EventSystem.ipp:8
Sh::EventSystem
Definition: EventSystem.hpp:9
Sh
Definition: CoreApplication.hpp:10
Sh::Listener
Definition: Listener.hpp:7
EventSystem.ipp