diff --git a/src/settings/SettingsManager.cpp b/src/settings/SettingsManager.cpp index 18225f712..618fbfe77 100644 --- a/src/settings/SettingsManager.cpp +++ b/src/settings/SettingsManager.cpp @@ -137,7 +137,7 @@ namespace storm { } // Finally, check whether all modules are okay with the current settings. - this->checkAllModules(); + this->finalizeAllModules(); } void SettingsManager::setFromConfigurationFile(std::string const& configFilename) { @@ -162,6 +162,8 @@ namespace storm { } } } + // Finally, check whether all modules are okay with the current settings. + this->finalizeAllModules(); } void SettingsManager::printHelp(std::string const& hint) const { @@ -379,9 +381,11 @@ namespace storm { } } - void SettingsManager::checkAllModules() const { + void SettingsManager::finalizeAllModules() { for (auto const& nameModulePair : this->modules) { + nameModulePair.second->finalize(); nameModulePair.second->check(); + } } diff --git a/src/settings/SettingsManager.h b/src/settings/SettingsManager.h index f4fad9919..fd00654c3 100644 --- a/src/settings/SettingsManager.h +++ b/src/settings/SettingsManager.h @@ -189,9 +189,10 @@ namespace storm { static void addOptionToMap(std::string const& name, std::shared_ptr<Option> const& option, std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>>& optionMap); /*! + * Prepares some modules for further changes. * Checks all modules for consistency by calling their respective check method. */ - void checkAllModules() const; + void finalizeAllModules(); /*! * Retrieves the (print) length of the longest option of all modules. diff --git a/src/settings/modules/ModuleSettings.cpp b/src/settings/modules/ModuleSettings.cpp index f4ccbc2b6..f99d50e35 100644 --- a/src/settings/modules/ModuleSettings.cpp +++ b/src/settings/modules/ModuleSettings.cpp @@ -17,7 +17,9 @@ namespace storm { bool ModuleSettings::check() const { return true; } - + + void ModuleSettings::finalize() { } + storm::settings::SettingsManager const& ModuleSettings::getSettingsManager() const { return this->settingsManager; } diff --git a/src/settings/modules/ModuleSettings.h b/src/settings/modules/ModuleSettings.h index d4cf18724..027664433 100644 --- a/src/settings/modules/ModuleSettings.h +++ b/src/settings/modules/ModuleSettings.h @@ -38,7 +38,12 @@ namespace storm { * @return True if the settings are consistent. */ virtual bool check() const; - + + /*! + * Prepares the modules for further usage, should be called at the end of the initialization, before checks are executed. + */ + virtual void finalize(); + /*! * Sets the option with the given name to the required status. This requires the option to take no * arguments. As a result, a pointer to an object is returned such that when the object is destroyed