8#if !defined(ENGINEINTERFACE_H)
9#define ENGINEINTERFACE_H
15 const char * what ()
const noexcept override
16 {
return "Quit command"; }
25#pragma GCC diagnostic push
26#pragma GCC diagnostic ignored "-Wunused-parameter"
43 void execute(std::string
const& command, std::string
const& params);
55 virtual void sendError(std::string
const& error, std::string
const& description);
56 virtual void sendHelp(std::string
const& args);
59 virtual void sendDebug(
int const l, std::string
const& info)
67 int64_t nodes,
int nps)
71 bScore const sc, int64_t
const t, int64_t
const nodes)
const
74 depth_t const nMaxDepth, std::string
const& comment,
75 bScore const sc, int64_t
const t, int64_t
const nodes)
const
80 int64_t
const nodes)
const
86 operator std::string() const&
87 {
return const_cast<std::string const&
>(m_name); }
94 static void initCommand(std::vector<engineUserCommand *> cmds);
96 bool const published =
true);
109 bool m_running =
false;
130 explicit UCIMode(std::string&& s =
"uci");
138 void sendInfo(std::string
const& info)
override;
139 void sendDebug(
int const l, std::string
const& info)
override;
146 bScore const sc, int64_t
const t,
147 int64_t
const nodes)
const override;
149 depth_t const nMaxDepth, std::string
const& comment,
150 bScore const sc, int64_t
const t,
151 int64_t
const nodes)
const override;
155 int64_t
const nodes)
const override;
161 inline static void printPV(
bBoard const& b,
163 int const nVariationDepth);
167#pragma GCC diagnostic pop
174 explicit XboardMode(std::string&& s =
"xboard");
178 void sendInfo(std::string
const& info)
override;
179 void sendDebug(
int const l, std::string
const& info)
override;
182 std::string
const& reason)
override;
185 bScore const sc, int64_t
const t,
186 int64_t
const nodes)
const override;
std::map< std::string, bool > commandList_t
std::map< std::string, engineUserCommand * > engineCommands_t
void sendPrompt() override
void sendDebug(int const l, std::string const &info) override
void sendResult(bBoard const &b, gameResult_t const gr) const override
void sendInfoCurrMove(bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid, int64_t const nodes) const override
bool isRunning() const override
void sendInfoDepth(int depth, int seldepth, int64_t nodes, int nps) override
void sendMove(bBoard &b, bMove const &m) 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
UCIMode(std::string &&s="uci")
std::string scoreString(bScore const score) const override
void sendInfo(std::string const &info) override
std::string engineGameResultString(gameResult_t const gr) const override
void sendDebug(int const l, std::string const &info) override
XboardMode(std::string &&s="xboard")
void sendInvalidMove(std::string const &mv, std::string const &reason) override
void sendResult(bBoard const &b, gameResult_t const gr) const 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
std::string scoreString(bScore const score) const override
void sendInfo(std::string const &info) override
virtual void sendResult(bBoard const &b, gameResult_t const gr) const
virtual ~engineInterface()
virtual 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
engineInterface & operator=(engineInterface const &)=delete
void attachCommand(belofte::stringList const &sCommands, bool const published=true)
virtual void sendResponse(std::string const &response)
engineInterface & operator=(engineInterface &&)=delete
virtual void sendDebug(int const l, std::string const &info)
engineInterface(engineInterface const &)=delete
virtual void sendInfoSearching(bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, bScore const sc, int64_t const t, int64_t const nodes) const
static engineCommands_t & getEngineCommands()
virtual void setRunning(bool const r)
virtual void sendMove(bBoard &b, bMove const &m)
virtual void sendHelp(std::string const &args)
Send help on command or all commands.
virtual std::string engineGameResultString(gameResult_t const gr) const
virtual void sendInfoCurrMove(bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid, int64_t const nodes) const
static void initCommand(std::vector< engineUserCommand * > cmds)
engineInterface(engineInterface &&)=delete
void execute(std::string const &command, std::string const ¶ms)
virtual void sendInvalidMove(std::string const &mv, std::string const &reason)
virtual void sendInfo(std::string const &info)
virtual bool isRunning() const
std::string const & getHint() const
virtual void sendInfoSearchStart(std::string const &info)
engineInterface(std::string &&n, std::string &&h="")
Common commands to all modes this ctor is called for each iface.
virtual std::string scoreString(bScore const score) const
virtual void sendError(std::string const &error, std::string const &description)
static std::string scoreAsString(bScore const score)
virtual void sendInfoDepth(int depth, int seldepth, int64_t nodes, int nps)
virtual void sendPrompt()
std::map< std::string, engineUserCommand * > engineCommands_t
std::map< std::string, engineInterface * > engineInterfaces_t
enum gameResult gameResult_t
std::vector< std::string > stringList