escript  Revision_
PasoException.h
Go to the documentation of this file.
00001 
00002 /*****************************************************************************
00003 *
00004 * Copyright (c) 2003-2014 by University of Queensland
00005 * http://www.uq.edu.au
00006 *
00007 * Primary Business: Queensland, Australia
00008 * Licensed under the Open Software License version 3.0
00009 * http://www.opensource.org/licenses/osl-3.0.php
00010 *
00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
00012 * Development 2012-2013 by School of Earth Sciences
00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
00014 *
00015 *****************************************************************************/
00016 
00017 /* File extracted from finley and modified */
00018 
00019 #if !defined  PasoException_20040526_H
00020 #define PasoException_20040526_H
00021 #include "system_dep.h"
00022 
00023 #include "esysUtils/EsysException.h"
00024 
00025 namespace paso
00026 {
00027 
00036   class PasoException : public esysUtils::EsysException
00037   {
00038 
00039   protected:
00040 
00041      typedef EsysException Parent;
00042 
00043   public:
00048     PASOWRAP_DLL_API
00049     PasoException() : Parent() { updateMessage();}
00054     PASOWRAP_DLL_API
00055     PasoException(const char *cstr) : Parent(cstr) { updateMessage();}
00060     PASOWRAP_DLL_API
00061     PasoException(const std::string &str) :
00062     Parent(str) { updateMessage();}
00067     PASOWRAP_DLL_API
00068     PasoException(const PasoException &other) : Parent(other)
00069       {
00070         updateMessage();
00071       }
00072 
00074     PASOWRAP_DLL_API
00075     virtual ~PasoException() THROW(NO_ARG) {}
00076 
00081     PASOWRAP_DLL_API
00082     inline PasoException &
00083     operator=(const PasoException &other ) THROW(NO_ARG)
00084        {
00085          Parent::operator=(other);
00086          updateMessage();
00087          return *this;
00088        }
00089 
00094     PASOWRAP_DLL_API
00095     virtual const std::string & exceptionName() const;
00096 
00097   private:
00098 
00099     //
00100     // the exception name is immutable and class-wide.
00101     // Inheritor note; you need one of these too.
00102     // and an overloaded exceptionName() in your .cpp implementation file. 
00103     static const std::string exceptionNameValue;
00104   };
00105 
00106   PASOWRAP_DLL_API
00107   void checkPasoError(); 
00108   
00109   
00110 } // end of namespace
00111 #endif