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