1#ifndef STORM_SETTINGS_SETTINGSMANAGER_H_
2#define STORM_SETTINGS_SETTINGSMANAGER_H_
8#include <unordered_map>
17class AbstractionSettings;
79 void printHelp(std::string
const& filter =
"frequent")
const;
102 void setName(std::string
const& name, std::string
const& executableName);
162 std::string executableName;
165 std::vector<std::string> moduleNames;
166 std::unordered_map<std::string, std::unique_ptr<modules::ModuleSettings>> modules;
170 std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>> longNameToOptions;
171 std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>> shortNameToOptions;
174 std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>> moduleOptions;
178 std::vector<std::string> longOptionNames;
185 void addOption(std::shared_ptr<Option>
const&
option);
194 static void setOptionArguments(std::string
const& optionName, std::shared_ptr<Option>
option, std::vector<std::string>
const&
argumentCache);
203 static void setOptionsArguments(std::string
const& optionName, std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>>
const& optionMap,
209 static bool isCompatible(std::shared_ptr<Option>
const&
option, std::string
const& optionName,
210 std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>>
const& optionMap);
219 static void addOptionToMap(std::string
const& name, std::shared_ptr<Option>
const&
option,
220 std::unordered_map<std::string, std::vector<std::shared_ptr<Option>>>& optionMap);
226 void finalizeAllModules();
251 std::map<std::string, std::vector<std::string>> parseConfigFile(std::string
const& filename)
const;
271template<
typename SettingsType>
273 static_assert(std::is_base_of<storm::settings::modules::ModuleSettings, SettingsType>::value,
"Template argument must be derived from ModuleSettings");
282void initializeAll(std::string
const& name, std::string
const& executableName);
289template<
typename SettingsType>
291 static_assert(std::is_base_of<storm::settings::modules::ModuleSettings, SettingsType>::value,
"Template argument must be derived from ModuleSettings");
299template<
typename SettingsType>
301 static_assert(std::is_base_of<storm::settings::modules::ModuleSettings, SettingsType>::value,
"Template argument must be derived from ModuleSettings");
Provides the central API for the registration of command line options and parsing the options from th...
void setFromCommandLine(int const argc, char const *const argv[])
This function parses the given command line arguments and sets all registered options accordingly.
std::string getHelpForModule(std::string const &moduleName, uint_fast64_t maxLength=30, bool includeAdvanced=true) const
This function prints a help message for the specified module to the standard output.
void setFromExplodedString(std::vector< std::string > const &commandLineArguments)
This function parses the given command line arguments (represented by several strings) and sets all r...
void operator=(SettingsManager const &)=delete
void setFromString(std::string const &commandLineString)
This function parses the given command line arguments (represented by one big string) and sets all re...
void setFromConfigurationFile(std::string const &configFilename)
This function parses the given file and sets all registered options accordingly.
void addModule(std::unique_ptr< modules::ModuleSettings > &&moduleSettings, bool doRegister=true)
Adds a new module with the given name.
void printHelp(std::string const &filter="frequent") const
This function prints a help message to the standard output.
void handleUnknownOption(std::string const &optionName, bool isShort) const
Throws an exception with a nice error message indicating similar valid option names.
void setName(std::string const &name, std::string const &executableName)
Sets the name of the tool.
SettingsManager(SettingsManager const &)=delete
modules::ModuleSettings const & getModule(std::string const &moduleName) const
Retrieves the settings of the module with the given name.
bool hasModule(std::string const &moduleName, bool checkHidden=false) const
Checks whether the module with the given name exists.
static SettingsManager & manager()
Retrieves the only existing instance of a settings manager.
This class represents the settings for the abstraction procedures.
This is the base class of the settings for a particular module.
storm::settings::modules::BuildSettings & mutableBuildSettings()
Retrieves the build settings in a mutable form.
storm::settings::modules::AbstractionSettings & mutableAbstractionSettings()
Retrieves the abstraction settings in a mutable form.
bool hasModule()
Returns true if the given module is registered.
SettingsType const & getModule()
Get module.
void addModule(bool doRegister=true)
Add new module to use for the settings.
void initializeAll(std::string const &name, std::string const &executableName)
Initialize the settings manager with all available modules.
SettingsManager const & manager()
Retrieves the settings manager.
SettingsManager & mutableManager()
Retrieves the settings manager.