Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::settings::Option Class Reference

This class represents one command-line option. More...

#include <Option.h>

Public Member Functions

 Option (std::string const &moduleName, std::string const &longOptionName, std::string const &optionDescription, bool isOptionRequired, bool requireModulePrefix, bool isAdvanced, std::vector< std::shared_ptr< ArgumentBase > > const &optionArguments=std::vector< std::shared_ptr< ArgumentBase > >())
 Creates an option with the given parameters.
 
 Option (std::string const &moduleName, std::string const &longOptionName, std::string const &shortOptionName, std::string const &optionDescription, bool isOptionRequired, bool requireModulePrefix, bool isAdvanced, std::vector< std::shared_ptr< ArgumentBase > > const &optionArguments=std::vector< std::shared_ptr< ArgumentBase > >())
 Creates an option with the given parameters.
 
bool isCompatibleWith (Option const &other)
 Checks whether the given option is compatible with the current one.
 
uint_fast64_t getArgumentCount () const
 Retrieves the argument count this option expects.
 
ArgumentBase constgetArgument (uint_fast64_t argumentIndex) const
 Retrieves the i-th argument of this option.
 
ArgumentBasegetArgument (uint_fast64_t argumentIndex)
 Retrieves the i-th argument of this option.
 
ArgumentBase constgetArgumentByName (std::string const &argumentName) const
 Returns a reference to the argument with the specified long name.
 
ArgumentBasegetArgumentByName (std::string const &argumentName)
 Returns a reference to the argument with the specified long name.
 
std::string constgetLongName () const
 Retrieves the long name of this option.
 
bool getHasShortName () const
 Retrieves whether this option has a short name.
 
std::string constgetShortName () const
 Retrieves the short name of this option.
 
std::string constgetDescription () const
 Retrieves the description of the option.
 
std::string constgetModuleName () const
 Retrieves the name of the module to which this option belongs.
 
bool getIsRequired () const
 Retrieves whether the option is required.
 
bool getRequiresModulePrefix () const
 Retrieves whether the option requires the module name as a prefix.
 
bool getHasOptionBeenSet () const
 Retrieves whether the option has been set.
 
bool getHasOptionBeenSetWithModulePrefix () const
 Retrieves whether the option has been set by including the module prefix.
 
bool getIsAdvanced () const
 Retrieves whether the option is only displayed in the advanced help.
 
std::vector< std::shared_ptr< ArgumentBase > > constgetArguments () const
 Retrieves the arguments of the option.
 
uint_fast64_t getPrintLength () const
 Retrieves the (print) length of the option.
 

Friends

class SettingsManager
 
class modules::ModuleSettings
 
std::ostream & operator<< (std::ostream &out, Option const &option)
 

Detailed Description

This class represents one command-line option.

Definition at line 27 of file Option.h.

Constructor & Destructor Documentation

◆ Option() [1/2]

storm::settings::Option::Option ( std::string const moduleName,
std::string const longOptionName,
std::string const optionDescription,
bool  isOptionRequired,
bool  requireModulePrefix,
bool  isAdvanced,
std::vector< std::shared_ptr< ArgumentBase > > const optionArguments = std::vector<std::shared_ptr<ArgumentBase>>() 
)

Creates an option with the given parameters.

Parameters
moduleNameThe module to which this option belongs.
longOptionNameThe long option name.
optionDescriptionThe description of the option.
isOptionRequiredSets whether the option is required to appear.
requireModulePrefixA flag that indicates whether this option requires to be prefixed with the module name.
isAdvancedA flag that indicates whether this option is only displayed in the advanced help
optionArgumentsThe arguments of the option.

Definition at line 16 of file Option.cpp.

◆ Option() [2/2]

storm::settings::Option::Option ( std::string const moduleName,
std::string const longOptionName,
std::string const shortOptionName,
std::string const optionDescription,
bool  isOptionRequired,
bool  requireModulePrefix,
bool  isAdvanced,
std::vector< std::shared_ptr< ArgumentBase > > const optionArguments = std::vector<std::shared_ptr<ArgumentBase>>() 
)

Creates an option with the given parameters.

Parameters
moduleNameThe module to which this option belongs.
longOptionNameThe long option name.
shortOptionNameThe short option name.
optionDescriptionThe description of the option.
isOptionRequiredSets whether the option is required to appear.
requireModulePrefixA flag that indicates whether this option requires to be prefixed with the
isAdvancedA flag that indicates whether this option is only displayed in the advanced help
optionArgumentsThe arguments of the option.

Definition at line 22 of file Option.cpp.

Member Function Documentation

◆ getArgument() [1/2]

ArgumentBase & storm::settings::Option::getArgument ( uint_fast64_t  argumentIndex)

