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