Put away debug.h and error.h temporarily.
authoralpar
Sun, 19 Sep 2004 12:45:35 +0000
changeset 8834af619b64d98
parent 882 46974f296c4a
child 884 b06bfaaca48c
Put away debug.h and error.h temporarily.
src/hugo/Makefile.am
src/hugo/attic/debug.h
src/hugo/attic/error.h
src/hugo/debug.h
src/hugo/error.h
src/test/Makefile.am
     1.1 --- a/src/hugo/Makefile.am	Sun Sep 19 12:26:42 2004 +0000
     1.2 +++ b/src/hugo/Makefile.am	Sun Sep 19 12:45:35 2004 +0000
     1.3 @@ -6,7 +6,6 @@
     1.4  	default_map.h							\
     1.5  	dijkstra.h							\
     1.6  	dimacs.h							\
     1.7 -	error.h								\
     1.8  	extended_pair.h                                                 \
     1.9  	fib_heap.h							\
    1.10  	full_graph.h							\
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/hugo/attic/debug.h	Sun Sep 19 12:45:35 2004 +0000
     2.3 @@ -0,0 +1,56 @@
     2.4 +// -*- C++ -*- //
     2.5 +
     2.6 +#ifndef HUGO_DEBUG_H
     2.7 +#define HUGO_DEBUG_H
     2.8 +
     2.9 +//! \file
    2.10 +//! \brief Basic definitions for debug control.
    2.11 +
    2.12 +namespace hugo {
    2.13 +
    2.14 +  //! Debug mode for testing/debugging
    2.15 +
    2.16 +  //! Use this debug mode if you want exhaustive range and consistency checks.
    2.17 +  //! It also produces verbose debug messages.
    2.18 +  struct DebugOn {
    2.19 +    //! Example: check whether the edges added to a path are adjacent
    2.20 +    static const bool consistensy_check = true;
    2.21 +
    2.22 +    static const bool range_check = true;
    2.23 +
    2.24 +    //! Examples: initialize maps with some value;
    2.25 +    //! after deleting an item from UnionFindEnum set its value in the
    2.26 +    //! corresponding map to NULL...
    2.27 +    static const bool ensure_safe_state = true;
    2.28 +
    2.29 +    static const int verbose = 5;
    2.30 +  };
    2.31 +
    2.32 +  //! Debug mode for turning off debug aids.
    2.33 +
    2.34 +  //! This debud mode switches off all range and consistency checks,
    2.35 +  //! as well as the debug messages.
    2.36 +  //!
    2.37 +  struct DebugOff {
    2.38 +    static const bool consistensy_check = false;
    2.39 +    static const bool range_check = false;
    2.40 +    static const bool ensure_safe_state = false;
    2.41 +    static const int verbose = 0;
    2.42 +  };
    2.43 +
    2.44 +#ifdef DEBUG
    2.45 +  //! The default debug mode.
    2.46 +
    2.47 +  //! The default debug mode.
    2.48 +  //!
    2.49 +  typedef DebugOn DefaultDebugMode;
    2.50 +#else
    2.51 +  //! The default debug mode. 
    2.52 +
    2.53 +  //! The default debug mode. 
    2.54 +  //!
    2.55 +  typedef DebugOff DefaultDebugMode;
    2.56 +#endif
    2.57 +
    2.58 +}
    2.59 +#endif // HUGO_DEBUG_H
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/hugo/attic/error.h	Sun Sep 19 12:45:35 2004 +0000
     3.3 @@ -0,0 +1,68 @@
     3.4 +// -*- C++ -*- //
     3.5 +
     3.6 +#ifndef HUGO_ERROR_H
     3.7 +#define HUGO_ERROR_H
     3.8 +
     3.9 +//! \ingroup misc
    3.10 +//! \file
    3.11 +//! \brief Basic error handling (signaling) routines.
    3.12 +
    3.13 +#include <exception>
    3.14 +#include <string>
    3.15 +#include <sstream>
    3.16 +
    3.17 +
    3.18 +namespace hugo {
    3.19 +
    3.20 +  /**
    3.21 +   * \brief Generic exception class.
    3.22 +   *
    3.23 +   * \todo Do we need this?
    3.24 +   *
    3.25 +   * \todo Don't we need different kind of exceptions for different kind
    3.26 +   * of errors?
    3.27 +   * Shouldn't we use \<stdexcept\> instead?
    3.28 +   */
    3.29 +  class Exception : public std::exception {
    3.30 +  protected:
    3.31 +    std::ostringstream buf;
    3.32 +  public:
    3.33 +    Exception() {}
    3.34 +    explicit Exception(const std::string &s) { buf << s; }
    3.35 +    Exception(const Exception &e) : std::exception() {
    3.36 +      buf << e.buf.str();
    3.37 +    }
    3.38 +    virtual ~Exception() throw() {}
    3.39 +    
    3.40 +    virtual const char* what() const throw() {
    3.41 +      return buf.str().c_str();
    3.42 +    }
    3.43 +
    3.44 +    Exception& operator<<(std::string const& s) { buf << s; return *this; }
    3.45 +    Exception& operator<<(char const *s) { buf << s; return *this; }
    3.46 +    Exception& operator<<(int i) { buf << i; return *this; }
    3.47 +  };
    3.48 +
    3.49 +  /**
    3.50 +   * \brief Generic error signaling function.
    3.51 +   *
    3.52 +   * \todo Do we really need this? Is it helpful?
    3.53 +   */
    3.54 +  inline void fault(const std::string &msg) {
    3.55 +    throw Exception(msg);
    3.56 +  }
    3.57 +
    3.58 +  /**
    3.59 +   * \brief Macro for mark not yet implemented features.
    3.60 +   *
    3.61 +   * \todo Is this the right place for this? It should be used only in
    3.62 +   * modules under development.
    3.63 +   */
    3.64 +
    3.65 +# define FIXME(msg) \
    3.66 +    do { throw ::hugo::Exception() << "FIXME: " msg " (in: "    \
    3.67 +      __FILE__ ", " << __LINE__ << ")";                         \
    3.68 +    } while(false)
    3.69 +
    3.70 +}
    3.71 +#endif // HUGO_ERROR_H
     4.1 --- a/src/hugo/debug.h	Sun Sep 19 12:26:42 2004 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,56 +0,0 @@
     4.4 -// -*- C++ -*- //
     4.5 -
     4.6 -#ifndef HUGO_DEBUG_H
     4.7 -#define HUGO_DEBUG_H
     4.8 -
     4.9 -//! \file
    4.10 -//! \brief Basic definitions for debug control.
    4.11 -
    4.12 -namespace hugo {
    4.13 -
    4.14 -  //! Debug mode for testing/debugging
    4.15 -
    4.16 -  //! Use this debug mode if you want exhaustive range and consistency checks.
    4.17 -  //! It also produces verbose debug messages.
    4.18 -  struct DebugOn {
    4.19 -    //! Example: check whether the edges added to a path are adjacent
    4.20 -    static const bool consistensy_check = true;
    4.21 -
    4.22 -    static const bool range_check = true;
    4.23 -
    4.24 -    //! Examples: initialize maps with some value;
    4.25 -    //! after deleting an item from UnionFindEnum set its value in the
    4.26 -    //! corresponding map to NULL...
    4.27 -    static const bool ensure_safe_state = true;
    4.28 -
    4.29 -    static const int verbose = 5;
    4.30 -  };
    4.31 -
    4.32 -  //! Debug mode for turning off debug aids.
    4.33 -
    4.34 -  //! This debud mode switches off all range and consistency checks,
    4.35 -  //! as well as the debug messages.
    4.36 -  //!
    4.37 -  struct DebugOff {
    4.38 -    static const bool consistensy_check = false;
    4.39 -    static const bool range_check = false;
    4.40 -    static const bool ensure_safe_state = false;
    4.41 -    static const int verbose = 0;
    4.42 -  };
    4.43 -
    4.44 -#ifdef DEBUG
    4.45 -  //! The default debug mode.
    4.46 -
    4.47 -  //! The default debug mode.
    4.48 -  //!
    4.49 -  typedef DebugOn DefaultDebugMode;
    4.50 -#else
    4.51 -  //! The default debug mode. 
    4.52 -
    4.53 -  //! The default debug mode. 
    4.54 -  //!
    4.55 -  typedef DebugOff DefaultDebugMode;
    4.56 -#endif
    4.57 -
    4.58 -}
    4.59 -#endif // HUGO_DEBUG_H
     5.1 --- a/src/hugo/error.h	Sun Sep 19 12:26:42 2004 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,68 +0,0 @@
     5.4 -// -*- C++ -*- //
     5.5 -
     5.6 -#ifndef HUGO_ERROR_H
     5.7 -#define HUGO_ERROR_H
     5.8 -
     5.9 -//! \ingroup misc
    5.10 -//! \file
    5.11 -//! \brief Basic error handling (signaling) routines.
    5.12 -
    5.13 -#include <exception>
    5.14 -#include <string>
    5.15 -#include <sstream>
    5.16 -
    5.17 -
    5.18 -namespace hugo {
    5.19 -
    5.20 -  /**
    5.21 -   * \brief Generic exception class.
    5.22 -   *
    5.23 -   * \todo Do we need this?
    5.24 -   *
    5.25 -   * \todo Don't we need different kind of exceptions for different kind
    5.26 -   * of errors?
    5.27 -   * Shouldn't we use \<stdexcept\> instead?
    5.28 -   */
    5.29 -  class Exception : public std::exception {
    5.30 -  protected:
    5.31 -    std::ostringstream buf;
    5.32 -  public:
    5.33 -    Exception() {}
    5.34 -    explicit Exception(const std::string &s) { buf << s; }
    5.35 -    Exception(const Exception &e) : std::exception() {
    5.36 -      buf << e.buf.str();
    5.37 -    }
    5.38 -    virtual ~Exception() throw() {}
    5.39 -    
    5.40 -    virtual const char* what() const throw() {
    5.41 -      return buf.str().c_str();
    5.42 -    }
    5.43 -
    5.44 -    Exception& operator<<(std::string const& s) { buf << s; return *this; }
    5.45 -    Exception& operator<<(char const *s) { buf << s; return *this; }
    5.46 -    Exception& operator<<(int i) { buf << i; return *this; }
    5.47 -  };
    5.48 -
    5.49 -  /**
    5.50 -   * \brief Generic error signaling function.
    5.51 -   *
    5.52 -   * \todo Do we really need this? Is it helpful?
    5.53 -   */
    5.54 -  inline void fault(const std::string &msg) {
    5.55 -    throw Exception(msg);
    5.56 -  }
    5.57 -
    5.58 -  /**
    5.59 -   * \brief Macro for mark not yet implemented features.
    5.60 -   *
    5.61 -   * \todo Is this the right place for this? It should be used only in
    5.62 -   * modules under development.
    5.63 -   */
    5.64 -
    5.65 -# define FIXME(msg) \
    5.66 -    do { throw ::hugo::Exception() << "FIXME: " msg " (in: "    \
    5.67 -      __FILE__ ", " << __LINE__ << ")";                         \
    5.68 -    } while(false)
    5.69 -
    5.70 -}
    5.71 -#endif // HUGO_ERROR_H
     6.1 --- a/src/test/Makefile.am	Sun Sep 19 12:26:42 2004 +0000
     6.2 +++ b/src/test/Makefile.am	Sun Sep 19 12:45:35 2004 +0000
     6.3 @@ -8,7 +8,6 @@
     6.4  	bfs_test \
     6.5  	dfs_test \
     6.6  	dijkstra_test \
     6.7 -	error_test \
     6.8  	graph_test \
     6.9  	graph_wrapper_test \
    6.10  	kruskal_test \
    6.11 @@ -28,7 +27,6 @@
    6.12  bfs_test_SOURCES = bfs_test.cc
    6.13  dfs_test_SOURCES = dfs_test.cc
    6.14  dijkstra_test_SOURCES = dijkstra_test.cc
    6.15 -error_test_SOURCES = error_test.cc
    6.16  graph_test_SOURCES = graph_test.cc
    6.17  graph_wrapper_test_SOURCES = graph_wrapper_test.cc
    6.18  kruskal_test_SOURCES = kruskal_test.cc