A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PDBDebug.h
Go to the documentation of this file.
1 #ifndef PDB_DEBUG_H
2 #define PDB_DEBUG_H
3 
4 #include <ostream>
5 #include <iostream>
6 
7 /*
8  * A class used to disable std::cout and output nothing
9  * http://stackoverflow.com/questions/1389538/cancelling-stdcout-code-lines-using-preprocessor
10  */
11 
12 class NullStream {
13 public:
15  NullStream& operator<<(std::ostream& (*pf)(std::ostream&)) {
16  return *this;
17  }
18  template <typename T>
19  NullStream& operator<<(T const&) {
20  return *this;
21  }
22  template <typename R, typename P>
23  NullStream& operator<<(R& (*pf)(P&)) {
24  return *this;
25  }
26 };
27 
28 #ifdef PDB_DEBUG
29 #define PDB_COUT std::cout
30 #else
31 #define PDB_COUT NullStream()
32 #endif
33 
34 
35 #endif
NullStream()
Definition: PDBDebug.h:14
NullStream & operator<<(T const &)
Definition: PDBDebug.h:19
NullStream & operator<<(std::ostream &(*pf)(std::ostream &))
Definition: PDBDebug.h:15
NullStream & operator<<(R &(*pf)(P &))
Definition: PDBDebug.h:23