All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
usiReporter.h
Go to the documentation of this file.
1 /* usiReporter.h
2  */
3 #ifndef OSL_USIREPORTER_H
4 #define OSL_USIREPORTER_H
7 #include <boost/asio/ip/udp.hpp>
8 #include <iosfwd>
9 
10 namespace osl
11 {
12  namespace search
13  {
14  struct UsiReporter
15  {
16  static void newDepth(std::ostream& os, int depth);
17  static void showPV(std::ostream& os, int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last, bool ignore_silent=false);
18  static void showPVExtended(std::ostream& os, int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last,
19  const bool *threatmate_first, const bool *threatmate_last);
20  static void rootMove(std::ostream& os, Move cur, bool allow_frequent_display=false);
21  static void timeInfo(std::ostream& os, size_t node_count, double elapsed);
22  static void hashInfo(std::ostream& os, double ratio);
23  };
24 
25  class UsiMonitor : public SearchMonitor
26  {
28  std::string deferred;
29  double silent_period;
30  bool extended;
31  MilliSeconds depth0;
32  std::ostream& os;
33  boost::asio::ip::udp::socket *udp_socket;
34  boost::asio::ip::udp::endpoint *udp_endpoint;
35  std::string client_id;
36  public:
37  UsiMonitor(bool extended, std::ostream& os, double silent=0.5);
38  ~UsiMonitor();
39  void setUdpLogging(std::string& udp_client_id,
40  boost::asio::ip::udp::socket *,
41  boost::asio::ip::udp::endpoint *);
42  void newDepth(int depth);
43  void showPV(int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last,
44  const bool *threatmate_first, const bool *threatmate_last);
45  void showFailLow(int depth, size_t node_count, double elapsed,
46  int value, Move cur);
47  void rootMove(Move cur);
48  void rootFirstMove(Move cur);
49  void timeInfo(size_t node_count, double elapsed);
50  void hashInfo(double ratio);
51  void rootForcedMove(Move the_move);
52  void rootLossByCheckmate();
53  void searchFinished();
54  private:
55  void showDeferred(bool forced=false);
56  };
57  }
58  using search::UsiMonitor;
59 }
60 
61 
62 #endif /* OSL_USIREPORTER_H */
63 // ;;; Local Variables:
64 // ;;; mode:c++
65 // ;;; c-basic-offset:2
66 // ;;; End: