Drop the ConfigManager singleton + ECHOION_* config macros
ConfigManager loses its static instance() (and the private ctor) — it is now a plain object Core owns and provides as a service. The eight ECHOION_CONFIG/ BOT/YOUTUBE/NETWORK/TEAMSPEAK/SECURITY/FEATURES/ADVANCED convenience macros are deleted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
317cef3782
commit
95454f9d83
1 file changed
+3
-18
@@ -17,8 +17,9 @@ namespace Echoion::Api
|
||||
|
||||
using ConfigChangedCallback = std::function<void(const AppConfig&)>;
|
||||
|
||||
// Get singleton instance
|
||||
static ConfigManager& instance();
|
||||
// Owned by Core and provided through the service registry — no
|
||||
// global singleton.
|
||||
ConfigManager() = default;
|
||||
|
||||
// Delete copy/move
|
||||
ConfigManager(const ConfigManager&) = delete;
|
||||
@@ -78,9 +79,6 @@ namespace Echoion::Api
|
||||
|
||||
private:
|
||||
|
||||
ConfigManager() = default;
|
||||
~ConfigManager() = default;
|
||||
|
||||
mutable std::shared_mutex mutex_;
|
||||
AppConfig config_;
|
||||
std::filesystem::path configPath_;
|
||||
@@ -95,17 +93,4 @@ namespace Echoion::Api
|
||||
|
||||
} // namespace Echoion::Api
|
||||
|
||||
// Convenience macros for accessing config
|
||||
#define ECHOION_CONFIG (::Echoion::Api::ConfigManager::instance().getConfig())
|
||||
#define ECHOION_BOT (::Echoion::Api::ConfigManager::instance().getBot())
|
||||
#define ECHOION_YOUTUBE (::Echoion::Api::ConfigManager::instance().getYouTube())
|
||||
#define ECHOION_NETWORK (::Echoion::Api::ConfigManager::instance().getNetwork())
|
||||
#define ECHOION_TEAMSPEAK \
|
||||
(::Echoion::Api::ConfigManager::instance().getTeamSpeak())
|
||||
#define ECHOION_SECURITY \
|
||||
(::Echoion::Api::ConfigManager::instance().getSecurity())
|
||||
#define ECHOION_FEATURES \
|
||||
(::Echoion::Api::ConfigManager::instance().getFeatures())
|
||||
#define ECHOION_ADVANCED \
|
||||
(::Echoion::Api::ConfigManager::instance().getAdvanced())
|
||||
#endif
|
||||
Reference in new issue
Block a user