00001 00018 #ifndef OP_EXCEPTION_H 00019 #define OP_EXCEPTION_H 00020 00021 #include <stdexcept> 00022 #include <string> 00023 00024 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 00044 struct op_fatal_error : op_exception 00045 { 00046 explicit op_fatal_error(std::string const & msg); 00047 }; 00048 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 /* !OP_EXCEPTION_H */