lemon/attic/debug.h
author ladanyi
Wed, 21 Jun 2006 08:35:23 +0000
changeset 2103 a979fcdda073
parent 1875 98698b69a902
child 2391 14a343be7a5a
permissions -rw-r--r--
Exclude the gui from the build.
     1 /* -*- C++ -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library
     4  *
     5  * Copyright (C) 2003-2006
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #ifndef LEMON_DEBUG_H
    20 #define LEMON_DEBUG_H
    21 
    22 //! \file
    23 //! \brief Basic definitions for debug control.
    24 
    25 namespace lemon {
    26 
    27   //! Debug mode for testing/debugging
    28 
    29   //! Use this debug mode if you want exhaustive range and consistency checks.
    30   //! It also produces verbose debug messages.
    31   struct DebugOn {
    32     //! Example: check whether the edges added to a path are adjacent
    33     static const bool consistensy_check = true;
    34 
    35     static const bool range_check = true;
    36 
    37     //! Examples: initialize maps with some value;
    38     //! after deleting an item from UnionFindEnum set its value in the
    39     //! corresponding map to NULL...
    40     static const bool ensure_safe_state = true;
    41 
    42     static const int verbose = 5;
    43   };
    44 
    45   //! Debug mode for turning off debug aids.
    46 
    47   //! This debud mode switches off all range and consistency checks,
    48   //! as well as the debug messages.
    49   //!
    50   struct DebugOff {
    51     static const bool consistensy_check = false;
    52     static const bool range_check = false;
    53     static const bool ensure_safe_state = false;
    54     static const int verbose = 0;
    55   };
    56 
    57 #ifdef DEBUG
    58   //! The default debug mode.
    59 
    60   //! The default debug mode.
    61   //!
    62   typedef DebugOn DefaultDebugMode;
    63 #else
    64   //! The default debug mode. 
    65 
    66   //! The default debug mode. 
    67   //!
    68   typedef DebugOff DefaultDebugMode;
    69 #endif
    70 
    71 }
    72 #endif // LEMON_DEBUG_H