PandaRoot
debug.h
Go to the documentation of this file.
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project *
3  * All rights reserved. *
4  * *
5  * Primary Authors: *
6  * Copyright 2009 Matthias Kretz <kretz@kde.org> *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
17 #ifndef DEBUG_H
18 #define DEBUG_H
19 
20 #include <iostream>
21 
22 static class PndFTSCANoDebugStream {
23  public:
24  inline PndFTSCANoDebugStream &operator<<(std::ostream &(*)(std::ostream &)) { return *this; }
25 
26  template <typename T>
27  inline PndFTSCANoDebugStream &operator<<(const T &)
28  {
29  return *this;
30  }
32 
33 #ifdef DEBUG_MESSAGES
34 template <typename T>
35 inline void prepareForDebugOutput(const typename T::Mask k, T *x0, T *x1 = 0, T *x2 = 0, T *x3 = 0, T *x4 = 0, T *x5 = 0, T *x6 = 0, T *x7 = 0, T *x8 = 0, T *x9 = 0)
36 {
37  if (x0)
38  (*x0)(k) = T(0);
39  if (x1)
40  (*x1)(k) = T(0);
41  if (x2)
42  (*x2)(k) = T(0);
43  if (x3)
44  (*x3)(k) = T(0);
45  if (x4)
46  (*x4)(k) = T(0);
47  if (x5)
48  (*x5)(k) = T(0);
49  if (x6)
50  (*x6)(k) = T(0);
51  if (x7)
52  (*x7)(k) = T(0);
53  if (x8)
54  (*x8)(k) = T(0);
55  if (x9)
56  (*x9)(k) = T(0);
57 }
58 #if DEBUG_MESSAGES & 1
59 inline std::ostream &debugS()
60 {
61  return std::cerr;
62 }
63 #else
65 {
67 }
68 #endif
69 #if DEBUG_MESSAGES & 2
70 inline std::ostream &debugF()
71 {
72  return std::cerr;
73 }
74 #else
76 {
78 }
79 #endif
80 #if DEBUG_MESSAGES & 4
81 inline std::ostream &debugKF()
82 {
83  return std::cerr;
84 }
85 #else
87 {
89 }
90 #endif
91 #if DEBUG_MESSAGES & 8
92 inline std::ostream &debugTS()
93 {
94  return std::cerr;
95 }
96 #else
98 {
100 }
101 #endif
102 #if DEBUG_MESSAGES & 16
103 inline std::ostream &debugWO()
104 {
105  return std::cerr;
106 }
107 #else
109 {
111 }
112 #endif
113 #else
114 template <typename T>
115 inline void prepareForDebugOutput(const typename T::Mask, T *, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0)
116 {
117 }
119 {
121 }
123 {
125 }
127 {
129 }
131 {
133 }
135 {
137 }
138 #endif
139 
140 #endif // DEBUG_H
PndFTSCANoDebugStream & operator<<(const T &)
Definition: debug.h:27
void prepareForDebugOutput(const typename T::Mask, T *, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0)
Definition: debug.h:115
PndFTSCANoDebugStream & operator<<(std::ostream &(*)(std::ostream &))
Definition: debug.h:24
PndFTSCANoDebugStream & debugF()
Definition: debug.h:122
PndFTSCANoDebugStream & debugS()
Definition: debug.h:118
PndFTSCANoDebugStream & debugTS()
Definition: debug.h:130
static class PndFTSCANoDebugStream PndFTSCANoDebugStreamInst
PndFTSCANoDebugStream & debugWO()
Definition: debug.h:134
PndFTSCANoDebugStream & debugKF()
Definition: debug.h:126