hegyi@821: // -*- C++ -*- // hegyi@821: hegyi@821: #ifndef HUGO_DEBUG_H hegyi@821: #define HUGO_DEBUG_H hegyi@821: hegyi@821: //! \file hegyi@821: //! \brief Basic definitions for debug control. hegyi@821: hegyi@821: namespace hugo { hegyi@821: hegyi@821: //! Debug mode for testing/debugging hegyi@821: hegyi@821: //! Use this debug mode if you want exhaustive range and consistency checks. hegyi@821: //! It also produces verbose debug messages. hegyi@821: struct DebugOn { hegyi@821: //! Example: check whether the edges added to a path are adjacent hegyi@821: static const bool consistensy_check = true; hegyi@821: hegyi@821: static const bool range_check = true; hegyi@821: hegyi@821: //! Examples: initialize maps with some value; hegyi@821: //! after deleting an item from UnionFindEnum set its value in the hegyi@821: //! corresponding map to NULL... hegyi@821: static const bool ensure_safe_state = true; hegyi@821: hegyi@821: static const int verbose = 5; hegyi@821: }; hegyi@821: hegyi@821: //! Debug mode for turning off debug aids. hegyi@821: hegyi@821: //! This debud mode switches off all range and consistency checks, hegyi@821: //! as well as the debug messages. hegyi@821: //! hegyi@821: struct DebugOff { hegyi@821: static const bool consistensy_check = false; hegyi@821: static const bool range_check = false; hegyi@821: static const bool ensure_safe_state = false; hegyi@821: static const int verbose = 0; hegyi@821: }; hegyi@821: hegyi@821: #ifdef DEBUG hegyi@821: //! The default debug mode. hegyi@821: hegyi@821: //! The default debug mode. hegyi@821: //! hegyi@821: typedef DebugOn DefaultDebugMode; hegyi@821: #else hegyi@821: //! The default debug mode. hegyi@821: hegyi@821: //! The default debug mode. hegyi@821: //! hegyi@821: typedef DebugOff DefaultDebugMode; hegyi@821: #endif hegyi@821: hegyi@821: } hegyi@821: #endif // HUGO_DEBUG_H