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