39 lines
1.0 KiB
C
Raw Normal View History

2026-06-26 17:55:15 +08:00
#ifndef DRONESCREWCTRL_CONFIG_MANAGER_H
#define DRONESCREWCTRL_CONFIG_MANAGER_H
#include "IVrConfig.h"
#include <string>
#include <mutex>
/**
* @brief
*
* BasePresenter / AppConfig+
* / XML
*/
class ConfigManager
{
public:
static ConfigManager& Instance();
bool Initialize(const std::string& configPath);
bool Reload();
bool Save();
DroneScrewCtrlConfigResult GetConfig() const;
void SetConfig(const DroneScrewCtrlConfigResult& cfg);
private:
ConfigManager();
~ConfigManager();
ConfigManager(const ConfigManager&) = delete;
ConfigManager& operator=(const ConfigManager&) = delete;
IDroneScrewCtrlConfig* m_pConfig{nullptr};
DroneScrewCtrlConfigResult m_cache;
std::string m_path;
mutable std::mutex m_mutex;
};
#endif // DRONESCREWCTRL_CONFIG_MANAGER_H