dReal4
OptionValue< T > Class Template Reference

Represents an optional value in dReal. More...

#include </home/soonhokong/work/dreal4/dreal/util/option_value.h>

Public Types

enum  Type { DEFAULT, FROM_FILE, FROM_COMMAND_LINE, FROM_CODE }
 

Public Member Functions

 OptionValue (T value)
 Constructs an option value with value.
 
 OptionValue (const OptionValue &)=default
 Default copy constructor.
 
 OptionValue (OptionValue &&) noexcept=default
 Default move constructor.
 
OptionValueoperator= (const OptionValue &)=default
 Default copy assign operator.
 
OptionValueoperator= (OptionValue &&) noexcept=default
 Default move assign operator.
 
 ~OptionValue ()=default
 Default destructor.
 
OptionValueoperator= (const T &value)
 Copy-assign operator for T. More...
 
OptionValueoperator= (T &&value)
 Move-assign operator for T. More...
 
const T & get () const
 Returns the value.
 
void set_from_command_line (const T &value)
 Sets the value to value which is given by a command-line argument.
 
void set_from_file (const T &value)
 Sets the value to value which is provided from a file. More...
 

Friends

std::ostream & operator<< (std::ostream &os, Type type)
 

Detailed Description

template<typename T>
class dreal::OptionValue< T >

Represents an optional value in dReal.

There are four ways that an option can have its value – by default, by a command-line argument, by a set-info/set-option command from a .smt2 file, and a manual update in a code. We define an order in these types and make sure that an update is executed only if it is requested by the same type or a higher type. For example, a value set by command-line cannot be changed by an updated requested from a file.

Member Enumeration Documentation

◆ Type

enum Type
strong
Enumerator
DEFAULT 

Default value.

FROM_FILE 

Updated by a set-option/set-info in a file.

FROM_COMMAND_LINE 

Updated by a command-line argument.

FROM_CODE 

Explicitly updated by a code.

Member Function Documentation

◆ operator=() [1/2]

OptionValue& operator= ( const T &  value)
inline

Copy-assign operator for T.

Note: It sets value with Type::FROM_CODE type.

◆ operator=() [2/2]

OptionValue& operator= ( T &&  value)
inline

Move-assign operator for T.

Note: It sets value with Type::FROM_CODE type.

◆ set_from_file()

void set_from_file ( const T &  value)
inline

Sets the value to value which is provided from a file.

Note
This operation is ignored if the current value is set by command-line.

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