#pragma once #include "../helpers/memory/Memory.hpp" #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 UP g_pConfigWatcher = makeUnique();