18 SettingsConsumer::SettingsConsumer() : _settingHandler{
nullptr}, _group{
WTerm::COMMON} {
31 throw invalid_argument(
"Setting '" + _settingPath +
":" + name +
"' not found.");
34 throw Error(
"SettingsHandler pointer not set. Handler sought for Irish Setter and English Pointer.");
54 throw invalid_argument(
"Setting '" + otherPath +
":" + name +
"' not found.");
57 throw Error(
"SettingsHandler pointer not set. Handler sought for Irish Setter and English Pointer.");
101 for(
auto& elem: result) {
102 MSG_ERROR(
"Setting " + elem +
" was defined before the initialization of "
103 +
_settingPath +
" and is not a valid setting. Removing. Please check syntax for typos.");
virtual void defineSettings()=0
purely virtual function for a class to define new settings
T * getNamedSettingValue(const std::string &path, const std::string &name, WTerm group=WTerm::COMMON)
access a specific setting value
virtual void addRefs() const
void setPath(const std::string &path)
provide the basic path for the settings defined by this class, as in "<path>:<setting>" ...
SettingsHandler * _settingHandler
pointer to the settings repository handler.
WTerm setWeightTerm(WTerm group)
std::string _settingPath
path of the settings defined by this class
std::set< std::string > _ownedSettings
void checkAndCleanSettings()
Log & getLog() const
logging facility
Base class to access the settings repository.
static Log & getLog(const std::string &name)
Get a logger with the given name.
virtual void setSettingsHandler(SettingsHandler &sh)
set link to settings repository handler.
Initialization error class.
void removeSetting(const std::string &name)
Base class for accessing Hammer settings repository.
void removeSetting(const std::string &path, const std::string &name, WTerm group=WTerm::COMMON)
SettingsHandler * getSettingsHandler() const
provide the pointer to the repository handler
Hammer settings manager class.
bool isOn(const std::string &name) const
method to check a boolean setting defined by this class
std::set< std::string > getSettings(const std::string &path="", WTerm group=WTerm::COMMON) const
access the list of registered settings