1#ifndef STORM_SETTINGS_ARGUMENTBASE_H_
2#define STORM_SETTINGS_ARGUMENTBASE_H_
159 template<
typename TargetType>
168 template<
typename ValueType>
This class serves as the (untemplated) base class of argument classes.
std::string const & getDescription() const
Retrieves the description of the argument.
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual ~ArgumentBase()=default
virtual bool setFromStringValue(std::string const &stringValue)=0
Tries to set the value of the argument from the given string.
static TargetType convertFromString(std::string const &valueAsString, bool &conversionSuccessful)
Converts the given value represented as a string to the type of the template parameter.
static std::string convertToString(ValueType const &value)
Converts the given value to a string representation.
virtual int_fast64_t getValueAsInteger() const =0
Retrieves the value of this argument as an integer.
virtual bool getIsOptional() const =0
Retrieves whether the argument is optional.
std::string const & getName() const
Retrieves the name of the argument.
virtual void setFromDefaultValue()=0
Sets the value of the argument from the default value.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
virtual ArgumentType getType() const =0
Retrieves the type of the argument.
virtual bool getHasBeenSet() const
Retrieves whether the argument has been set.
virtual bool getValueAsBoolean() const =0
Retrieves the value of this argument as a boolean.
friend std::ostream & operator<<(std::ostream &out, ArgumentBase const &argument)
virtual void printToStream(std::ostream &out) const =0
Prints a string representation of the argument to the provided stream.
ArgumentBase(std::string const &name, std::string const &description)
Constructs a new argument base with the given name, description and indication whether the argument i...
virtual double getValueAsDouble() const =0
Retrieves the value of this argument as a double.
virtual bool wasSetFromDefaultValue() const =0
virtual bool getHasDefaultValue() const =0
Retrieves whether the argument has a default value.
SettingsType const & getModule()
Get module.
ArgumentType
This enum captures all possible types for arguments.