Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ModuleSettings.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <memory>
5#include <string>
6#include <unordered_map>
7#include <vector>
8
9namespace storm {
10namespace settings {
11// Forward-declare some classes.
12class SettingsManager;
13class Option;
14
15namespace modules {
16
21 public:
27 ModuleSettings(std::string const& moduleName);
28 virtual ~ModuleSettings() {}
29
35 virtual bool check() const;
36
40 virtual void finalize();
41
47 std::string const& getModuleName() const;
48
54 std::vector<std::shared_ptr<Option>> const& getOptions() const;
55
62 uint_fast64_t getPrintLengthOfLongestOption(bool includeAdvanced) const;
63
67 void restoreDefaults();
68
69 protected:
76 Option& getOption(std::string const& longName);
77
84 Option const& getOption(std::string const& longName) const;
85
92 bool isSet(std::string const& optionName) const;
93
99 void addOption(std::shared_ptr<Option> const& option);
100
101 private:
102 // The name of the module.
103 std::string moduleName;
104
105 // A mapping of option names of the module to the actual options.
106 std::unordered_map<std::string, std::shared_ptr<Option>> optionMap;
107
108 // The list of known option names in the order they were registered.
109 std::vector<std::shared_ptr<Option>> options;
110};
111
112} // namespace modules
113} // namespace settings
114} // namespace storm
This class represents one command-line option.
Definition Option.h:26
Provides the central API for the registration of command line options and parsing the options from th...
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.