#ifndef CONFIG_MANAGER_H #define CONFIG_MANAGER_H #include "common.h" #include #include #include #include #include #include #include class ConfigManager { public: ConfigManager(const std::string& config_path); ~ConfigManager(); // Load configuration from file bool LoadConfig(); // Get parsed rules std::vector GetRules() const; // Start monitoring thread for live reload void StartMonitoring(std::function&)> callback); // Stop monitoring thread void StopMonitoring(); // Get configuration values std::string GetLogFile() const; bool IsLoggingEnabled() const; private: std::string config_path_; std::vector rules_; std::atomic monitoring_; std::thread monitor_thread_; // Last modification time of config file std::filesystem::file_time_type last_modified_; // Callback for rule updates std::function&)> update_callback_; // Configuration values std::string log_file_; bool logging_enabled_; mutable std::mutex config_mutex_; // Monitoring thread function void MonitorFileChanges(); // Parse JSON configuration bool ParseConfig(); }; #endif // CONFIG_MANAGER_H