escript  Revision_Unversioneddirectory
PasoException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 /* File extracted from finley and modified */
18 
19 #if !defined PasoException_20040526_H
20 #define PasoException_20040526_H
21 #include "system_dep.h"
22 
23 #include "esysUtils/EsysException.h"
24 
25 namespace paso
26 {
27 
37  {
38 
39  protected:
40 
42 
43  public:
49  PasoException() : Parent() { updateMessage();}
55  PasoException(const char *cstr) : Parent(cstr) { updateMessage();}
61  PasoException(const std::string &str) :
62  Parent(str) { updateMessage();}
68  PasoException(const PasoException &other) : Parent(other)
69  {
70  updateMessage();
71  }
72 
75  virtual ~PasoException() THROW(NO_ARG) {}
76 
82  inline PasoException &
84  {
85  Parent::operator=(other);
86  updateMessage();
87  return *this;
88  }
89 
95  virtual const std::string & exceptionName() const;
96 
97  private:
98 
99  //
100  // the exception name is immutable and class-wide.
101  // Inheritor note; you need one of these too.
102  // and an overloaded exceptionName() in your .cpp implementation file.
103  static const std::string exceptionNameValue;
104  };
105 
107  void checkPasoError();
108 
109 
110 } // end of namespace
111 #endif
void updateMessage()
update m_exceptionMessage after a reason update.
Definition: EsysException.h:202
PasoException & operator=(const PasoException &other) THROW(NO_ARG)
Assignment operator.
Definition: PasoException.h:83
A base class for exception classes used within Esys system.
Definition: EsysException.h:31
#define NO_ARG
Definition: esysUtils/src/system_dep.h:56
virtual ~PasoException() THROW(NO_ARG)
Destructor.
Definition: PasoException.h:75
Definition: AMG.cpp:38
EsysException Parent
Definition: PasoException.h:41
PasoException(const std::string &str)
Constructor for the exception.
Definition: PasoException.h:61
virtual const std::string & exceptionName() const
Returns the name of the exception.
Definition: PasoException.cpp:29
static const std::string exceptionNameValue
Definition: PasoException.h:103
PasoException()
Default constructor for the exception.
Definition: PasoException.h:49
void checkPasoError()
Definition: PasoException.cpp:35
#define THROW(ARG)
Definition: esysUtils/src/system_dep.h:53
EsysException()
Default Constructor. Creates an exception with no message.
Definition: EsysException.cpp:29
PasoException(const char *cstr)
Constructor for the exception.
Definition: PasoException.h:55
PasoException exception class.
Definition: PasoException.h:36
#define PASOWRAP_DLL_API
Definition: pasowrap/src/system_dep.h:31
PasoException(const PasoException &other)
Copy Constructor for the exception.
Definition: PasoException.h:68