/[escript]/trunk/pasowrap/src/PasoException.h
ViewVC logotype

Contents of /trunk/pasowrap/src/PasoException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 7 months ago) by jfenwick
File MIME type: text/plain
File size: 2484 byte(s)
Round 1 of copyright fixes
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
27 /**
28 \brief
29 PasoException exception class.
30
31 Description:
32 PasoException exception class.
33 The class provides a public function returning the exception name
34 */
35 class PasoException : public esysUtils::EsysException
36 {
37
38 protected:
39
40 typedef EsysException Parent;
41
42 public:
43 /**
44 \brief
45 Default constructor for the exception.
46 */
47 PASOWRAP_DLL_API
48 PasoException() : Parent() { updateMessage();}
49 /**
50 \brief
51 Constructor for the exception.
52 */
53 PASOWRAP_DLL_API
54 PasoException(const char *cstr) : Parent(cstr) { updateMessage();}
55 /**
56 \brief
57 Constructor for the exception.
58 */
59 PASOWRAP_DLL_API
60 PasoException(const std::string &str) :
61 Parent(str) { updateMessage();}
62 /**
63 \brief
64 Copy Constructor for the exception.
65 */
66 PASOWRAP_DLL_API
67 PasoException(const PasoException &other) : Parent(other)
68 {
69 updateMessage();
70 }
71
72 /// Destructor
73 PASOWRAP_DLL_API
74 virtual ~PasoException() THROW(NO_ARG) {}
75
76 /**
77 \brief
78 Assignment operator.
79 */
80 PASOWRAP_DLL_API
81 inline PasoException &
82 operator=(const PasoException &other ) THROW(NO_ARG)
83 {
84 Parent::operator=(other);
85 updateMessage();
86 return *this;
87 }
88
89 /**
90 \brief
91 Returns the name of the exception.
92 */
93 PASOWRAP_DLL_API
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
105 PASOWRAP_DLL_API
106 void checkPasoError();
107
108
109 } // end of namespace
110 #endif

  ViewVC Help
Powered by ViewVC 1.1.26