Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / general / DebugLog.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * This class is used to log messages to a file that is specified when the object 
8  * is created.
9  * The file is closed when the object is destroyed. The user simply needs to 
10  * create a DebugLog
11  * object, and then call the logMsg function whenever they wish to write something to the
12  * file. 
13  */
14  
15 #ifndef DEBUGLOG_H
16 #define DEBUGLOG_H
17
18 #include <string>
19 #include <fstream>
20
21 namespace clustalw
22 {
23
24 using namespace std;
25
26 class DebugLog
27 {
28     public:
29         DebugLog(std::string);
30         ~DebugLog();
31         void logMsg(std::string);
32         void logScore(float x);
33         void printScoreInfo();
34     private:
35         /* Attributes */
36         std::string logFileName;
37         std::ofstream* logFile;
38         int numScores;
39         float sumSoFar;
40         float averageScore;
41         float minScore;
42         float maxScore;
43         /* Functions */
44         DebugLog();
45         
46 };
47
48 }
49 #endif