00001 00014 #ifndef __EXCEPTION_H__ 00015 #define __EXCEPTION_H__ 00016 00017 #include <string> 00018 00022 class Exception { 00023 public: 00025 Exception() {} 00026 00028 Exception(string msg) : message(msg) { } 00029 00034 const char* getMsg() { 00035 return message.c_str(); 00036 } 00037 00038 protected: 00040 string message; 00041 }; 00042 00046 class NotEnoughMemoryException : public Exception { 00047 public: 00051 NotEnoughMemoryException() : Exception("Not enough memory") {} 00052 }; 00053 00054 #endif // ! __EXCEPTION_H__