26 auto optionIterator = this->optionMap.find(longName);
27 STORM_LOG_THROW(optionIterator != this->optionMap.end(), storm::exceptions::IllegalFunctionCallException,
28 "Cannot retrieve unknown option '" << longName <<
"'.");
29 return *optionIterator->second;
33 auto optionIterator = this->optionMap.find(longName);
34 STORM_LOG_THROW(optionIterator != this->optionMap.end(), storm::exceptions::IllegalFunctionCallException,
35 "Cannot retrieve unknown option '" << longName <<
"'.");
36 return *optionIterator->second;
40 return this->moduleName;
48 auto optionIterator = this->optionMap.find(option->getLongName());
49 STORM_LOG_THROW(optionIterator == this->optionMap.end(), storm::exceptions::IllegalFunctionCallException,
50 "Unable to register the option '" << option->getLongName() <<
"' in module '" << this->getModuleName()
51 <<
"', because an option with this name already exists.");
52 this->optionMap.emplace(option->getLongName(), option);
53 this->options.push_back(option);
57 uint_fast64_t length = 0;
58 for (
auto const& option : this->options) {
59 if (includeAdvanced || !option->getIsAdvanced()) {
60 length = std::max(length, option->getPrintLength());
67 for (
auto& option : options) {
68 for (
auto& argument : option->getArguments()) {
69 if (argument->getHasDefaultValue()) {
70 argument->setFromDefaultValue();
This class represents one command-line option.
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
bool isSet(std::string const &optionName) const
Retrieves whether the option with the given name was set.
std::vector< std::shared_ptr< Option > > const & getOptions() const
Retrieves the options of this module.
ModuleSettings(std::string const &moduleName)
Constructs a new settings object.
virtual bool check() const
Checks whether the settings are consistent.
std::string const & getModuleName() const
Retrieves the name of the module to which these settings belong.
uint_fast64_t getPrintLengthOfLongestOption(bool includeAdvanced) const
Retrieves the (print) length of the longest option.
void addOption(std::shared_ptr< Option > const &option)
Adds and registers the given option.
virtual void finalize()
Prepares the modules for further usage, should be called at the end of the initialization,...
void restoreDefaults()
Restores the default values for all arguments of all options.
Option & getOption(std::string const &longName)
Retrieves the option with the given long name.
#define STORM_LOG_THROW(cond, exception, message)