This class serves as the (untemplated) base class of argument classes.
More...
#include <ArgumentBase.h>
|
| 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) |
|
|
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) |
|
This class serves as the (untemplated) base class of argument classes.
Definition at line 16 of file ArgumentBase.h.
◆ ArgumentBase()
storm::settings::ArgumentBase::ArgumentBase |
( |
std::string const & |
name, |
|
|
std::string const & |
description |
|
) |
| |
|
inline |
Constructs a new argument base with the given name, description and indication whether the argument is optional.
- Parameters
-
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.
◆ ~ArgumentBase()
virtual storm::settings::ArgumentBase::~ArgumentBase |
( |
| ) |
|
|
virtualdefault |
◆ convertFromString() [1/3]
template<>
bool storm::settings::ArgumentBase::convertFromString |
( |
std::string const & |
s, |
|
|
bool & |
ok |
|
) |
| |
|
staticprotected |
◆ convertFromString() [2/3]
template<>
template double storm::settings::ArgumentBase::convertFromString |
( |
std::string const & |
valueAsString, |
|
|
bool & |
conversionSuccessful |
|
) |
| |
◆ convertFromString() [3/3]
template<typename TargetType >
TargetType storm::settings::ArgumentBase::convertFromString |
( |
std::string const & |
valueAsString, |
|
|
bool & |
conversionSuccessful |
|
) |
| |
|
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).
- Parameters
-
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.
◆ convertToString()
template<typename ValueType >
template std::string storm::settings::ArgumentBase::convertToString |
( |
ValueType const & |
value | ) |
|
|
staticprotected |
Converts the given value to a string representation.
- Parameters
-
value | The value to convert. |
- Returns
- The string representation of the value.
Definition at line 52 of file ArgumentBase.cpp.
◆ getDescription()
std::string const & storm::settings::ArgumentBase::getDescription |
( |
| ) |
const |
|
inline |
Retrieves the description of the argument.
- Returns
- The description of the argument.
Definition at line 60 of file ArgumentBase.h.
◆ getHasBeenSet()
virtual bool storm::settings::ArgumentBase::getHasBeenSet |
( |
| ) |
const |
|
inlinevirtual |
Retrieves whether the argument has been set.
- Returns
- True iff the argument has been set.
Definition at line 76 of file ArgumentBase.h.
◆ getHasDefaultValue()
virtual bool storm::settings::ArgumentBase::getHasDefaultValue |
( |
| ) |
const |
|
pure virtual |
◆ getIsOptional()
virtual bool storm::settings::ArgumentBase::getIsOptional |
( |
| ) |
const |
|
pure virtual |
◆ getName()
std::string const & storm::settings::ArgumentBase::getName |
( |
| ) |
const |
|
inline |
Retrieves the name of the argument.
- Returns
- The name of the argument.
Definition at line 51 of file ArgumentBase.h.
◆ getType()
virtual ArgumentType storm::settings::ArgumentBase::getType |
( |
| ) |
const |
|
pure virtual |
◆ getValueAsBoolean()
virtual bool storm::settings::ArgumentBase::getValueAsBoolean |
( |
| ) |
const |
|
pure virtual |
Retrieves the value of this argument as a boolean.
If the conversion cannot be performed, an exception is thrown.
- Returns
- The value of this argument as an boolean.
Implemented in storm::settings::Argument< T >.
◆ getValueAsDouble()
virtual double storm::settings::ArgumentBase::getValueAsDouble |
( |
| ) |
const |
|
pure virtual |
Retrieves the value of this argument as a double.
If the conversion cannot be performed, an exception is thrown.
- Returns
- The value of this argument as an double.
Implemented in storm::settings::Argument< T >.
◆ getValueAsInteger()
virtual int_fast64_t storm::settings::ArgumentBase::getValueAsInteger |
( |
| ) |
const |
|
pure virtual |
Retrieves the value of this argument as an integer.
If the conversion cannot be performed, an exception is thrown.
- Returns
- The value of this argument as an integer.
Implemented in storm::settings::Argument< T >.
◆ getValueAsString()
virtual std::string storm::settings::ArgumentBase::getValueAsString |
( |
| ) |
const |
|
pure virtual |
◆ getValueAsUnsignedInteger()
virtual uint_fast64_t storm::settings::ArgumentBase::getValueAsUnsignedInteger |
( |
| ) |
const |
|
pure virtual |
Retrieves the value of this argument as an unsigned integer.
If the conversion cannot be performed, an exception is thrown.
- Returns
- The value of this argument as an unsigned integer.
Implemented in storm::settings::Argument< T >.
◆ printToStream()
virtual void storm::settings::ArgumentBase::printToStream |
( |
std::ostream & |
out | ) |
const |
|
pure virtual |
◆ setFromDefaultValue()
virtual void storm::settings::ArgumentBase::setFromDefaultValue |
( |
| ) |
|
|
pure virtual |
◆ setFromStringValue()
virtual bool storm::settings::ArgumentBase::setFromStringValue |
( |
std::string const & |
stringValue | ) |
|
|
pure virtual |
Tries to set the value of the argument from the given string.
- Parameters
-
stringValue | The new value of the argument given as a string. |
- Returns
- True iff the assignment was successful.
Implemented in storm::settings::Argument< T >.
◆ wasSetFromDefaultValue()
virtual bool storm::settings::ArgumentBase::wasSetFromDefaultValue |
( |
| ) |
const |
|
pure virtual |
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
out, |
|
|
ArgumentBase const & |
argument |
|
) |
| |
|
friend |
◆ description
std::string storm::settings::ArgumentBase::description |
|
protected |
◆ hasBeenSet
bool storm::settings::ArgumentBase::hasBeenSet |
|
protected |
◆ name
std::string storm::settings::ArgumentBase::name |
|
protected |
The documentation for this class was generated from the following files: