00001
00002
00003
00004
00005
00006
00007
00008
00013 #ifndef CCTBX_ERROR_H
00014 #define CCTBX_ERROR_H
00015
00016 #include <scitbx/error_utils.h>
00017
00018 #define CCTBX_CHECK_POINT \
00019 std::cout << __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush
00020 #define CCTBX_CHECK_POINT_MSG(msg) \
00021 std::cout << msg << " @ " __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush
00022 #define CCTBX_EXAMINE(A) \
00023 std::cout << "variable " << #A << ": " << A << std::endl << std::flush
00024
00026 namespace cctbx {
00027
00029 class error : public ::scitbx::error_base<error>
00030 {
00031 public:
00032
00034 explicit
00035 error(std::string const& msg) throw()
00036 : ::scitbx::error_base<error>("cctbx", msg)
00037 {}
00038
00040
00042 error(const char* file, long line, std::string const& msg = "",
00043 bool internal = true) throw()
00044 : ::scitbx::error_base<error>("cctbx", file, line, msg, internal)
00045 {}
00046 };
00047
00049
00051 class error_index : public error
00052 {
00053 public:
00055 explicit
00056 error_index(std::string const& msg = "Index out of range.") throw()
00057 : error(msg)
00058 {}
00059 };
00060
00061 }
00062
00064 #define CCTBX_ERROR(msg) \
00065 SCITBX_ERROR_UTILS_REPORT(cctbx::error, msg)
00067 #define CCTBX_INTERNAL_ERROR() \
00068 SCITBX_ERROR_UTILS_REPORT_INTERNAL(cctbx::error)
00070 #define CCTBX_NOT_IMPLEMENTED() \
00071 SCITBX_ERROR_UTILS_REPORT_NOT_IMPLEMENTED(cctbx::error)
00072
00074 #define CCTBX_ASSERT(assertion) \
00075 SCITBX_ERROR_UTILS_ASSERT(cctbx::error, CCTBX_ASSERT, assertion)
00076
00077 #endif // CCTBX_ERROR_H