22#include <kiwano/event/listener/EventListener.h>
29typedef IntrusiveList<RefPtr<EventListener>> ListenerList;
59 template <
typename _EventTy>
62 static_assert(std::is_base_of<Event, _EventTy>::value,
"_EventTy is not an event type.");
63 return AddListener(KGE_EVENT(_EventTy), callback);
71 template <
typename _EventTy>
74 static_assert(std::is_base_of<Event, _EventTy>::value,
"_EventTy is not an event type.");
75 return AddListener(name, KGE_EVENT(_EventTy), callback);
95 void StartAllListeners();
99 void StopAllListeners();
103 void RemoveAllListeners();
113 bool DispatchEvent(
Event* evt);
事件分发器
Definition: EventDispatcher.h:36
EventListener * AddListener(StringView name, EventListener::Callback callback)
添加监听器
Definition: EventDispatcher.h:72
EventListener * AddListener(EventListener::Callback callback)
添加监听器
Definition: EventDispatcher.h:60
事件监听器
Definition: EventListener.h:48
事件类型
Definition: EventType.h:36
Definition: Function.h:228
引用计数智能指针
Definition: RefBasePtr.hpp:35