Browse Source

settings: checks after config file, added finalize

Former-commit-id: 6b3769a7a9
tempestpy_adaptions
sjunges 9 years ago
parent
commit
93a0f7f8bb
  1. 8
      src/settings/SettingsManager.cpp
  2. 3
      src/settings/SettingsManager.h
  3. 2
      src/settings/modules/ModuleSettings.cpp
  4. 5
      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.

2
src/settings/modules/ModuleSettings.cpp

@ -18,6 +18,8 @@ namespace storm {
return true;
}
void ModuleSettings::finalize() { }
storm::settings::SettingsManager const& ModuleSettings::getSettingsManager() const {
return this->settingsManager;
}

5
src/settings/modules/ModuleSettings.h

@ -39,6 +39,11 @@ namespace storm {
*/
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