Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
KM3NeT_Debug.h
Go to the documentation of this file.
1#ifndef KM3NET_DEBUG_H_
2#define KM3NET_DEBUG_H_
3
4#include <stdlib.h>
5#include <iostream>
6#include <mutex>
7#include <fstream>
8
9
10#define DBG_MSG (*KM3NeT_Debug::get())
11
12
13/**
14 * \author fsimeone
15 */
16
18{
19public:
20
21 static KM3NeT_Debug* get()
22 {
23 if (singleton_ == NULL) singleton_ = new KM3NeT_Debug();
24 return singleton_;
25 }
26
27 static void kill()
28 {
29 if (singleton_ != NULL)
30 {
31 delete singleton_;
32 singleton_ = NULL;
33 }
34 }
35
36 template <class T>
38 {
39 std::lock_guard<std::mutex> lock(mtx_);
40 std::cerr<<s;
41 return *this;
42 }
43
44private:
45
47 virtual ~KM3NeT_Debug();
48
50 std::mutex mtx_;
51};
52
53#endif /* KM3NET_DEBUG_H_ */
54
static KM3NeT_Debug * singleton_
virtual ~KM3NeT_Debug()
std::mutex mtx_
static void kill()
static KM3NeT_Debug * get()
KM3NeT_Debug & operator<<(const T &s)