#pragma once #include #include #include #include #include "Listener.hpp" class CSignal { public: void emit(std::any data = {}); // [[nodiscard("Listener is unregistered when the ptr is lost")]] CHyprSignalListener registerListener(std::function handler); // this is for static listeners. They die with this signal. // TODO: can we somehow rid of the void* data and make it a custom this? void registerStaticListener(std::function handler, void* owner); private: std::vector> m_vListeners; std::vector> m_vStaticListeners; };