BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
chess::uci::EngineCommand Struct Referencefinal

#include <libchess/uci/EngineBase.hpp>

Collaboration diagram for chess::uci::EngineCommand:

Public Types

using Callback = std::function<void(string_view)>

Static Public Member Functions

static auto void_cb (std::function< void()> &&func) -> Callback

Public Attributes

Callback action
string_view argsHelp
string_view description
string_view name

Detailed Description

A UCI command that the engine can respond to.

Definition at line 45 of file EngineBase.hpp.

Member Typedef Documentation

◆ Callback

using chess::uci::EngineCommand::Callback = std::function<void(string_view)>

Function type that is invoked when this command is executed.

Definition at line 47 of file EngineBase.hpp.

Member Function Documentation

◆ void_cb()

auto chess::uci::EngineCommand::void_cb ( std::function< void()> && func) -> Callback
inlinestaticnodiscard

Wraps a callback taking no arguments into a Callback for a command.

Definition at line 70 of file EngineBase.hpp.

Member Data Documentation

◆ action

Callback chess::uci::EngineCommand::action

Function object that will be called when the command is executed. This callback will receive the rest of the command line as its argument.

Definition at line 57 of file EngineBase.hpp.

◆ argsHelp

string_view chess::uci::EngineCommand::argsHelp

A brief string to provide some documentation for the command's arguments. This will be shown in the engine's help output. For example, if the command expects a single filepath argument, this help string might be <path>.

Definition at line 67 of file EngineBase.hpp.

◆ description

string_view chess::uci::EngineCommand::description

Brief description of this command. This will be shown in the engine's help output.

Definition at line 60 of file EngineBase.hpp.

◆ name

string_view chess::uci::EngineCommand::name

The name of the command. This is the token the user should type in the CLI to execute the command.

Definition at line 52 of file EngineBase.hpp.


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