src/work/klao/debug.h
author alpar
Mon, 19 Jul 2004 13:29:32 +0000
changeset 706 0fe42b8ec5a6
parent 619 e09818232531
child 921 818510fa3d99
permissions -rw-r--r--
Temporal change: public Edge constructor with given ID.
klao@493
     1
// -*- C++ -*- //
klao@493
     2
klao@493
     3
#ifndef HUGO_DEBUG_H
klao@493
     4
#define HUGO_DEBUG_H
klao@493
     5
klao@493
     6
//! \file
klao@493
     7
//! \brief Basic definitions for debug control.
klao@493
     8
klao@493
     9
namespace hugo {
klao@493
    10
alpar@680
    11
  //! Debug mode for testing/debugging
alpar@680
    12
alpar@680
    13
  //! Use this debug mode if you want exhaustive range and consistency checks.
alpar@680
    14
  //! It also produces verbose debug messages.
klao@493
    15
  struct DebugOn {
klao@493
    16
    //! Example: check whether the edges added to a path are adjacent
klao@493
    17
    static const bool consistensy_check = true;
klao@493
    18
klao@493
    19
    static const bool range_check = true;
klao@493
    20
klao@493
    21
    //! Examples: initialize maps with some value;
klao@493
    22
    //! after deleting an item from UnionFindEnum set its value in the
klao@493
    23
    //! corresponding map to NULL...
klao@493
    24
    static const bool ensure_safe_state = true;
klao@619
    25
klao@619
    26
    static const int verbose = 5;
klao@493
    27
  };
klao@493
    28
alpar@680
    29
  //! Debug mode for turning off debug aids.
alpar@680
    30
alpar@680
    31
  //! This debud mode switches off all range and consistency checks,
alpar@680
    32
  //! as well as the debug messages.
alpar@680
    33
  //!
klao@493
    34
  struct DebugOff {
klao@493
    35
    static const bool consistensy_check = false;
klao@493
    36
    static const bool range_check = false;
klao@493
    37
    static const bool ensure_safe_state = false;
klao@619
    38
    static const int verbose = 0;
klao@493
    39
  };
klao@493
    40
klao@493
    41
#ifdef DEBUG
alpar@680
    42
  //! The default debug mode.
alpar@680
    43
alpar@680
    44
  //! The default debug mode.
alpar@680
    45
  //!
klao@493
    46
  typedef DebugOn DefaultDebugMode;
klao@493
    47
#else
alpar@680
    48
  //! The default debug mode. 
alpar@680
    49
alpar@680
    50
  //! The default debug mode. 
alpar@680
    51
  //!
klao@493
    52
  typedef DebugOff DefaultDebugMode;
klao@493
    53
#endif
klao@493
    54
klao@493
    55
}
klao@493
    56
#endif // HUGO_DEBUG_H