Browse Source

settings: checks after config file, added finalize

Former-commit-id: a383159a02
tempestpy_adaptions
sjunges 9 years ago
parent
commit
ebdd979d2c
  1. 8
      src/settings/SettingsManager.cpp
  2. 3
      src/settings/SettingsManager.h
  3. 4
      src/settings/modules/ModuleSettings.cpp
  4. 7
      src/settings/modules/ModuleSettings.h

8
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();
}
}

3
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.

4
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;
}

7
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
Loading…
Cancel
Save