Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::settings::ArgumentBase Class Referenceabstract

This class serves as the (untemplated) base class of argument classes. More...

#include <ArgumentBase.h>

Inheritance diagram for storm::settings::ArgumentBase:

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 constgetName () const
 Retrieves the name of the argument.
 
std::string constgetDescription () 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)
 

Detailed Description

This class serves as the (untemplated) base class of argument classes.

Definition at line 16 of file ArgumentBase.h.

Constructor & Destructor Documentation

◆ 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
nameThe name of the argument.
descriptionA description of the argument.
isOptionalA flag indicating whether the argument is optional.

Definition at line 26 of file ArgumentBase.h.

◆ ~ArgumentBase()

virtual storm::settings::ArgumentBase::~ArgumentBase ( )
virtualdefault

Member Function Documentation

◆ convertFromString() [1/3]

template<>
bool storm::settings::ArgumentBase::convertFromString ( std::string const s,
bool ok 
)
staticprotected

Definition at line 29 of file ArgumentBase.cpp.

◆ convertFromString() [2/3]

template<>
template double storm::settings::ArgumentBase::convertFromString ( std::string const valueAsString,
bool conversionSuccessful 
)

Definition at line 23 of file ArgumentBase.cpp.

◆ 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
valueAsStringThe value to convert.
conversionSuccessfulAfter 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
valueThe 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

Retrieves whether the argument has a default value.

Returns
True iff the argument has a default value.

Implemented in storm::settings::Argument< T >.

◆ getIsOptional()

virtual bool storm::settings::ArgumentBase::getIsOptional ( ) const
pure virtual

Retrieves whether the argument is optional.

Returns
True iff the argument is optional.

Implemented in storm::settings::Argument< T >.

◆ 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

Retrieves the type of the argument.

Returns
The type of the argument.

Implemented in storm::settings::Argument< T >.

◆ 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

Retrieves the value of this argument as a string.

Returns
The value of this argument as a string.

Implemented in storm::settings::Argument< T >.

◆ 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

Prints a string representation of the argument to the provided stream.

Implemented in storm::settings::Argument< T >.

◆ setFromDefaultValue()

virtual void storm::settings::ArgumentBase::setFromDefaultValue ( )
pure virtual

Sets the value of the argument from the default value.

Implemented in storm::settings::Argument< T >.

◆ 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
stringValueThe 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

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
ArgumentBase const argument 
)
friend

Definition at line 9 of file ArgumentBase.cpp.

Member Data Documentation

◆ description

std::string storm::settings::ArgumentBase::description
protected

Definition at line 149 of file ArgumentBase.h.

◆ hasBeenSet

bool storm::settings::ArgumentBase::hasBeenSet
protected

Definition at line 143 of file ArgumentBase.h.

◆ name

std::string storm::settings::ArgumentBase::name
protected

Definition at line 146 of file ArgumentBase.h.


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