00001 #ifndef IBRCOMMON_EXCEPTIONS_H_ 00002 #define IBRCOMMON_EXCEPTIONS_H_ 00003 00004 #include <stdexcept> 00005 #include <string> 00006 00007 00008 using namespace std; 00009 00016 namespace ibrcommon 00017 { 00021 class Exception : public exception 00022 { 00023 public: 00024 Exception() throw() 00025 {}; 00026 00027 Exception(const exception&) throw() 00028 {}; 00029 00030 virtual ~Exception() throw() 00031 {}; 00032 00037 virtual const char* what() const throw() 00038 { 00039 return m_what.c_str(); 00040 } 00041 00046 Exception(string what) throw() 00047 { 00048 m_what = what; 00049 }; 00050 00051 private: 00052 string m_what; 00053 }; 00054 00058 class NotImplementedException : public Exception 00059 { 00060 public: 00061 NotImplementedException(string what = "This method isn't implemented.") throw() : Exception(what) 00062 { 00063 }; 00064 }; 00065 00069 class IOException : public Exception 00070 { 00071 public: 00072 IOException(string what = "Input/Output error.") throw() : Exception(what) 00073 { 00074 }; 00075 }; 00076 } 00077 00078 #endif /*EXCEPTIONS_H_*/
1.6.3