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