Ardour  9.0-pre0-386-g96ef4d20f2
AudioGrapher::Debuggable< L > Class Template Reference

#include <debuggable.h>

Protected Member Functions

 Debuggable (std::ostream &debug_stream=std::cerr)
 
bool debug_level (DebugLevel level)
 
std::ostream & debug_stream ()
 

Private Attributes

std::ostream & stream
 

Detailed Description

template<DebugLevel L = DebugNone>
class AudioGrapher::Debuggable< L >

Class that allows optimizing out debugging code during compile time. Usage: to take all advantage of this class you should wrap all debugging statemets like this:

if (debug_level (SomeDebugLevel) && other_optional_conditionals) {
debug_stream() << "Debug output" << std::endl;
}
std::ostream & debug_stream()
Definition: debuggable.h:55
bool debug_level(DebugLevel level)
Definition: debuggable.h:47

The order of the conditionals in the if-clause is important. The checks specified in other_optional_conditionals are only optimized out if debug_level() is placed before it with a logical and (short-circuiting).

Definition at line 41 of file debuggable.h.

Constructor & Destructor Documentation

◆ Debuggable()

template<DebugLevel L = DebugNone>
AudioGrapher::Debuggable< L >::Debuggable ( std::ostream &  debug_stream = std::cerr)
inlineprotected

Definition at line 44 of file debuggable.h.

Member Function Documentation

◆ debug_level()

template<DebugLevel L = DebugNone>
bool AudioGrapher::Debuggable< L >::debug_level ( DebugLevel  level)
inlineprotected

Definition at line 47 of file debuggable.h.

◆ debug_stream()

template<DebugLevel L = DebugNone>
std::ostream& AudioGrapher::Debuggable< L >::debug_stream ( )
inlineprotected

Definition at line 55 of file debuggable.h.

Member Data Documentation

◆ stream

template<DebugLevel L = DebugNone>
std::ostream& AudioGrapher::Debuggable< L >::stream
private

Definition at line 58 of file debuggable.h.


The documentation for this class was generated from the following file: