author | alpar |
Mon, 21 Feb 2005 09:28:00 +0000 | |
changeset 1160 | d9c32f713cad |
parent 680 | 17415189e42a |
permissions | -rw-r--r-- |
klao@493 | 1 |
// -*- C++ -*- // |
klao@493 | 2 |
|
alpar@921 | 3 |
#ifndef LEMON_DEBUG_H |
alpar@921 | 4 |
#define LEMON_DEBUG_H |
klao@493 | 5 |
|
klao@493 | 6 |
//! \file |
klao@493 | 7 |
//! \brief Basic definitions for debug control. |
klao@493 | 8 |
|
alpar@921 | 9 |
namespace lemon { |
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 |
} |
alpar@921 | 56 |
#endif // LEMON_DEBUG_H |