source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_generate_file.cpp @ 43

Last change on this file since 43 was 43, checked in by rosiere, 17 years ago

Modif mineur : ajout d'info de débug

Release non stable

File size: 1.5 KB
Line 
1#ifdef STATISTICS
2
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/include/Statistics.h"
11#include <time.h>
12#include <sstream>
13#include <fstream>
14using namespace std;
15
16namespace morpheo              {
17namespace behavioural          {
18
19#undef  FUNCTION
20#define FUNCTION "Statistics::generate_file"
21  void Statistics::generate_file(string stat)
22  {
23    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
24
25    ostringstream filename;
26    filename << _name << ".stat";
27
28    cout << "Generate file \""<< filename.str() << "\"" << endl;
29
30    ofstream file;
31    file.open(filename.str().c_str(),ios::out | ios::trunc);
32
33    time_t current_time;
34    time (&current_time);
35
36    // print header
37    file << "<!-- "                                                    << endl
38         << "\tfile        : " << filename.str()                       << endl
39         << "\tdate        : " << ctime (&current_time )
40         << "\tcomment     : it's a autogenerated file : don't modify" << endl
41         << "-->"                                                      << endl
42         <<                                                               endl;
43         
44    file << stat;
45   
46    file.close();
47
48    log_printf(FUNC,Behavioural,FUNCTION,"End");
49  }
50
51#undef  FUNCTION
52#define FUNCTION "Statistics::generate_file"
53  void Statistics::generate_file(void)
54  {
55    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
56
57    generate_file(print(0));
58
59    log_printf(FUNC,Behavioural,FUNCTION,"End");
60  };
61
62}; // end namespace behavioural         
63}; // end namespace morpheo             
64
65#endif
Note: See TracBrowser for help on using the repository browser.