Ardour  9.0-pre0-582-g084a23a80d
debuggable.h
Go to the documentation of this file.
1 #ifndef AUDIOGRAPHER_DEBUGGABLE_H
2 #define AUDIOGRAPHER_DEBUGGABLE_H
3 
4 #ifndef DEFAULT_DEBUG_LEVEL
5 #define DEFAULT_DEBUG_LEVEL DebugNone
6 #endif
7 
8 #include <iostream>
9 
11 
12 namespace AudioGrapher
13 {
14 
17 {
24 };
25 
40 template<DebugLevel L = DEFAULT_DEBUG_LEVEL>
41 class /*LIBAUDIOGRAPHER_API*/ Debuggable
42 {
43  protected:
44  Debuggable(std::ostream & debug_stream = std::cerr)
45  : stream (debug_stream) {}
46 
48 #ifndef NDEBUG
49  (void) level; /* stop pedantic gcc complaints about unused parameter */
50  return false;
51 #else
52  return L >= level;
53 #endif
54  }
55  std::ostream & debug_stream() { return stream; }
56 
57  private:
58  std::ostream & stream;
59 };
60 
61 
62 } // namespace
63 
64 #endif // AUDIOGRAPHER_DEBUGGABLE_H
Debuggable(std::ostream &debug_stream=std::cerr)
Definition: debuggable.h:44
std::ostream & debug_stream()
Definition: debuggable.h:55
bool debug_level(DebugLevel level)
Definition: debuggable.h:47
std::ostream & stream
Definition: debuggable.h:58
DebugLevel
Compile time defined debug level.
Definition: debuggable.h:17
@ DebugVerbose
Lots of output, not on sample level.
Definition: debuggable.h:22
@ DebugNone
Disabled.
Definition: debuggable.h:18
@ DebugProcess
Process cycle level stuff.
Definition: debuggable.h:21
@ DebugSample
Sample level stuff.
Definition: debuggable.h:23
@ DebugObject
Object level stuff, ctors, initalizers etc.
Definition: debuggable.h:19
@ DebugFlags
Debug ProcessContext flags only on process cycle level.
Definition: debuggable.h:20
link region and track false waveform clip level