Belofte version 2.2.0
A promising chess program using the UCI or Winboard interface
UCIMode Class Reference

#include <engineinterface.h>

+ Inheritance diagram for UCIMode:
+ Collaboration diagram for UCIMode:

Public Member Functions

 UCIMode (std::string &&s="uci")
 
 ~UCIMode () override
 
bool isRunning () const override
 
void sendInfo (std::string const &info) override
 
void sendDebug (int const l, std::string const &info) override
 
void sendMove (bBoard &b, bMove const &m) override
 
void sendResult (bBoard const &b, gameResult_t const gr) const override
 
void sendInfoDepth (int depth, int seldepth, int64_t nodes, int nps) override
 
void sendInfoSearching (bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, bScore const sc, int64_t const t, int64_t const nodes) const override
 
void sendInfoSearching (bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, std::string const &comment, bScore const sc, int64_t const t, int64_t const nodes) const override
 Called from root search, can also be called with comments from other depths.
 
void sendInfoCurrMove (bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid, int64_t const nodes) const override
 
- Public Member Functions inherited from engineInterface
 engineInterface (std::string &&n, std::string &&h="")
 Common commands to all modes this ctor is called for each iface.
 
virtual ~engineInterface ()
 
 engineInterface (engineInterface const &)=delete
 
 engineInterface (engineInterface &&)=delete
 
engineInterfaceoperator= (engineInterface const &)=delete
 
engineInterfaceoperator= (engineInterface &&)=delete
 
void execute (std::string const &command, std::string const &params)
 
virtual void setRunning (bool const r)
 
virtual void sendPrompt ()
 
virtual void sendResponse (std::string const &response)
 
virtual void sendInvalidMove (std::string const &mv, std::string const &reason)
 
virtual void sendError (std::string const &error, std::string const &description)
 
virtual void sendHelp (std::string const &args)
 Send help on command or all commands.
 
virtual void sendInfoSearchStart (std::string const &info)
 
std::string const & getHint () const
 
 operator std::string () const &
 
virtual std::string engineGameResultString (gameResult_t const gr) const
 

Protected Member Functions

std::string scoreString (bScore const score) const override
 
- Protected Member Functions inherited from engineInterface
void attachCommand (belofte::stringList const &sCommands, bool const published=true)
 

Additional Inherited Members

- Static Public Member Functions inherited from engineInterface
static std::string scoreAsString (bScore const score)
 
- Static Protected Member Functions inherited from engineInterface
static void initCommand (std::vector< engineUserCommand * > cmds)
 
static engineCommands_tgetEngineCommands ()
 

Detailed Description

Definition at line 128 of file engineinterface.h.

Constructor & Destructor Documentation

◆ UCIMode()

UCIMode::UCIMode ( std::string && s = "uci")
explicit

Definition at line 263 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ ~UCIMode()

UCIMode::~UCIMode ( )
inlineoverride

Definition at line 131 of file engineinterface.h.

Member Function Documentation

◆ isRunning()

bool UCIMode::isRunning ( ) const
inlineoverridevirtual

Reimplemented from engineInterface.

Definition at line 135 of file engineinterface.h.

◆ sendInfo()

void UCIMode::sendInfo ( std::string const & info)
overridevirtual

Reimplemented from engineInterface.

Definition at line 315 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendDebug()

void UCIMode::sendDebug ( int const l,
std::string const & info )
overridevirtual

Reimplemented from engineInterface.

Definition at line 323 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendMove()

void UCIMode::sendMove ( bBoard & b,
bMove const & m )
overridevirtual
Todo
: retrieve ponder out of board if (ponder != "") App().sout(-2) << " ponder " << ponder;

Reimplemented from engineInterface.

Definition at line 297 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendResult()

void UCIMode::sendResult ( bBoard const & b,
gameResult_t const gr ) const
overridevirtual

Reimplemented from engineInterface.

Definition at line 305 of file engineinterface.cpp.

◆ sendInfoDepth()

void UCIMode::sendInfoDepth ( int depth,
int seldepth,
int64_t nodes,
int nps )
overridevirtual

Reimplemented from engineInterface.

Definition at line 329 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendInfoSearching() [1/2]

void UCIMode::sendInfoSearching ( bBoard const & b,
int const nLogDepth,
depth_t const nMaxDepth,
bScore const sc,
int64_t const t,
int64_t const nodes ) const
overridevirtual

Reimplemented from engineInterface.

Definition at line 343 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendInfoSearching() [2/2]

void UCIMode::sendInfoSearching ( bBoard const & b,
int const nLogDepth,
depth_t const nMaxDepth,
std::string const & comment,
bScore const sc,
int64_t const t,
int64_t const nodes ) const
overridevirtual

Called from root search, can also be called with comments from other depths.

Reimplemented from engineInterface.

Definition at line 371 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ sendInfoCurrMove()

void UCIMode::sendInfoCurrMove ( bBoard const & b,
depth_t const nCurDepth,
bMove const & m,
movenum_t const moveid,
int64_t const nodes ) const
overridevirtual

Reimplemented from engineInterface.

Definition at line 432 of file engineinterface.cpp.

+ Here is the call graph for this function:

◆ scoreString()

std::string UCIMode::scoreString ( bScore const score) const
overrideprotectedvirtual

Reimplemented from engineInterface.

Definition at line 446 of file engineinterface.cpp.

Referenced by sendInfoSearching(), and sendInfoSearching().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: