#pragma once #include #include #include #include class CConfigWatcher { public: CConfigWatcher(); ~CConfigWatcher(); struct SConfigWatchEvent { std::string file; }; int getInotifyFD(); void setWatchList(const std::vector& paths); void setOnChange(const std::function& fn); void onInotifyEvent(); private: struct SInotifyWatch { int wd = -1; std::string file; }; std::function m_watchCallback; std::vector m_watches; int m_inotifyFd = -1; }; inline std::unique_ptr g_pConfigWatcher = std::make_unique();