/[escript]/release/3.4.2/pasowrap/src/PasoException.h
ViewVC logotype

Contents of /release/3.4.2/pasowrap/src/PasoException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4919 - (show annotations)
Wed Apr 30 06:25:55 2014 UTC (6 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 2552 byte(s)
Because we've got to!

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 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
28 /**
29 \brief
30 PasoException exception class.
31
32 Description:
33 PasoException exception class.
34 The class provides a public function returning the exception name
35 */
36 class PasoException : public esysUtils::EsysException
37 {
38
39 protected:
40
41 typedef EsysException Parent;
42
43 public:
44 /**
45 \brief
46 Default constructor for the exception.
47 */
48 PASOWRAP_DLL_API
49 PasoException() : Parent() { updateMessage();}
50 /**
51 \brief
52 Constructor for the exception.
53 */
54 PASOWRAP_DLL_API
55 PasoException(const char *cstr) : Parent(cstr) { updateMessage();}
56 /**
57 \brief
58 Constructor for the exception.
59 */
60 PASOWRAP_DLL_API
61 PasoException(const std::string &str) :
62 Parent(str) { updateMessage();}
63 /**
64 \brief
65 Copy Constructor for the exception.
66 */
67 PASOWRAP_DLL_API
68 PasoException(const PasoException &other) : Parent(other)
69 {
70 updateMessage();
71 }
72
73 /// Destructor
74 PASOWRAP_DLL_API
75 virtual ~PasoException() THROW(NO_ARG) {}
76
77 /**
78 \brief
79 Assignment operator.
80 */
81 PASOWRAP_DLL_API
82 inline PasoException &
83 operator=(const PasoException &other ) THROW(NO_ARG)
84 {
85 Parent::operator=(other);
86 updateMessage();
87 return *this;
88 }
89
90 /**
91 \brief
92 Returns the name of the exception.
93 */
94 PASOWRAP_DLL_API
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
106 PASOWRAP_DLL_API
107 void checkPasoError();
108
109
110 } // end of namespace
111 #endif

  ViewVC Help
Powered by ViewVC 1.1.26