00001 #ifndef SCT_LOGICERRORS_H 00002 #define SCT_LOGICERRORS_H 00003 00004 #include "Exception.h" 00005 00006 namespace Sct { 00007 00014 class LogicError : public Error { 00015 public: 00019 LogicError(const string& msg, const string& file, int line) throw(); 00020 00025 LogicError(Throwable& cause, const string& file, int line) throw(); 00026 00030 LogicError(const string& msg, Throwable& cause, const string& file, int line) throw(); 00031 00032 protected: 00033 LogicError() throw() {} 00034 }; 00035 00036 00042 class InvalidArgumentError : public LogicError { 00043 public: 00047 InvalidArgumentError(const string& msg, const string& file, int line) throw(); 00048 00053 InvalidArgumentError(Throwable& cause, const string& file, int line) throw(); 00054 00058 InvalidArgumentError(const string& msg, Throwable& cause, const string& file, int line) throw(); 00059 00060 protected: 00061 InvalidArgumentError() throw() {} 00062 }; 00063 00065 typedef InvalidArgumentError InvalidArgument; 00066 00067 00074 class InvariantViolatedError : public LogicError { 00075 public: 00079 InvariantViolatedError(const string& msg, const string& file, int line) throw(); 00080 00085 InvariantViolatedError(Throwable& cause, const string& file, int line) throw(); 00086 00090 InvariantViolatedError(const string& msg, Throwable& cause, const string& file, int line) throw(); 00091 00092 protected: 00093 InvariantViolatedError() throw() {} 00094 }; 00095 00096 00097 00104 class IllegalStateError : public LogicError { 00105 public: 00109 IllegalStateError(const string& msg, const string& file, int line) throw(); 00110 00115 IllegalStateError(Throwable& cause, const string& file, int line) throw(); 00116 00120 IllegalStateError(const string& msg, Throwable& cause, const string& file, int line) throw(); 00121 00122 protected: 00123 IllegalStateError() throw() {} 00124 }; 00125 00126 } 00127 00128 #endif //SCT_LOGICERRORS_H