WTFIT
Debug.h
Go to the documentation of this file.
1 
14 #ifndef _DEBUG_H
15 #define _DEBUG_H
16 
17 #ifdef withOpenMP
18  #include <omp.h>
19 #endif
20 
21 #include <cerrno>
22 #include <fstream>
23 #include <iostream>
24 #include <sstream>
25 #include <string>
26 #include <vector>
27 
28 
29 using namespace std;
30 
31 namespace wtfit{
32 
33  extern bool welcomeMsg_;
34  extern bool goodbyeMsg_;
35  extern int globalDebugLevel_;
36 
37  class Wrapper;
38 
39  class Debug{
40 
41  public:
42 
43  // 1) constructors, destructors, operators, etc.
44  Debug();
45 
46  virtual ~Debug();
47 
49  fatalMsg, // 0
50  timeMsg, // 1
51  memoryMsg, // 2
52  infoMsg, // 3
54  advancedInfoMsg // 5
55  };
56 
57  // 2) functions
68  virtual const int dMsg(ostream &stream, string msg,
69  const int &debugLevel = infoMsg) const;
70 
75  const int err(const string msg, const int &debugLevel = infoMsg) const;
76 
81  const int msg(const char *msg, const int &debugLevel = infoMsg) const;
82 
86  virtual const int setDebugLevel(const int &debugLevel);
87 
88  int setThreadNumber(const int threadNumber){
89 
90  threadNumber_ = threadNumber;
91  return 0;
92  }
93 
102  int setWrapper(const Wrapper *wrapper);
103 
104 
105  protected:
106 
108  mutable int debugLevel_, threadNumber_;
110  };
111 }
112 
113 using namespace wtfit;
114 
115 #include <Os.h>
116 
118 class DebugTimer : public Timer{};
120 class DebugMemory : public Memory{};
121 
122 #endif
123 /// @}
Definition: Os.h:324
bool goodbyeMsg_
Definition: Debug.cpp:4
Definition: Debug.h:51
debugPriority
Definition: Debug.h:48
bool welcomeMsg_
Definition: Debug.cpp:3
Definition: Debug.h:52
int setThreadNumber(const int threadNumber)
Definition: Debug.h:88
Legacy backward compatibility.
Definition: Debug.h:120
Definition: Debug.h:49
Definition: Debug.h:50
Definition: Os.h:347
Wrapper class to wrap wtfit code.
Definition: Wrapper.h:15
Legacy backward compatibility.
Definition: Debug.h:118
Minimalist debugging class.
Definition: Debug.h:39
bool lastObject_
Definition: Debug.h:107
Definition: CommandLineParser.h:13
Wrapper * wrapper_
Definition: Debug.h:109
int globalDebugLevel_
Definition: Debug.cpp:5
Definition: Debug.h:53
int threadNumber_
Definition: Debug.h:108