29 #ifndef THOR_EVENTSYSTEM_HPP
30 #define THOR_EVENTSYSTEM_HPP
32 #include <Thor/Input/Detail/EventListener.hpp>
34 #include <Aurora/Tools/NonCopyable.hpp>
50 template <
typename Event,
typename EventId = Event>
51 class EventSystem :
private aurora::NonCopyable
73 Connection
connect(
const EventId& trigger, std::function<
void(
const Event&)> unaryListener);
84 Connection
connect0(
const EventId& trigger, std::function<
void()> nullaryListener);
99 typedef detail::ListenerMap<EventId, const Event&> EventListenerMap;
105 EventListenerMap mListeners;
112 #include <Thor/Input/Detail/EventSystem.inl>
113 #endif // THOR_EVENTSYSTEM_HPP
void clearAllConnections()
Disconnects all listeners.
Connection connect0(const EventId &trigger, std::function< void()> nullaryListener)
Connects an event to the specified nullary listener.
Definition: Animator.hpp:42
Connection connect(const EventId &trigger, std::function< void(const Event &)> unaryListener)
Connects an event to the specified unary listener.
void clearConnections(EventId identifier)
Disconnects listeners associated with a given event type.
void triggerEvent(const Event &event)
Fires an event.
EventSystem()
Default constructor.