00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef OP_EXCEPTION_H
00019 #define OP_EXCEPTION_H
00020
00021 #include <stdexcept>
00022 #include <string>
00023
00024
00025
00026
00027
00028 class op_exception : public std::exception {
00029 public:
00030 explicit op_exception(std::string const& msg);
00031 ~op_exception() throw() = 0;
00032
00033 char const * what() const throw();
00034 private:
00035 std::string message;
00036 };
00037
00038
00039
00040
00041
00042
00043
00044 struct op_fatal_error : op_exception
00045 {
00046 explicit op_fatal_error(std::string const & msg);
00047 };
00048
00049
00050
00051
00052 struct op_runtime_error : std::runtime_error
00053 {
00054 explicit op_runtime_error(std::string const & err);
00055 op_runtime_error(std::string const & err, int cerrno);
00056 ~op_runtime_error() throw();
00057 };
00058
00059
00060 #endif