htmlPerformanceLog.cc
Go to the documentation of this file.
00001 /* htmlPerformanceLog.cc
00002  */
00003 #include "osl/misc/log/htmlPerformanceLog.h"
00004 #include "osl/record/csa.h"
00005 
00006 osl::misc::log::HtmlPerformanceLog::
00007 HtmlPerformanceLog(const char *filename, const char *title)
00008   : os(filename)
00009 {
00010   os << "<html><head><title>" << title << "</title></head>\n<body>\n";
00011   os << "<table border=1>\n";
00012   os << "<tr><td></td><td>search result</td><td>correct move</td>"
00013      << "<td>#nodes</td><td>seconds</td><td>depth</td></tr>\n";
00014 }
00015 
00016 osl::misc::log::HtmlPerformanceLog::~HtmlPerformanceLog()
00017 {
00018   os << "</table>\n";
00019   os << "</body>\n";
00020 }
00021 
00022 void osl::misc::log::HtmlPerformanceLog::
00023 record(const char *name, Move correctMove, Move result, 
00024        unsigned int nodes, unsigned int qnodes, double seconds, int depth)
00025 {
00026   if (correctMove == result)
00027     os << "<tr bgcolor=\"green\">";
00028   else
00029     os << "<tr>";
00030   os << "<td>" << name << "</td><td>";
00031   if (correctMove == result)
00032     os << "OK";
00033   else
00034   {
00035     csaShow(os, result);
00036   }
00037   os << "</td><td>";
00038   csaShow(os, correctMove);
00039   os << "</td>\n\t<td id=\"nodes\" align=right>" << nodes + qnodes << "</td>\n"
00040      << "\t<td id=\"seconds\" align=right>" << seconds << "</td>\n"
00041      << "\t<td id=\"depth\" align=right>" << depth << "</td></tr>\n"
00042      << std::flush;
00043 }
00044 
00045 /* ------------------------------------------------------------------------- */
00046 // ;;; Local Variables:
00047 // ;;; mode:c++
00048 // ;;; c-basic-offset:2
00049 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines