ESYS13
Revision_
|
00001 00002 /******************************************************* 00003 * 00004 * Copyright (c) 2003-2012 by University of Queensland 00005 * Earth Systems Science Computational Center (ESSCC) 00006 * http://www.uq.edu.au/esscc 00007 * 00008 * Primary Business: Queensland, Australia 00009 * Licensed under the Open Software License version 3.0 00010 * http://www.opensource.org/licenses/osl-3.0.php 00011 * 00012 *******************************************************/ 00013 00014 00015 #if !defined escript_EsysAssertException_20040330_H 00016 #define escript_EsysAssertException_20040330_H 00017 #include "system_dep.h" 00018 00019 #include "EsysException.h" 00020 00021 00022 namespace esysUtils { 00023 00032 class EsysAssertException : public EsysException 00033 { 00034 00035 protected: 00036 00037 typedef EsysException Parent; 00038 00039 public: 00044 ESYSUTILS_DLL_API 00045 inline 00046 EsysAssertException() : Parent() { updateMessage();} 00051 ESYSUTILS_DLL_API 00052 inline 00053 EsysAssertException(const char *cstr) : Parent(cstr) { updateMessage();} 00058 ESYSUTILS_DLL_API 00059 inline 00060 EsysAssertException(const std::string &str) : 00061 Parent(str) { updateMessage();} 00066 ESYSUTILS_DLL_API 00067 inline 00068 EsysAssertException(const EsysAssertException &other) : Parent(other) 00069 { 00070 updateMessage(); 00071 } 00072 00073 ESYSUTILS_DLL_API 00074 inline 00075 EsysAssertException & 00076 operator=(const EsysAssertException &other) THROW(NO_ARG) 00077 { 00078 Parent::operator=(other); 00079 updateMessage(); 00080 return *this; 00081 } 00082 00083 00085 ESYSUTILS_DLL_API 00086 virtual ~EsysAssertException() THROW(NO_ARG) {} 00087 00092 ESYSUTILS_DLL_API 00093 virtual const std::string & exceptionName() const; 00094 00099 ESYSUTILS_DLL_API 00100 static void assertFailure (const std::string& assertion, 00101 const std::string& date, 00102 const std::string& file, 00103 int line, const std::string& errDesc); 00104 private: 00105 00106 // 00107 // the exception name is immutable and class-wide. 00108 // Inheritor note; you need one of these too. 00109 // and an overloaded exceptionName() in your .cpp implementation file. 00110 static const std::string exceptionNameValue; 00111 }; 00112 00113 } // end of namespace 00114 00115 #endif