mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-10 22:23:34 +00:00
24 lines
531 B
C++
24 lines
531 B
C++
#ifndef __MLX_EVENT_BUS__
|
|
#define __MLX_EVENT_BUS__
|
|
|
|
#include <Core/EventBase.h>
|
|
#include <Core/EventListener.h>
|
|
|
|
namespace mlx
|
|
{
|
|
class EventBus
|
|
{
|
|
public:
|
|
EventBus() = delete;
|
|
static void Send(const std::string& listener_name, const EventBase& event);
|
|
static void SendBroadcast(const EventBase& event);
|
|
inline static void RegisterListener(const EventListener& listener) { s_listeners.push_back(listener); }
|
|
~EventBus() = delete;
|
|
|
|
private:
|
|
inline static std::vector<EventListener> s_listeners;
|
|
};
|
|
}
|
|
|
|
#endif
|