lemon/attic/debug.h
author hegyi
Thu, 05 Jan 2006 12:30:09 +0000
changeset 1878 409a31271efd
parent 1435 8e85e6bbefdf
child 1956 a055123339d5
permissions -rw-r--r--
Several changes. \n If new map is added to mapstorage it emits signal with the name of the new map. This was important, because from now on not only tha mapwin should be updated. \n Furthermore algobox gets a pointer to mapstorage instead of only the mapnames from it. This is important because without it it would be complicated to pass all of the required maps to algobox.
alpar@906
     1
/* -*- C++ -*-
ladanyi@1435
     2
 * lemon/debug.h - Part of LEMON, a generic C++ optimization library
alpar@906
     3
 *
alpar@1875
     4
 * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@1359
     5
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@906
     6
 *
alpar@906
     7
 * Permission to use, modify and distribute this software is granted
alpar@906
     8
 * provided that this copyright notice appears in all copies. For
alpar@906
     9
 * precise terms see the accompanying LICENSE file.
alpar@906
    10
 *
alpar@906
    11
 * This software is provided "AS IS" with no warranty of any kind,
alpar@906
    12
 * express or implied, and with no claim as to its suitability for any
alpar@906
    13
 * purpose.
alpar@906
    14
 *
alpar@906
    15
 */
alpar@883
    16
alpar@921
    17
#ifndef LEMON_DEBUG_H
alpar@921
    18
#define LEMON_DEBUG_H
alpar@883
    19
alpar@883
    20
//! \file
alpar@883
    21
//! \brief Basic definitions for debug control.
alpar@883
    22
alpar@921
    23
namespace lemon {
alpar@883
    24
alpar@883
    25
  //! Debug mode for testing/debugging
alpar@883
    26
alpar@883
    27
  //! Use this debug mode if you want exhaustive range and consistency checks.
alpar@883
    28
  //! It also produces verbose debug messages.
alpar@883
    29
  struct DebugOn {
alpar@883
    30
    //! Example: check whether the edges added to a path are adjacent
alpar@883
    31
    static const bool consistensy_check = true;
alpar@883
    32
alpar@883
    33
    static const bool range_check = true;
alpar@883
    34
alpar@883
    35
    //! Examples: initialize maps with some value;
alpar@883
    36
    //! after deleting an item from UnionFindEnum set its value in the
alpar@883
    37
    //! corresponding map to NULL...
alpar@883
    38
    static const bool ensure_safe_state = true;
alpar@883
    39
alpar@883
    40
    static const int verbose = 5;
alpar@883
    41
  };
alpar@883
    42
alpar@883
    43
  //! Debug mode for turning off debug aids.
alpar@883
    44
alpar@883
    45
  //! This debud mode switches off all range and consistency checks,
alpar@883
    46
  //! as well as the debug messages.
alpar@883
    47
  //!
alpar@883
    48
  struct DebugOff {
alpar@883
    49
    static const bool consistensy_check = false;
alpar@883
    50
    static const bool range_check = false;
alpar@883
    51
    static const bool ensure_safe_state = false;
alpar@883
    52
    static const int verbose = 0;
alpar@883
    53
  };
alpar@883
    54
alpar@883
    55
#ifdef DEBUG
alpar@883
    56
  //! The default debug mode.
alpar@883
    57
alpar@883
    58
  //! The default debug mode.
alpar@883
    59
  //!
alpar@883
    60
  typedef DebugOn DefaultDebugMode;
alpar@883
    61
#else
alpar@883
    62
  //! The default debug mode. 
alpar@883
    63
alpar@883
    64
  //! The default debug mode. 
alpar@883
    65
  //!
alpar@883
    66
  typedef DebugOff DefaultDebugMode;
alpar@883
    67
#endif
alpar@883
    68
alpar@883
    69
}
alpar@921
    70
#endif // LEMON_DEBUG_H