/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* EventBus.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/27 17:30:36 by maldavid #+# #+# */ /* Updated: 2024/03/27 17:31:41 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __MLX_EVENT_BUS__ #define __MLX_EVENT_BUS__ #include #include 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 s_listeners; }; } #endif