|
|
delpi
0.0.1
DElta-complete LP solver
|
Represents an optional value in dLinear. More...
#include <OptionValue.hpp>
Public Types | |
| enum class | Type { DEFAULT , FROM_FILE , FROM_COMMAND_LINE , FROM_CODE } |
| Type of the value. More... | |
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. | |
| OptionValue & | operator= (const OptionValue &)=default |
| Default copy assign operator. | |
| OptionValue & | operator= (OptionValue &&) noexcept=default |
| Default move assign operator. | |
| OptionValue & | operator= (const T &value) |
| Copy-assign operator for T. | |
| OptionValue & | operator= (T &&value) |
| Move-assign operator for T. | |
| void | SetFromCommandLine (const T &value) |
| Sets the value to value which is given by a command-line argument. | |
| void | SetFromFile (const T &value) |
| Sets the value to value which is provided from a file. | |
Private Attributes | |
| T | value_ |
| Value the class holds. | |
| Type | type_ |
| Type of the value. | |
Represents an optional value in dLinear.
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.
| T | Type of the value the class will hold. |
Definition at line 32 of file OptionValue.hpp.
|
strong |
Type of the value.
Each type encodes a priority, and an update is executed only if it is requested by the same type or a higher type.
| 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 from code. |
Definition at line 39 of file OptionValue.hpp.
|
inlineexplicit |
Constructs an option value with value.
| value | value to be held. |
Definition at line 50 of file OptionValue.hpp.
|
inline |
Copy-assign operator for T.
Definition at line 65 of file OptionValue.hpp.
|
inline |
Move-assign operator for T.
Definition at line 75 of file OptionValue.hpp.
|
inline |
Sets the value to value which is given by a command-line argument.
It sets the type to Type::FROM_COMMAND_LINE. It does nothing if the current type is Type::FROM_CODE.
| value | new value, given by a command-line argument. |
Definition at line 92 of file OptionValue.hpp.
|
inline |
Sets the value to value which is provided from a file.
It sets the type to Type::FROM_FILE. It does nothing if the current type is Type::FROM_COMMAND_LINE or Type::FROM_CODE.
| value | new value, provided from a file. |
Definition at line 105 of file OptionValue.hpp.