6#include <unordered_map>
35 virtual bool check()
const;
54 std::vector<std::shared_ptr<Option>>
const&
getOptions()
const;
92 bool isSet(std::string
const& optionName)
const;
99 void addOption(std::shared_ptr<Option>
const& option);
103 std::string moduleName;
106 std::unordered_map<std::string, std::shared_ptr<Option>> optionMap;
109 std::vector<std::shared_ptr<Option>> options;
This class represents one command-line option.
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 ~ModuleSettings()
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.