OptionInfo ¶
-
struct
OptionInfo
¶
-
Holds some description about a particular option, including its name, its aliases, whether the option was explicitly set by the user, and information concerning its value. It can be obtained via
Solver::getOptionInfo()and allows for a more detailed inspection of options thanSolver::getOption(). ThevalueInfomember holds any of the following alternatives:-
VoidInfoif the option holds no value (or the value has no native type) -
ValueInfoif the option is of typeboolorstd::string, holds the current value and the default value. -
NumberInfoif the option is of typeint64_t,uint64_tordouble, holds the current and default value, as well as the minimum and maximum. -
ModeInfoif the option is a mode option, holds the current and default values, as well as a list of valid modes.
Additionally, this class provides convenience functions to obtain the current value of an option in a type-safe manner using
boolValue(),stringValue(),intValue(),uintValue()anddoubleValue(). They assert that the option has the respective type and return the current value.If the option has a special type that is not covered by the above alternatives, the
valueInfoholds aVoidInfo. Some options, that are expected to be used by frontends (e.g., input and output streams) can also be accessed usingSolver::getDriverOptions().Public Types
-
using
OptionInfoVariant
=
std
::
variant
<
VoidInfo
,
ValueInfo
<
bool
>
,
ValueInfo
<
std
::
string
>
,
NumberInfo
<
int64_t
>
,
NumberInfo
<
uint64_t
>
,
NumberInfo
<
double
>
,
ModeInfo
>
¶
-
Possible types for
valueInfo.
Public Functions
-
bool
boolValue
(
)
const
¶
-
Get the current value as a
bool.Note
Asserts that
valueInfoholds abool.- Returns :
-
The current value as a
bool.
-
std
::
string
stringValue
(
)
const
¶
-
Get the current value as a
std::string.Note
Asserts that
valueInfoholds astd::string.- Returns :
-
The current value as a
std::string.
-
int64_t
intValue
(
)
const
¶
-
Get the current value as an
int64_t.Note
Asserts that
valueInfoholds anint64_t.- Returns :
-
The current value as a
int64_t.
-
uint64_t
uintValue
(
)
const
¶
-
Get the current value as a
uint64_t.Note
Asserts that
valueInfoholds auint64_t.- Returns :
-
The current value as a
uint64_t.
-
double
doubleValue
(
)
const
¶
-
Obtain the current value as a
double.Note
Asserts that
valueInfoholds adouble.- Returns :
-
The current value as a
double.
Public Members
-
std
::
string
name
¶
-
The option name
-
std
::
vector
<
std
::
string
>
aliases
¶
-
The option name aliases
-
bool
setByUser
¶
-
Whether the option was explicitly set by the user
-
OptionInfoVariant
valueInfo
¶
-
The option value information
-
struct
ModeInfo
¶
-
Information for mode option values.
-
template
<
typename
T
>
struct NumberInfo ¶
-
Information for numeric values.
Tcan beint64_t,uint64_tordouble.
-
template
<
typename
T
>
struct ValueInfo ¶
-
Basic information for option values.
Tcan beboolorstd::string.
-
struct
VoidInfo
¶
-
Has no value information.
-