#ifndef event_manager_hh_INCLUDED #define event_manager_hh_INCLUDED #include #include #include "utils.hh" namespace Kakoune { using EventHandler = std::function; class EventManager : public Singleton { public: EventManager(); void watch(int fd, EventHandler handler); void unwatch(int fd); void handle_next_events(); void force_signal(int fd); private: std::vector m_events; std::unordered_map m_handlers; std::vector m_forced; }; } #endif // event_manager_hh_INCLUDED