Proxy object for interacting with a UCI engine option.
More...
#include <EngineConnection.h>
|
|
| EngineOptionProxy (const Option &option, std::shared_ptr< AbstractPipeWriter > pipeWriter) |
| |
|
| EngineOptionProxy (const EngineOptionProxy &other) |
| |
| OptionType | type () const |
| | Get the option type.
|
| |
| const std::string & | id () const |
| | Get the option name.
|
| |
| const Option & | getAsOption () const |
| | Get the full Option object with all metadata.
|
| |
| void | click () |
| | Activate a button option.
|
| |
| const std::string & | operator= (const std::string &value) |
| | Set option value from a string.
|
| |
| const char * | operator= (const char *value) |
| | Set option value from a C-string.
|
| |
| const int32_t & | operator= (const int32_t &number) |
| | Set a spin option to an integer value.
|
| |
| const bool & | operator= (const bool &value) |
| | Set a check option to a boolean value.
|
| |
| | operator bool () |
| | Get check option value as boolean.
|
| |
| | operator int () |
| | Get spin option value as integer.
|
| |
| | operator std::string () |
| | Get option value as string.
|
| |
Proxy object for interacting with a UCI engine option.
EngineOptionProxy provides a convenient interface for reading and modifying engine options. Instances are typically obtained through bracket notation on EngineInstance::options:
auto& hashOption = instance->options["Hash"];
Assigning values to this proxy automatically sends the appropriate setoption UCI command to the engine. The initial value is the engine's declared default.
- See also
- EngineInstance::options
◆ click()
| void UCILoader::EngineOptionProxy::click |
( |
| ) |
|
Activate a button option.
- Exceptions
-
◆ getAsOption()
| const Option & UCILoader::EngineOptionProxy::getAsOption |
( |
| ) |
const |
|
inline |
Get the full Option object with all metadata.
- Returns
- Const reference to the underlying Option
Useful for exporting or inspecting the full option configuration including type-specific details.
◆ id()
| const std::string & UCILoader::EngineOptionProxy::id |
( |
| ) |
const |
|
inline |
Get the option name.
- Returns
- The option identifier (e.g., "Hash", "UCI_ShowWDL", "Clear Hash")
◆ operator bool()
| UCILoader::EngineOptionProxy::operator bool |
( |
| ) |
|
Get check option value as boolean.
- Exceptions
-
- Returns
- The boolean option value
◆ operator int()
| UCILoader::EngineOptionProxy::operator int |
( |
| ) |
|
Get spin option value as integer.
- Exceptions
-
- Returns
- The integer option value
◆ operator std::string()
| UCILoader::EngineOptionProxy::operator std::string |
( |
| ) |
|
Get option value as string.
- Exceptions
-
- Returns
- The string representation of the option value
◆ operator=() [1/4]
| const bool & UCILoader::EngineOptionProxy::operator= |
( |
const bool & |
value | ) |
|
Set a check option to a boolean value.
- Parameters
-
| value | The boolean state (true or false) |
- Returns
- Reference to the assigned value
- Exceptions
-
◆ operator=() [2/4]
| const char * UCILoader::EngineOptionProxy::operator= |
( |
const char * |
value | ) |
|
Set option value from a C-string.
- Parameters
-
| value | The C-string value to assign |
- Returns
- Pointer to the assigned value
- Exceptions
-
- See also
- NotSupportedValueException for validation rules by option type
◆ operator=() [3/4]
| const int32_t & UCILoader::EngineOptionProxy::operator= |
( |
const int32_t & |
number | ) |
|
Set a spin option to an integer value.
- Parameters
-
| number | The integer value to assign |
- Returns
- Reference to the assigned value
- Exceptions
-
- See also
- getAsOption().spin_content() to check min/max range
◆ operator=() [4/4]
| const std::string & UCILoader::EngineOptionProxy::operator= |
( |
const std::string & |
value | ) |
|
Set option value from a string.
- Parameters
-
| value | The string value to assign |
- Returns
- Reference to the assigned value
- Exceptions
-
- See also
- NotSupportedValueException for validation rules by option type
◆ type()
| OptionType UCILoader::EngineOptionProxy::type |
( |
| ) |
const |
|
inline |
Get the option type.
- Returns
- The OptionType (Button, Check, Spin, Combo, or String)
The documentation for this class was generated from the following files: