BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
ben_bot::CustomCommand Struct Referencefinal

#include <libbenbot/engine/CustomCommand.hpp>

Collaboration diagram for ben_bot::CustomCommand:

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 custom UCI command that the engine can respond to.

Definition at line 35 of file CustomCommand.hpp.

Member Typedef Documentation

◆ Callback

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

Function type that is invoked when this command is executed.

Definition at line 37 of file CustomCommand.hpp.

Member Function Documentation

◆ void_cb()

auto ben_bot::CustomCommand::void_cb ( std::function< void()> && func) -> Callback
inlinestaticnodiscard

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

Definition at line 60 of file CustomCommand.hpp.

Member Data Documentation

◆ action

Callback ben_bot::CustomCommand::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 47 of file CustomCommand.hpp.

◆ argsHelp

string_view ben_bot::CustomCommand::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 57 of file CustomCommand.hpp.

◆ description

string_view ben_bot::CustomCommand::description

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

Definition at line 50 of file CustomCommand.hpp.

◆ name

string_view ben_bot::CustomCommand::name

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

Definition at line 42 of file CustomCommand.hpp.


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