00001 00024 #ifndef ERROR_H_INCLUDED_C416C52E 00025 #define ERROR_H_INCLUDED_C416C52E 00026 00027 #include <iostream> 00028 #include <string> 00029 #include <stdexcept> 00030 #include "openalpp/export.h" 00031 namespace openalpp { 00032 00039 class Error : public std::runtime_error { 00040 public: 00045 Error() : runtime_error("No error description") {} 00046 00051 Error(const char *description) : runtime_error(description) {} 00052 00056 Error(const Error &error) : runtime_error(error.what()) {} 00057 00063 std::ostream &put(std::ostream &stream) const; 00064 00065 protected: 00069 }; 00070 00075 class FatalError : public Error { 00076 public: 00081 FatalError(const char *description) : Error(description) {} 00082 }; 00083 00088 class FileError : public Error { 00089 public: 00094 FileError(const char *description) : Error(description) {} 00095 }; 00096 00101 class MemoryError : public Error { 00102 public: 00107 MemoryError(const char *description) : Error(description) {} 00108 }; 00109 00114 class NameError : public Error { 00115 public: 00120 NameError(const char *description) : Error(description) {} 00121 }; 00122 00127 class ValueError : public Error { 00128 public: 00133 ValueError(const char *description) : Error(description) {} 00134 }; 00135 00140 class InitError : public Error { 00141 public: 00146 InitError(const char *description) : Error(description) {} 00147 }; 00148 00156 OPENALPP_API std::ostream &operator<<(std::ostream &stream,const Error &error); 00157 00158 } 00159 00160 #endif /* ERROR_H_INCLUDED_C416C52E */