From 96e1f8faf90a47230d2a5c265118f1c44193410d Mon Sep 17 00:00:00 2001 From: dehnert Date: Wed, 17 Sep 2014 20:04:13 +0200 Subject: [PATCH] Renamed Settings class to SettingsManager. Former-commit-id: 2b33f4c8d0a27b821b13ac1f9e0d2079830262ce --- CMakeLists.txt | 4 +- src/adapters/ExplicitModelAdapter.h | 6 +- src/counterexamples/GenerateCounterexample.h | 2 +- .../MILPMinimalLabelSetGenerator.h | 2 +- .../SparseMarkovAutomatonCslModelChecker.h | 2 +- .../prctl/CreatePrctlModelChecker.h | 2 +- src/models/Ctmdp.h | 2 +- src/models/Dtmc.h | 2 +- src/models/Mdp.h | 2 +- .../DeterministicSparseTransitionParser.cpp | 2 +- .../MarkovAutomatonSparseTransitionParser.cpp | 4 +- ...NondeterministicSparseTransitionParser.cpp | 2 +- src/settings/InternalOptionMemento.h | 4 +- src/settings/Option.h | 4 +- src/settings/Settings.cpp | 58 ++---- src/settings/Settings.h | 23 +-- src/settings/modules/Settings.h | 0 src/solver/GlpkLpSolver.cpp | 12 +- src/solver/GmmxxLinearEquationSolver.cpp | 2 +- ...xxNondeterministicLinearEquationSolver.cpp | 2 +- src/solver/NativeLinearEquationSolver.cpp | 2 +- ...veNondeterministicLinearEquationSolver.cpp | 2 +- src/storage/dd/CuddDdManager.cpp | 6 +- src/storm.cpp | 4 +- src/utility/CLI.h | 6 +- src/utility/CuddUtility.cpp | 195 ------------------ src/utility/CuddUtility.h | 65 ------ src/utility/InitializeLogging.h | 2 +- src/utility/solver.cpp | 6 +- .../GmmxxDtmcPrctlModelCheckerTest.cpp | 6 +- .../SparseMdpPrctlModelCheckerTest.cpp | 4 +- test/functional/solver/GlpkLpSolverTest.cpp | 24 +-- .../solver/GmmxxLinearEquationSolverTest.cpp | 44 ++-- ...ndeterministicLinearEquationSolverTest.cpp | 14 +- .../solver/NativeLinearEquationSolverTest.cpp | 8 +- ...ndeterministicLinearEquationSolverTest.cpp | 14 +- test/functional/storm-functional-tests.cpp | 8 +- .../GmmxxDtmcPrctModelCheckerTest.cpp | 4 +- .../SparseMdpPrctlModelCheckerTest.cpp | 4 +- test/performance/storm-performance-tests.cpp | 4 +- 40 files changed, 133 insertions(+), 426 deletions(-) create mode 100644 src/settings/modules/Settings.h delete mode 100644 src/utility/CuddUtility.cpp delete mode 100644 src/utility/CuddUtility.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 086ecd365..c2b50d956 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,7 +247,8 @@ file(GLOB_RECURSE STORM_COUNTEREXAMPLES_FILES ${PROJECT_SOURCE_DIR}/src/countere file(GLOB_RECURSE STORM_MODELS_FILES ${PROJECT_SOURCE_DIR}/src/models/*.h ${PROJECT_SOURCE_DIR}/src/models/*.cpp) file(GLOB STORM_PARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/*.h ${PROJECT_SOURCE_DIR}/src/parser/*.cpp) file(GLOB_RECURSE STORM_PARSER_PRISMPARSER_FILES ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.h ${PROJECT_SOURCE_DIR}/src/parser/prismparser/*.cpp) -file(GLOB_RECURSE STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp) +file(GLOB STORM_SETTINGS_FILES ${PROJECT_SOURCE_DIR}/src/settings/*.h ${PROJECT_SOURCE_DIR}/src/settings/*.cpp) +file(GLOB STORM_SETTINGS_MODULES_FILES ${PROJECT_SOURCE_DIR}/src/settings/modules/*.h ${PROJECT_SOURCE_DIR}/src/settings/modules/*.cpp) file(GLOB_RECURSE STORM_SOLVER_FILES ${PROJECT_SOURCE_DIR}/src/solver/*.h ${PROJECT_SOURCE_DIR}/src/solver/*.cpp) file(GLOB STORM_STORAGE_FILES ${PROJECT_SOURCE_DIR}/src/storage/*.h ${PROJECT_SOURCE_DIR}/src/storage/*.cpp) file(GLOB_RECURSE STORM_STORAGE_DD_FILES ${PROJECT_SOURCE_DIR}/src/storage/dd/*.h ${PROJECT_SOURCE_DIR}/src/storage/dd/*.cpp) @@ -280,6 +281,7 @@ source_group(models FILES ${STORM_MODELS_FILES}) source_group(parser FILES ${STORM_PARSER_FILES}) source_group(parser\\prismparser FILES ${STORM_PARSER_PRISMPARSER_FILES}) source_group(settings FILES ${STORM_SETTINGS_FILES}) +source_group(settings\\modules ${STORM_SETTINGS_MODULES_FILES}) source_group(solver FILES ${STORM_SOLVER_FILES}) source_group(storage FILES ${STORM_STORAGE_FILES}) source_group(storage\\dd FILES ${STORM_STORAGE_DD_FILES}) diff --git a/src/adapters/ExplicitModelAdapter.h b/src/adapters/ExplicitModelAdapter.h index a5150c05a..dfc3e1219 100644 --- a/src/adapters/ExplicitModelAdapter.h +++ b/src/adapters/ExplicitModelAdapter.h @@ -312,7 +312,7 @@ namespace storm { } // Check that the resulting distribution is in fact a distribution. - LOG_THROW(std::abs(1 - probabilitySum) < storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble(), storm::exceptions::WrongFormatException, "Probabilities do not sum to one for command '" << command << "'."); + LOG_THROW(std::abs(1 - probabilitySum) < storm::settings::SettingsManager::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble(), storm::exceptions::WrongFormatException, "Probabilities do not sum to one for command '" << command << "'."); } } @@ -418,7 +418,7 @@ namespace storm { } // Check that the resulting distribution is in fact a distribution. - if (std::abs(1 - probabilitySum) > storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()) { + if (std::abs(1 - probabilitySum) > storm::settings::SettingsManager::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()) { LOG4CPLUS_ERROR(logger, "Sum of update probabilities do not some to one for some command."); throw storm::exceptions::WrongFormatException() << "Sum of update probabilities do not some to one for some command."; } @@ -502,7 +502,7 @@ namespace storm { // If the current state does not have a single choice, we equip it with a self-loop if that was // requested and issue an error otherwise. if (totalNumberOfChoices == 0) { - if (storm::settings::Settings::getInstance()->isSet("fixDeadlocks")) { + if (storm::settings::SettingsManager::getInstance()->isSet("fixDeadlocks")) { // Insert empty choice labeling for added self-loop transitions. choiceLabels.push_back(boost::container::flat_set()); transitionMatrixBuilder.addNextValue(currentRow, currentState, storm::utility::constantOne()); diff --git a/src/counterexamples/GenerateCounterexample.h b/src/counterexamples/GenerateCounterexample.h index 12d0f1da5..52799f5d3 100644 --- a/src/counterexamples/GenerateCounterexample.h +++ b/src/counterexamples/GenerateCounterexample.h @@ -27,7 +27,7 @@ LOG4CPLUS_INFO(logger, "Starting counterexample generation."); LOG4CPLUS_INFO(logger, "Testing inputs..."); - storm::settings::Settings* s = storm::settings::Settings::getInstance(); + storm::settings::SettingsManager* s = storm::settings::SettingsManager::getInstance(); // First test output directory. std::string outPath = s->getOptionByLongName("counterExample").getArgument(0).getValueAsString(); diff --git a/src/counterexamples/MILPMinimalLabelSetGenerator.h b/src/counterexamples/MILPMinimalLabelSetGenerator.h index a4c8707c7..5f999b06e 100644 --- a/src/counterexamples/MILPMinimalLabelSetGenerator.h +++ b/src/counterexamples/MILPMinimalLabelSetGenerator.h @@ -1025,7 +1025,7 @@ namespace storm { // Delegate the actual computation work to the function of equal name. auto startTime = std::chrono::high_resolution_clock::now(); - boost::container::flat_set usedLabelSet = getMinimalLabelSet(labeledMdp, phiStates, psiStates, bound, strictBound, true, storm::settings::Settings::getInstance()->isSet("schedcuts")); + boost::container::flat_set usedLabelSet = getMinimalLabelSet(labeledMdp, phiStates, psiStates, bound, strictBound, true, storm::settings::SettingsManager::getInstance()->isSet("schedcuts")); auto endTime = std::chrono::high_resolution_clock::now(); std::cout << std::endl << "Computed minimal label set of size " << usedLabelSet.size() << " in " << std::chrono::duration_cast(endTime - startTime).count() << "ms." << std::endl; diff --git a/src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h b/src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h index 493f286bf..345d9d721 100644 --- a/src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h +++ b/src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h @@ -235,7 +235,7 @@ namespace storm { // (1) Compute the accuracy we need to achieve the required error bound. ValueType maxExitRate = this->getModel().getMaximalExitRate(); - ValueType delta = (2 * storm::settings::Settings::getInstance()->getOptionByLongName("digiprecision").getArgument(0).getValueAsDouble()) / (upperBound * maxExitRate * maxExitRate); + ValueType delta = (2 * storm::settings::SettingsManager::getInstance()->getOptionByLongName("digiprecision").getArgument(0).getValueAsDouble()) / (upperBound * maxExitRate * maxExitRate); // (2) Compute the number of steps we need to make for the interval. uint_fast64_t numberOfSteps = static_cast(std::ceil((upperBound - lowerBound) / delta)); diff --git a/src/modelchecker/prctl/CreatePrctlModelChecker.h b/src/modelchecker/prctl/CreatePrctlModelChecker.h index bd1b35c7e..d07261ebc 100644 --- a/src/modelchecker/prctl/CreatePrctlModelChecker.h +++ b/src/modelchecker/prctl/CreatePrctlModelChecker.h @@ -15,7 +15,7 @@ */ storm::modelchecker::prctl::AbstractModelChecker* createPrctlModelChecker(storm::models::Dtmc const & dtmc) { // Create the appropriate model checker. - storm::settings::Settings* s = storm::settings::Settings::getInstance(); + storm::settings::SettingsManager* s = storm::settings::SettingsManager::getInstance(); std::string const& linsolver = s->getOptionByLongName("linsolver").getArgument(0).getValueAsString(); if (linsolver == "gmm++") { return new storm::modelchecker::prctl::SparseDtmcPrctlModelChecker(dtmc, new storm::solver::GmmxxLinearEquationSolver()); diff --git a/src/models/Ctmdp.h b/src/models/Ctmdp.h index 4e690d871..842ad4391 100644 --- a/src/models/Ctmdp.h +++ b/src/models/Ctmdp.h @@ -127,7 +127,7 @@ private: */ bool checkValidityOfProbabilityMatrix() { // Get the settings object to customize linear solving. - storm::settings::Settings* s = storm::settings::Settings::getInstance(); + storm::settings::SettingsManager* s = storm::settings::SettingsManager::getInstance(); double precision = s->getOptionByLongName("precision").getArgument(0).getValueAsDouble(); for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); row++) { T sum = this->getTransitionMatrix().getRowSum(row); diff --git a/src/models/Dtmc.h b/src/models/Dtmc.h index d1f642e6e..c703c1127 100644 --- a/src/models/Dtmc.h +++ b/src/models/Dtmc.h @@ -298,7 +298,7 @@ private: */ bool checkValidityOfProbabilityMatrix() { // Get the settings object to customize linear solving. - storm::settings::Settings* s = storm::settings::Settings::getInstance(); + storm::settings::SettingsManager* s = storm::settings::SettingsManager::getInstance(); double precision = s->getOptionByLongName("precision").getArgument(0).getValueAsDouble(); if (this->getTransitionMatrix().getRowCount() != this->getTransitionMatrix().getColumnCount()) { diff --git a/src/models/Mdp.h b/src/models/Mdp.h index 0a0c2e06e..a19424457 100644 --- a/src/models/Mdp.h +++ b/src/models/Mdp.h @@ -198,7 +198,7 @@ private: */ bool checkValidityOfProbabilityMatrix() { // Get the settings object to customize linear solving. - storm::settings::Settings* s = storm::settings::Settings::getInstance(); + storm::settings::SettingsManager* s = storm::settings::SettingsManager::getInstance(); double precision = s->getOptionByLongName("precision").getArgument(0).getValueAsDouble(); for (uint_fast64_t row = 0; row < this->getTransitionMatrix().getRowCount(); row++) { T sum = this->getTransitionMatrix().getRowSum(row); diff --git a/src/parser/DeterministicSparseTransitionParser.cpp b/src/parser/DeterministicSparseTransitionParser.cpp index 8f81685b6..bf4b66b6d 100644 --- a/src/parser/DeterministicSparseTransitionParser.cpp +++ b/src/parser/DeterministicSparseTransitionParser.cpp @@ -93,7 +93,7 @@ namespace storm { uint_fast64_t row, col, lastRow = 0; double val; - bool fixDeadlocks = storm::settings::Settings::getInstance()->isSet("fixDeadlocks"); + bool fixDeadlocks = storm::settings::SettingsManager::getInstance()->isSet("fixDeadlocks"); bool hadDeadlocks = false; bool rowHadDiagonalEntry = false; diff --git a/src/parser/MarkovAutomatonSparseTransitionParser.cpp b/src/parser/MarkovAutomatonSparseTransitionParser.cpp index fbfa9a1b2..b653afe24 100644 --- a/src/parser/MarkovAutomatonSparseTransitionParser.cpp +++ b/src/parser/MarkovAutomatonSparseTransitionParser.cpp @@ -15,7 +15,7 @@ namespace storm { MarkovAutomatonSparseTransitionParser::FirstPassResult MarkovAutomatonSparseTransitionParser::firstPass(char const* buf) { MarkovAutomatonSparseTransitionParser::FirstPassResult result; - bool fixDeadlocks = storm::settings::Settings::getInstance()->isSet("fixDeadlocks"); + bool fixDeadlocks = storm::settings::SettingsManager::getInstance()->isSet("fixDeadlocks"); // Skip the format hint if it is there. buf = trimWhitespaces(buf); @@ -157,7 +157,7 @@ namespace storm { MarkovAutomatonSparseTransitionParser::Result MarkovAutomatonSparseTransitionParser::secondPass(char const* buf, FirstPassResult const& firstPassResult) { Result result(firstPassResult); - bool fixDeadlocks = storm::settings::Settings::getInstance()->isSet("fixDeadlocks"); + bool fixDeadlocks = storm::settings::SettingsManager::getInstance()->isSet("fixDeadlocks"); // Skip the format hint if it is there. buf = trimWhitespaces(buf); diff --git a/src/parser/NondeterministicSparseTransitionParser.cpp b/src/parser/NondeterministicSparseTransitionParser.cpp index 116364856..8e9361a81 100644 --- a/src/parser/NondeterministicSparseTransitionParser.cpp +++ b/src/parser/NondeterministicSparseTransitionParser.cpp @@ -100,7 +100,7 @@ namespace storm { // Initialize variables for the parsing run. uint_fast64_t source = 0, target = 0, lastSource = 0, choice = 0, lastChoice = 0, curRow = 0; double val = 0.0; - bool fixDeadlocks = storm::settings::Settings::getInstance()->isSet("fixDeadlocks"); + bool fixDeadlocks = storm::settings::SettingsManager::getInstance()->isSet("fixDeadlocks"); bool hadDeadlocks = false; // The first state already starts a new row group of the matrix. diff --git a/src/settings/InternalOptionMemento.h b/src/settings/InternalOptionMemento.h index 75243d169..6e323db8e 100644 --- a/src/settings/InternalOptionMemento.h +++ b/src/settings/InternalOptionMemento.h @@ -29,7 +29,7 @@ namespace settings { * * @param */ - InternalOptionMemento(std::string const& longOptionName, bool requiredHasBeenSetState): instance(storm::settings::Settings::getInstance()), optionName(longOptionName), stateRequired(requiredHasBeenSetState) { + InternalOptionMemento(std::string const& longOptionName, bool requiredHasBeenSetState): instance(storm::settings::SettingsManager::getInstance()), optionName(longOptionName), stateRequired(requiredHasBeenSetState) { this->stateBefore = instance->isSet(optionName); if (stateRequired) { instance->set(optionName); @@ -56,7 +56,7 @@ namespace settings { private: - storm::settings::Settings* instance; + storm::settings::SettingsManager* instance; std::string const optionName; bool stateBefore; bool stateRequired; diff --git a/src/settings/Option.h b/src/settings/Option.h index c7191d5b7..81ac9bfdf 100644 --- a/src/settings/Option.h +++ b/src/settings/Option.h @@ -32,12 +32,12 @@ extern log4cplus::Logger logger; namespace storm { namespace settings { - class Settings; + class SettingsManager; class Option { public: - friend class storm::settings::Settings; + friend class storm::settings::SettingsManager; Option(std::string const& moduleName, std::string const& longOptionName, std::string const& shortOptionName, std::string const& optionDescription, bool isOptionRequired) : longName(longOptionName), shortName(shortOptionName), description(optionDescription), moduleName(moduleName), isRequired(isOptionRequired), hasBeenSet(false) { diff --git a/src/settings/Settings.cpp b/src/settings/Settings.cpp index eb401dba4..2954cade4 100644 --- a/src/settings/Settings.cpp +++ b/src/settings/Settings.cpp @@ -7,7 +7,7 @@ #include "src/exceptions/OptionParserException.h" // Static Inits -storm::settings::Destroyer storm::settings::Settings::destroyer; +storm::settings::Destroyer storm::settings::SettingsManager::destroyer; /*! * @brief Create new instance. @@ -19,16 +19,16 @@ storm::settings::Destroyer storm::settings::Settings::destroyer; * @param filename either NULL or name of config file * @return The new instance of Settings. */ -void storm::settings::Settings::parse(int const argc, char const * const argv[]) { - storm::settings::Settings* myInstance = storm::settings::Settings::getInstance(); +void storm::settings::SettingsManager::parse(int const argc, char const * const argv[]) { + storm::settings::SettingsManager* myInstance = storm::settings::SettingsManager::getInstance(); myInstance->parseCommandLine(argc, argv); } -bool storm::settings::Settings::hasAssignment(std::string const& option) { +bool storm::settings::SettingsManager::hasAssignment(std::string const& option) { return (option.find_first_of('=', 0) != std::string::npos); } -storm::settings::stringPair_t storm::settings::Settings::splitOptionString(std::string const& option) { +storm::settings::stringPair_t storm::settings::SettingsManager::splitOptionString(std::string const& option) { size_t splitLocation = option.find_first_of('=', 0); if (splitLocation == std::string::npos) { // Second half is empty @@ -40,7 +40,7 @@ storm::settings::stringPair_t storm::settings::Settings::splitOptionString(std:: return std::make_pair(option.substr(0, splitLocation), option.substr(splitLocation + 1, std::string::npos)); } -void storm::settings::Settings::handleAssignment(std::string const& longOptionName, std::vector arguments) { +void storm::settings::SettingsManager::handleAssignment(std::string const& longOptionName, std::vector arguments) { std::string optionName = storm::utility::StringHelper::stringToLower(longOptionName); Option* option = this->getPtrByLongName(optionName); @@ -51,7 +51,7 @@ void storm::settings::Settings::handleAssignment(std::string const& longOptionNa uint_fast64_t givenArgsCount = arguments.size(); if (givenArgsCount > option->getArgumentCount()) { - LOG4CPLUS_ERROR(logger, "Settings::handleAssignment: Unable to parse arguments for option \"" << longOptionName << "\": " << arguments.size() << " arguments given, but expected no more than " << option->getArgumentCount() << "."); + LOG4CPLUS_ERROR(logger, "SettingsManager::handleAssignment: Unable to parse arguments for option \"" << longOptionName << "\": " << arguments.size() << " arguments given, but expected no more than " << option->getArgumentCount() << "."); throw storm::exceptions::OptionParserException() << "Unable to parse arguments for option \"" << longOptionName << "\": " << arguments.size() << " arguments given, but expected no more than " << option->getArgumentCount() << "."; } @@ -59,7 +59,7 @@ void storm::settings::Settings::handleAssignment(std::string const& longOptionNa if (i < givenArgsCount) { storm::settings::fromStringAssignmentResult_t assignmentResult = option->getArgument(i).fromStringValue(arguments.at(i)); if (!assignmentResult.first) { - LOG4CPLUS_ERROR(logger, "Settings::handleAssignment: Unable to parse arguments for option \"" << longOptionName << "\": argument " << option->getArgument(i).getArgumentName() << " rejected the given value \"" << arguments.at(i) << "\" with message:\r\n" << assignmentResult.second << "."); + LOG4CPLUS_ERROR(logger, "SettingsManager::handleAssignment: Unable to parse arguments for option \"" << longOptionName << "\": argument " << option->getArgument(i).getArgumentName() << " rejected the given value \"" << arguments.at(i) << "\" with message:\r\n" << assignmentResult.second << "."); throw storm::exceptions::OptionParserException() << "Unable to parse arguments for option \"" << longOptionName << "\": argument " << option->getArgument(i).getArgumentName() << " rejected the given value \"" << arguments.at(i) << "\" with message:\r\n" << assignmentResult.second << "."; } } else { @@ -74,7 +74,7 @@ void storm::settings::Settings::handleAssignment(std::string const& longOptionNa } } -std::vector storm::settings::Settings::argvToStringArray(int const argc, char const * const argv[]) { +std::vector storm::settings::SettingsManager::argvToStringArray(int const argc, char const * const argv[]) { // Ignore argv[0], it contains the program path and name std::vector result; for (int i = 1; i < argc; ++i) { @@ -83,7 +83,7 @@ std::vector storm::settings::Settings::argvToStringArray(int const return result; } -bool storm::settings::Settings::checkArgumentSyntaxForOption(std::string const& argvString) { +bool storm::settings::SettingsManager::checkArgumentSyntaxForOption(std::string const& argvString) { if (argvString.size() < 2) { return false; } @@ -100,7 +100,7 @@ bool storm::settings::Settings::checkArgumentSyntaxForOption(std::string const& return true; } -std::vector storm::settings::Settings::scanForOptions(std::vector const& arguments) { +std::vector storm::settings::SettingsManager::scanForOptions(std::vector const& arguments) { std::vector result; result.reserve(arguments.size()); for (auto it = arguments.cbegin(); it != arguments.cend(); ++it) { @@ -109,7 +109,7 @@ std::vector storm::settings::Settings::scanForOptions(std::vector stringArgv = argvToStringArray(argc, argv); @@ -180,41 +180,15 @@ void storm::settings::Settings::parseCommandLine(int const argc, char const * co } } -bool storm::settings::Settings::registerNewModule(ModuleRegistrationFunction_t registrationFunction) { - Settings* myInstance = Settings::getInstance(); - bool result = false; - try { - result = registrationFunction(myInstance); - //LOG4CPLUS_DEBUG(logger, "Settings::registerNewModule: Successfully executed a registrationFunction"); - } catch (storm::exceptions::IllegalArgumentException e) { - //LOG4CPLUS_ERROR(logger, "Settings::registerNewModule: Internal Error while setting up available Options!" << std::endl << "IllegalArgumentException: " << e.what() << "."); - std::cout << "Internal Error while setting up available options." << std::endl << "IllegalArgumentException: " << e.what() << "." << std::endl; - return false; - } catch (storm::exceptions::IllegalArgumentValueException e) { - //LOG4CPLUS_ERROR(logger, "Settings::registerNewModule: Internal Error while setting up available Options!" << std::endl << "IllegalArgumentValueException: " << e.what() << "."); - std::cout << "Internal Error while setting up available options." << std::endl << "IllegalArgumentValueException: " << e.what() << "." << std::endl; - return false; - } catch (storm::exceptions::IllegalFunctionCallException e) { - //LOG4CPLUS_ERROR(logger, "Settings::registerNewModule: Internal Error while setting up available Options!" << std::endl << "IllegalFunctionCallException: " << e.what() << "."); - std::cout << "Internal Error while setting up available options." << std::endl << "IllegalFunctionCallException: " << e.what() << "." << std::endl; - return false; - } catch (std::exception e) { - //LOG4CPLUS_ERROR(logger, "Settings::registerNewModule: Internal Error while setting up available Options!" << std::endl << "std::exception: " << e.what() << "."); - std::cout << "Internal Error while setting up available options." << std::endl << "std::exception: " << e.what() << "." << std::endl; - return false; - } - return result; -} - -storm::settings::Settings* storm::settings::Settings::getInstance() { +storm::settings::SettingsManager* storm::settings::SettingsManager::getInstance() { // Usually, this would require double-checked locking. // But since C++11, this is the way to go: - static storm::settings::Settings pInstance; + static storm::settings::SettingsManager pInstance; return &pInstance; } -storm::settings::Settings& storm::settings::Settings::addOption(Option* option) { +storm::settings::SettingsManager& storm::settings::SettingsManager::addOption(Option* option) { // For automatic management of option's lifetime std::shared_ptr