Escript  Revision_4320
PasoException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 /* File extracted from finley and modified */
17 
18 #if !defined PasoException_20040526_H
19 #define PasoException_20040526_H
20 #include "system_dep.h"
21 
22 #include "esysUtils/EsysException.h"
23 
24 namespace paso
25 {
26 
36  {
37 
38  protected:
39 
41 
42  public:
54  PasoException(const char *cstr) : Parent(cstr) { updateMessage();}
60  PasoException(const std::string &str) :
61  Parent(str) { updateMessage();}
67  PasoException(const PasoException &other) : Parent(other)
68  {
69  updateMessage();
70  }
71 
74  virtual ~PasoException() THROW(NO_ARG) {}
75 
81  inline PasoException &
83  {
84  Parent::operator=(other);
85  updateMessage();
86  return *this;
87  }
88 
94  virtual const std::string & exceptionName() const;
95 
96  private:
97 
98  //
99  // the exception name is immutable and class-wide.
100  // Inheritor note; you need one of these too.
101  // and an overloaded exceptionName() in your .cpp implementation file.
102  static const std::string exceptionNameValue;
103  };
104 
106  void checkPasoError();
107 
108 
109 } // end of namespace
110 #endif