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