PandaRoot
debug.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /**************************************************************************
14  * This file is property of and copyright by the ALICE HLT Project *
15  * All rights reserved. *
16  * *
17  * Primary Authors: *
18  * Copyright 2009 Matthias Kretz <kretz@kde.org> *
19  * *
20  * Permission to use, copy, modify and distribute this software and its *
21  * documentation strictly for non-commercial purposes is hereby granted *
22  * without fee, provided that the above copyright notice appears in all *
23  * copies and that both the copyright notice and this permission notice *
24  * appear in the supporting documentation. The authors make no claims *
25  * about the suitability of this software for any purpose. It is *
26  * provided "as is" without express or implied warranty. *
27  **************************************************************************/
28 
29 #ifndef DEBUG_H
30 #define DEBUG_H
31 
32 #include <iostream>
33 
34 static class PndFTSCANoDebugStream {
35  public:
36  inline PndFTSCANoDebugStream &operator<<(std::ostream &(*)(std::ostream &)) { return *this; }
37 
38  template <typename T>
39  inline PndFTSCANoDebugStream &operator<<(const T &)
40  {
41  return *this;
42  }
44 
45 #ifdef DEBUG_MESSAGES
46 template <typename T>
47 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)
48 {
49  if (x0)
50  (*x0)(k) = T(0);
51  if (x1)
52  (*x1)(k) = T(0);
53  if (x2)
54  (*x2)(k) = T(0);
55  if (x3)
56  (*x3)(k) = T(0);
57  if (x4)
58  (*x4)(k) = T(0);
59  if (x5)
60  (*x5)(k) = T(0);
61  if (x6)
62  (*x6)(k) = T(0);
63  if (x7)
64  (*x7)(k) = T(0);
65  if (x8)
66  (*x8)(k) = T(0);
67  if (x9)
68  (*x9)(k) = T(0);
69 }
70 #if DEBUG_MESSAGES & 1
71 inline std::ostream &debugS()
72 {
73  return std::cerr;
74 }
75 #else
77 {
79 }
80 #endif
81 #if DEBUG_MESSAGES & 2
82 inline std::ostream &debugF()
83 {
84  return std::cerr;
85 }
86 #else
88 {
90 }
91 #endif
92 #if DEBUG_MESSAGES & 4
93 inline std::ostream &debugKF()
94 {
95  return std::cerr;
96 }
97 #else
99 {
101 }
102 #endif
103 #if DEBUG_MESSAGES & 8
104 inline std::ostream &debugTS()
105 {
106  return std::cerr;
107 }
108 #else
110 {
112 }
113 #endif
114 #if DEBUG_MESSAGES & 16
115 inline std::ostream &debugWO()
116 {
117  return std::cerr;
118 }
119 #else
121 {
123 }
124 #endif
125 #else
126 template <typename T>
127 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)
128 {
129 }
131 {
133 }
135 {
137 }
139 {
141 }
143 {
145 }
147 {
149 }
150 #endif
151 
152 #endif // DEBUG_H
PndFTSCANoDebugStream & operator<<(const T &)
Definition: debug.h:39
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:127
PndFTSCANoDebugStream & operator<<(std::ostream &(*)(std::ostream &))
Definition: debug.h:36
PndFTSCANoDebugStream & debugF()
Definition: debug.h:134
PndFTSCANoDebugStream & debugS()
Definition: debug.h:130
PndFTSCANoDebugStream & debugTS()
Definition: debug.h:142
static class PndFTSCANoDebugStream PndFTSCANoDebugStreamInst
PndFTSCANoDebugStream & debugWO()
Definition: debug.h:146
PndFTSCANoDebugStream & debugKF()
Definition: debug.h:138