Storm
A Modern Probabilistic Model Checker
|
This class serves as the (untemplated) base class of argument classes. More...
#include <ArgumentBase.h>
Public Member Functions | |
ArgumentBase (std::string const &name, std::string const &description) | |
Constructs a new argument base with the given name, description and indication whether the argument is optional. | |
virtual | ~ArgumentBase ()=default |
virtual ArgumentType | getType () const =0 |
Retrieves the type of the argument. | |
virtual bool | getIsOptional () const =0 |
Retrieves whether the argument is optional. | |
std::string const & | getName () const |
Retrieves the name of the argument. | |
std::string const & | getDescription () const |
Retrieves the description of the argument. | |
virtual bool | getHasDefaultValue () const =0 |
Retrieves whether the argument has a default value. | |
virtual bool | getHasBeenSet () const |
Retrieves whether the argument has been set. | |
virtual void | setFromDefaultValue ()=0 |
Sets the value of the argument from the default value. | |
virtual bool | wasSetFromDefaultValue () const =0 |
virtual bool | setFromStringValue (std::string const &stringValue)=0 |
Tries to set the value of the argument from the given string. | |
virtual std::string | getValueAsString () const =0 |
Retrieves the value of this argument as a string. | |
virtual int_fast64_t | getValueAsInteger () const =0 |
Retrieves the value of this argument as an integer. | |
virtual uint_fast64_t | getValueAsUnsignedInteger () const =0 |
Retrieves the value of this argument as an unsigned integer. | |
virtual double | getValueAsDouble () const =0 |
Retrieves the value of this argument as a double. | |
virtual bool | getValueAsBoolean () const =0 |
Retrieves the value of this argument as a boolean. | |
virtual void | printToStream (std::ostream &out) const =0 |
Prints a string representation of the argument to the provided stream. | |
template<> | |
std::string | convertFromString (std::string const &valueAsString, bool &conversionSuccessful) |
Static Protected Member Functions | |
template<typename TargetType > | |
static TargetType | convertFromString (std::string const &valueAsString, bool &conversionSuccessful) |
Converts the given value represented as a string to the type of the template parameter. | |
template<typename ValueType > | |
static std::string | convertToString (ValueType const &value) |
Converts the given value to a string representation. | |
template<> | |
bool | convertFromString (std::string const &s, bool &ok) |
Protected Attributes | |
bool | hasBeenSet |
std::string | name |
std::string | description |
Friends | |
std::ostream & | operator<< (std::ostream &out, ArgumentBase const &argument) |
This class serves as the (untemplated) base class of argument classes.
Definition at line 16 of file ArgumentBase.h.
|
inline |
Constructs a new argument base with the given name, description and indication whether the argument is optional.
name | The name of the argument. |
description | A description of the argument. |
isOptional | A flag indicating whether the argument is optional. |
Definition at line 26 of file ArgumentBase.h.
|
virtualdefault |
|
staticprotected |
Definition at line 29 of file ArgumentBase.cpp.
template double storm::settings::ArgumentBase::convertFromString | ( | std::string const & | valueAsString, |
bool & | conversionSuccessful | ||
) |
Definition at line 23 of file ArgumentBase.cpp.
|
staticprotected |
Converts the given value represented as a string to the type of the template parameter.
The second is used to signal that the conversion was successful (or not).
valueAsString | The value to convert. |
conversionSuccessful | After a call to this function returned, the supplied boolean indicates whether the conversion was successful. |
Definition at line 15 of file ArgumentBase.cpp.
|
staticprotected |
Converts the given value to a string representation.
value | The value to convert. |
Definition at line 52 of file ArgumentBase.cpp.
|
inline |
Retrieves the description of the argument.
Definition at line 60 of file ArgumentBase.h.
Retrieves whether the argument has been set.
Definition at line 76 of file ArgumentBase.h.
Retrieves whether the argument has a default value.
Implemented in storm::settings::Argument< T >.
Retrieves whether the argument is optional.
Implemented in storm::settings::Argument< T >.
|
inline |
Retrieves the name of the argument.
Definition at line 51 of file ArgumentBase.h.
|
pure virtual |
Retrieves the type of the argument.
Implemented in storm::settings::Argument< T >.
Retrieves the value of this argument as a boolean.
If the conversion cannot be performed, an exception is thrown.
Implemented in storm::settings::Argument< T >.
Retrieves the value of this argument as a double.
If the conversion cannot be performed, an exception is thrown.
Implemented in storm::settings::Argument< T >.
|
pure virtual |
Retrieves the value of this argument as an integer.
If the conversion cannot be performed, an exception is thrown.
Implemented in storm::settings::Argument< T >.
|
pure virtual |
Retrieves the value of this argument as a string.
Implemented in storm::settings::Argument< T >.
|
pure virtual |
Retrieves the value of this argument as an unsigned integer.
If the conversion cannot be performed, an exception is thrown.
Implemented in storm::settings::Argument< T >.
Prints a string representation of the argument to the provided stream.
Implemented in storm::settings::Argument< T >.
Sets the value of the argument from the default value.
Implemented in storm::settings::Argument< T >.
|
pure virtual |
Tries to set the value of the argument from the given string.
stringValue | The new value of the argument given as a string. |
Implemented in storm::settings::Argument< T >.
Implemented in storm::settings::Argument< T >.
|
friend |
Definition at line 9 of file ArgumentBase.cpp.
|
protected |
Definition at line 149 of file ArgumentBase.h.
|
protected |
Definition at line 143 of file ArgumentBase.h.
|
protected |
Definition at line 146 of file ArgumentBase.h.