#include "storm/settings/modules/ModuleSettings.h" #include "storm/utility/macros.h" #include "storm/settings/SettingMemento.h" #include "storm/settings/Option.h" #include "storm/exceptions/InvalidStateException.h" #include "storm/exceptions/IllegalFunctionCallException.h" namespace storm { namespace settings { namespace modules { ModuleSettings::ModuleSettings(std::string const& moduleName) : moduleName(moduleName) { // Intentionally left empty. } bool ModuleSettings::check() const { return true; } void ModuleSettings::finalize() { } void ModuleSettings::set(std::string const& name) { return this->getOption(name).setHasOptionBeenSet(); } void ModuleSettings::unset(std::string const& name) { return this->getOption(name).setHasOptionBeenSet(false); } std::vector> const& ModuleSettings::getOptions() const { return this->options; } Option const& ModuleSettings::getOption(std::string const& longName) const { auto optionIterator = this->optionMap.find(longName); STORM_LOG_THROW(optionIterator != this->optionMap.end(), storm::exceptions::IllegalFunctionCallException, "Cannot retrieve unknown option '" << longName << "'."); return *optionIterator->second; } Option& ModuleSettings::getOption(std::string const& longName) { auto optionIterator = this->optionMap.find(longName); STORM_LOG_THROW(optionIterator != this->optionMap.end(), storm::exceptions::IllegalFunctionCallException, "Cannot retrieve unknown option '" << longName << "'."); return *optionIterator->second; } std::string const& ModuleSettings::getModuleName() const { return this->moduleName; } std::unique_ptr ModuleSettings::overrideOption(std::string const& name, bool requiredStatus) { bool currentStatus = this->isSet(name); if (requiredStatus) { this->set(name); } else { this->unset(name); } return std::unique_ptr(new storm::settings::SettingMemento(*this, name, currentStatus)); } bool ModuleSettings::isSet(std::string const& optionName) const { return this->getOption(optionName).getHasOptionBeenSet(); } void ModuleSettings::addOption(std::shared_ptr