Retrieves the i-th argument of this option.

Parameters
argumentIndexThe index of the argument to retrieve.
Returns
The i-th argument of this option.

Definition at line 74 of file Option.cpp.

◆ getArgument() [2/2]

ArgumentBase const & storm::settings::Option::getArgument ( uint_fast64_t  argumentIndex) const

Retrieves the i-th argument of this option.

Parameters
argumentIndexThe index of the argument to retrieve.
Returns
The i-th argument of this option.

Definition at line 69 of file Option.cpp.

◆ getArgumentByName() [1/2]

ArgumentBase & storm::settings::Option::getArgumentByName ( std::string const argumentName)

Returns a reference to the argument with the specified long name.

Parameters
argumentNameThe name of the argument to retrieve.
Returns
The argument with the given name.

Definition at line 86 of file Option.cpp.

◆ getArgumentByName() [2/2]

ArgumentBase const & storm::settings::Option::getArgumentByName ( std::string const argumentName) const

Returns a reference to the argument with the specified long name.

Parameters
argumentNameThe name of the argument to retrieve.
Returns
The argument with the given name.

Definition at line 79 of file Option.cpp.

◆ getArgumentCount()

uint_fast64_t storm::settings::Option::getArgumentCount ( ) const

Retrieves the argument count this option expects.

Returns
The argument count of this option.

Definition at line 65 of file Option.cpp.

◆ getArguments()

std::vector< std::shared_ptr< ArgumentBase > > const & storm::settings::Option::getArguments ( ) const

Retrieves the arguments of the option.

Returns
The arguments of the option.

Definition at line 196 of file Option.cpp.

◆ getDescription()

std::string const & storm::settings::Option::getDescription ( ) const

Retrieves the description of the option.

Returns
The description of the option.

Definition at line 105 of file Option.cpp.

◆ getHasOptionBeenSet()

bool storm::settings::Option::getHasOptionBeenSet ( ) const

Retrieves whether the option has been set.

Returns
True iff the option has been set.

Definition at line 125 of file Option.cpp.

◆ getHasOptionBeenSetWithModulePrefix()

bool storm::settings::Option::getHasOptionBeenSetWithModulePrefix ( ) const

Retrieves whether the option has been set by including the module prefix.

Returns
True iff the option has been set by including the module prefix.

Definition at line 129 of file Option.cpp.

◆ getHasShortName()

bool storm::settings::Option::getHasShortName ( ) const

Retrieves whether this option has a short name.

Returns
True iff the option has a short name.

Definition at line 97 of file Option.cpp.

◆ getIsAdvanced()

bool storm::settings::Option::getIsAdvanced ( ) const

Retrieves whether the option is only displayed in the advanced help.

Definition at line 121 of file Option.cpp.

◆ getIsRequired()

bool storm::settings::Option::getIsRequired ( ) const

Retrieves whether the option is required.

Returns
True iff the option is required.

Definition at line 113 of file Option.cpp.

◆ getLongName()

std::string const & storm::settings::Option::getLongName ( ) const

Retrieves the long name of this option.

Returns
The long name of this option.

Definition at line 93 of file Option.cpp.

◆ getModuleName()

std::string const & storm::settings::Option::getModuleName ( ) const

Retrieves the name of the module to which this option belongs.

Returns
The name of the module to which this option belongs.

Definition at line 109 of file Option.cpp.

◆ getPrintLength()

uint_fast64_t storm::settings::Option::getPrintLength ( ) const

Retrieves the (print) length of the option.

Returns
The length of the option.

Definition at line 177 of file Option.cpp.

◆ getRequiresModulePrefix()

bool storm::settings::Option::getRequiresModulePrefix ( ) const

Retrieves whether the option requires the module name as a prefix.

Returns
True iff the option requires the module name as a prefix.

Definition at line 117 of file Option.cpp.

◆ getShortName()

std::string const & storm::settings::Option::getShortName ( ) const

Retrieves the short name of this option.

Returns
The short name of this option.

Definition at line 101 of file Option.cpp.

◆ isCompatibleWith()

bool storm::settings::Option::isCompatibleWith ( Option const other)

Checks whether the given option is compatible with the current one.

If not, an exception is thrown.

Parameters
otherThe other option with which to check compatibility.
Returns
True iff the given argument is compatible with the current one.

Definition at line 28 of file Option.cpp.

Friends And Related Symbol Documentation

◆ modules::ModuleSettings

Definition at line 31 of file Option.h.

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
Option const option 
)
friend

Definition at line 200 of file Option.cpp.

◆ SettingsManager

Definition at line 30 of file Option.h.


The documentation for this class was generated from the following files: