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_DataException_20040324_H 00016 #define escript_DataException_20040324_H 00017 #include "system_dep.h" 00018 00019 #include "esysUtils/EsysException.h" 00020 00021 namespace escript 00022 { 00023 00032 class DataException : public esysUtils::EsysException 00033 { 00034 00035 protected: 00036 00037 typedef EsysException Parent; 00038 00039 public: 00044 ESCRIPT_DLL_API 00045 DataException() : Parent() { updateMessage();} 00050 ESCRIPT_DLL_API 00051 DataException(const char *cstr) : Parent(cstr) { updateMessage();} 00056 ESCRIPT_DLL_API 00057 DataException(const std::string &str) : Parent(str) { updateMessage();} 00062 ESCRIPT_DLL_API 00063 DataException(const DataException &other) : Parent(other) 00064 { 00065 updateMessage(); 00066 } 00067 00068 ESCRIPT_DLL_API 00069 inline DataException & 00070 operator=(const DataException &other ) THROW(NO_ARG) 00071 { 00072 Parent::operator=(other); 00073 updateMessage(); 00074 return *this; 00075 } 00076 00077 00079 ESCRIPT_DLL_API 00080 virtual ~DataException() THROW(NO_ARG) {} 00081 00086 ESCRIPT_DLL_API 00087 virtual const std::string & exceptionName() const; 00088 00089 private: 00090 00091 // 00092 // the exception name is immutable and class-wide. 00093 // Inheritor note; you need one of these too. 00094 // and an overloaded exceptionName() in your .cpp implementation file. 00095 static const std::string exceptionNameValue; 00096 00097 00098 }; 00099 00100 } // end of namespace 00101 00102 00103 #endif