#include "config.h" #include "config_detail.h" // CONFIG_DEFINE template ConfigDef::ConfigDef(std::string section, std::string name, T defaultValue) : Section(section), Name(name), DefaultValue(defaultValue) { Config::Definitions.emplace_back(this); } // CONFIG_DEFINE_ENUM template ConfigDef::ConfigDef(std::string section, std::string name, T defaultValue, std::unordered_map enumTemplate) : Section(section), Name(name), DefaultValue(defaultValue), EnumTemplate(enumTemplate) { for (const auto& pair : EnumTemplate) EnumTemplateReverse[pair.second] = pair.first; Config::Definitions.emplace_back(this); } // CONFIG_DEFINE_CALLBACK template ConfigDef::ConfigDef(std::string section, std::string name, T defaultValue, std::function*)> readCallback) : Section(section), Name(name), DefaultValue(defaultValue), ReadCallback(readCallback) { Config::Definitions.emplace_back(this); }