Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
epd_testsuite.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------+
2 * File: epd_testsuite.h
3 * Project: part of belofte - A Promising Chess Program
4 * Author: yves
5 * SPDX-License-Identifier: GPL-2.0-only
6+----------------------------------------------------------------------*/
7
8#if !defined(EPD_TESTSUITE_H)
9#define EPD_TESTSUITE_H
10
11#define EPD_PERFTMAXDEPTH 32
12
13typedef std::vector<std::string> bEpdParamList;
14typedef int bEpdResult; // TODO: change to enum
15typedef std::map<std::string, std::string> bEpdOpCodes;
16
22
24
25//-----------------------------------------------------------------------
26
27class bEpd {
28public:
29 explicit bEpd(epdTest_t const typeOfTest);
30 virtual ~bEpd();
31
32 // no copy or move ctor nor assignment defined
33 bEpd(bEpd const&) = delete;
34 bEpd(bEpd&&) = delete;
35 bEpd& operator=(bEpd const&) = delete;
36 bEpd& operator=(bEpd&&) = delete;
37
38 virtual bEpdResult parse();
39 operator std::string() const;
40
41protected:
42 void setPos(std::string const& s);
43
45
46private:
47 bool m_valid = false;
48 std::string m_Pos;
49 std::string m_Fen;
50 bEpdOpCodes m_Keys;
51
52public:
53 enum tReturn {
57 EPD_OK = 0,
58 BM_OK = 10,
59 AM_OK = 11,
60 MATE_OK = 12,
61 PERFT_OK = 13
62 };
63};
64
65class bEpdPos final : public bEpd {
66public:
67 explicit bEpdPos(std::string const& sEpd, epdTest_t const typeOfTest);
68 explicit bEpdPos(bEpdParamList const& sParams, epdTest_t const typeOfTest);
69 virtual ~bEpdPos() override;
70
71 // no copy or move ctor nor assignment defined
72 bEpdPos(bEpdPos const&) = delete;
73 bEpdPos(bEpdPos&&) = delete;
74 bEpdPos& operator=(bEpdPos const&) = delete;
76};
77
78class bEpdFile final : public bEpd {
79public:
80 explicit bEpdFile(std::string const& sFileName, epdTest_t const typeOfTest);
81 explicit bEpdFile(bEpdParamList const& sParams, epdTest_t const typeOfTest);
82 virtual ~bEpdFile() override;
83
84 // no copy or move ctor nor assignment defined
85 bEpdFile(bEpdFile const&) = delete;
86 bEpdFile(bEpdFile&&) = delete;
87 bEpdFile& operator=(bEpdFile const&) = delete;
89
90 virtual bEpdResult parse() final;
91
92private:
93 void handleFile(std::string const& sFileName);
94
95 std::ifstream m_sEpdFile;
96};
97
98#endif // defined EPD_TESTSUITE_H
99
100// eof
101
virtual ~bEpdFile() override
bEpdFile(bEpdFile const &)=delete
bEpdFile & operator=(bEpdFile const &)=delete
bEpdFile(bEpdFile &&)=delete
bEpdFile & operator=(bEpdFile &&)=delete
virtual bEpdResult parse() final
Main epd parser for multiple lines of epd file Will calculate a total score and some statistics.
bEpd(bEpd &&)=delete
virtual bEpdResult parse()
virtual ~bEpd()
bEpd & operator=(bEpd &&)=delete
void setPos(std::string const &s)
EPD pos is fen-board fen-tomove fen-castling fen-ep [50moves] [move#] cmdsection* cmdsection is bm Sa...
bEpd & operator=(bEpd const &)=delete
@ NO_MOVE_FOUND
@ NOT_RESOLVED
@ EPD_ERROR
bEpd(bEpd const &)=delete
epdTest_t m_typeOfTest
bEpdPos(bEpdPos &&)=delete
bEpdPos(bEpdPos const &)=delete
bEpdPos & operator=(bEpdPos &&)=delete
bEpdPos & operator=(bEpdPos const &)=delete
virtual ~bEpdPos() override
std::vector< std::string > bEpdParamList
enum tEpdTestType epdTest_t
tEpdTestType
@ EPD_STS
@ EPD_GENERIC
@ EPD_PERF
int bEpdResult
std::map< std::string, std::string > bEpdOpCodes