00001
00008 #ifndef _DIVINE_REPORTER_HH_
00009 #define _DIVINE_REPORTER_HH_
00010
00011 #ifndef DOXYGEN_PROCESSING
00012 #include <iostream>
00013 #include <map>
00014 #include <string>
00015 #include "common/sysinfo.hh"
00016 #include "common/error.hh"
00017 #include "common/types.hh"
00018
00019
00020 namespace divine {
00021 #endif //DOXYGEN_PROCESSING
00022
00024
00031 class reporter_t {
00032 protected:
00033 vminfo_t vm_info;
00034 timeinfo_t time_info;
00035 std::map<std::string, double> specific_info;
00036 std::map<std::string, std::string> specific_long_name;
00037 double time;
00038 double init_time;
00039 std::string file_name, alg_name, problem;
00040 size_int_t states_stored, succs_calls;
00041
00042 public:
00043
00044
00045
00046
00047 reporter_t() {time = -1; file_name = "Unknown"; alg_name = "Unknown"; problem = "Unknown"; states_stored = 0; succs_calls = 0; init_time=0;}
00048
00051 void print(std::ostream& out);
00052
00055 void print();
00056
00060 void start_timer() { time_info.reset(); }
00061
00064 void stop_timer() { time = time_info.gettime() + init_time; }
00065
00068 void set_file_name(std::string s) { file_name = s ;}
00069
00072 void set_alg_name(std::string s) { alg_name = s ;}
00073
00076 void set_problem(std::string s) { problem = s; }
00077
00080 void set_states_stored(size_int_t stored) { states_stored = stored; }
00081
00084 void set_succs_calls(size_int_t calls) { succs_calls = calls; }
00085
00088 void set_obligatory_keys(std::string _alg_name, std::string _file_name, std::string _problem, size_int_t _states_stored, size_int_t _succs_calls)
00089 { alg_name = _alg_name; file_name = _file_name; problem = _problem; states_stored = _states_stored; succs_calls = _succs_calls; }
00090
00093 void set_info(std::string s, double a) { specific_info[s] = a; if (s=="InitTime") init_time=a; }
00094
00095 void set_info(std::string s, double a, const std::string & long_name)
00096 { set_info(s,a); specific_long_name[s]=long_name; }
00097
00100 double get_time() { return time; }
00101
00102 };
00103
00104 #ifndef DOXYGEN_PROCESSING
00105 }
00106 #endif //DOXYGEN_PROCESSING
00107
00108 #endif