00001
00002
00003
00004
00005
00006
00007
00008
00013 #ifndef SCITBX_ERROR_H
00014 #define SCITBX_ERROR_H
00015
00016 #include <scitbx/error_utils.h>
00017
00018 #define SCITBX_CHECK_POINT \
00019 std::cout << __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush
00020 #define SCITBX_CHECK_POINT_MSG(msg) \
00021 std::cout << msg << " @ " __FILE__ << "(" << __LINE__ << ")" \
00022 << std::endl << std::flush
00023 #define SCITBX_EXAMINE(A) \
00024 std::cout << "variable " << #A << ": " << A << std::endl << std::flush
00025
00027 namespace scitbx {
00028
00030 class error : public ::scitbx::error_base<error>
00031 {
00032 public:
00033
00035 explicit
00036 error(std::string const& msg) throw()
00037 : ::scitbx::error_base<error>("scitbx", msg)
00038 {}
00039
00041
00043 error(const char* file, long line, std::string const& msg = "",
00044 bool internal = true) throw()
00045 : ::scitbx::error_base<error>("scitbx", file, line, msg, internal)
00046 {}
00047 };
00048
00050
00052 class error_index : public error
00053 {
00054 public:
00056 explicit
00057 error_index(std::string const& msg = "Index out of range.") throw()
00058 : error(msg)
00059 {}
00060 };
00061
00062 }
00063
00065 #define SCITBX_ERROR(msg) \
00066 SCITBX_ERROR_UTILS_REPORT(scitbx::error, msg)
00068 #define SCITBX_INTERNAL_ERROR() \
00069 SCITBX_ERROR_UTILS_REPORT_INTERNAL(scitbx::error)
00071 #define SCITBX_NOT_IMPLEMENTED() \
00072 SCITBX_ERROR_UTILS_REPORT_NOT_IMPLEMENTED(scitbx::error)
00073
00075 #define SCITBX_ASSERT(assertion) \
00076 SCITBX_ERROR_UTILS_ASSERT(scitbx::error, SCITBX_ASSERT, assertion)
00077
00078 #endif // SCITBX_ERROR_H