00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __SO3_EXCEPTION_H__
00029 #define __SO3_EXCEPTION_H__
00030
00031 #include "../SCOLBasic/SO3Std.h"
00032
00033 namespace SO3
00034 {
00035
00039 class _SO3_Export SException : public std::exception
00040 {
00041 public:
00042 protected:
00043 long line;
00044 std::string typeName;
00045 std::string description;
00046 std::string source;
00047 std::string file;
00048 bool toLogFile;
00049 mutable std::string fullDesc;
00050 private:
00051
00052 public:
00056 SException(const std::string& exceptDescription, const std::string& exceptSource, bool exceptToLogFile);
00057
00061 SException(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptType, const char* exceptFile, long exceptLine, bool exceptToLogFile);
00062
00066 SException(const SException& exception);
00067
00071 ~SException() throw();
00072
00075 void operator =(const SException& exception);
00076
00079 virtual const std::string& GetFullDescription() const;
00080
00083 virtual const std::string& GetSource() const;
00084
00087 virtual const std::string& GetFile() const;
00088
00091 virtual long GetLine() const;
00092
00095 virtual const std::string& GetDescription() const;
00096
00099 const char* what() const throw();
00100 protected:
00101 private:
00102 };
00103
00107 class _SO3_Export SExceptionUnimplemented : public SException
00108 {
00109 public:
00110 protected:
00111 private:
00112
00113 public:
00114 SExceptionUnimplemented(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00115 protected:
00116 private:
00117 };
00118
00122 class _SO3_Export SExceptionNullReference : public SException
00123 {
00124 public:
00125 protected:
00126 private:
00127
00128 public:
00129 SExceptionNullReference(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00130 protected:
00131 private:
00132 };
00133
00137 class _SO3_Export SExceptionFileNotFound : public SException
00138 {
00139 public:
00140 protected:
00141 private:
00142
00143 public:
00144 SExceptionFileNotFound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00145 protected:
00146 private:
00147 };
00148
00152 class _SO3_Export SExceptionIO : public SException
00153 {
00154 public:
00155 protected:
00156 private:
00157
00158 public:
00159 SExceptionIO(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00160 protected:
00161 private:
00162 };
00163
00167 class _SO3_Export SExceptionItemIdentity : public SException
00168 {
00169 public:
00170 protected:
00171 private:
00172
00173 public:
00174 SExceptionItemIdentity(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00175 protected:
00176 private:
00177 };
00178
00182 class _SO3_Export SExceptionItemNotFound : public SException
00183 {
00184 public:
00185 protected:
00186 private:
00187
00188 public:
00189 SExceptionItemNotFound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00190 protected:
00191 private:
00192 };
00193
00197 class _SO3_Export SExceptionInternalError : public SException
00198 {
00199 public:
00200 protected:
00201 private:
00202
00203 public:
00204 SExceptionInternalError(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00205 protected:
00206 private:
00207 };
00208
00212 class _SO3_Export SExceptionExternalAPIError : public SException
00213 {
00214 public:
00215 protected:
00216 private:
00217
00218 public:
00219 SExceptionExternalAPIError(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00220 protected:
00221 private:
00222 };
00223
00227 class _SO3_Export SExceptionInvalidParameters : public SException
00228 {
00229 public:
00230 protected:
00231 private:
00232
00233 public:
00234 SExceptionInvalidParameters(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00235 protected:
00236 private:
00237 };
00238
00242 class _SO3_Export SExceptionBadCast : public SException
00243 {
00244 public:
00245 protected:
00246 private:
00247
00248 public:
00249 SExceptionBadCast(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00250 protected:
00251 private:
00252 };
00253
00257 class _SO3_Export SExceptionWriteData : public SException
00258 {
00259 public:
00260 protected:
00261 private:
00262
00263 public:
00264 SExceptionWriteData(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00265 protected:
00266 private:
00267 };
00268
00272 class _SO3_Export SExceptionWriteOnly : public SException
00273 {
00274 public:
00275 protected:
00276 private:
00277
00278 public:
00279 SExceptionWriteOnly(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00280 protected:
00281 private:
00282 };
00283
00287 class _SO3_Export SExceptionReadData : public SException
00288 {
00289 public:
00290 protected:
00291 private:
00292
00293 public:
00294 SExceptionReadData(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00295 protected:
00296 private:
00297 };
00298
00302 class _SO3_Export SExceptionReadOnly : public SException
00303 {
00304 public:
00305 protected:
00306 private:
00307
00308 public:
00309 SExceptionReadOnly(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00310 protected:
00311 private:
00312 };
00313
00317 class _SO3_Export SExceptionOutOfBound : public SException
00318 {
00319 public:
00320 protected:
00321 private:
00322
00323 public:
00324 SExceptionOutOfBound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
00325 protected:
00326 private:
00327 };
00328
00332 #define SO3_EXCEPT(exceptionType, desc, src, toLogFile) throw(exceptionType(desc, src, __FILE__, __LINE__, toLogFile))
00333
00334 }
00335
00336 #endif