1 |
|
2 |
/* $Id$ */ |
3 |
|
4 |
/******************************************************* |
5 |
* |
6 |
* Copyright 2003-2007 by ACceSS MNRF |
7 |
* Copyright 2007 by University of Queensland |
8 |
* |
9 |
* http://esscc.uq.edu.au |
10 |
* Primary Business: Queensland, Australia |
11 |
* Licensed under the Open Software License version 3.0 |
12 |
* http://www.opensource.org/licenses/osl-3.0.php |
13 |
* |
14 |
*******************************************************/ |
15 |
|
16 |
#if !defined escript_FunctionSpaceException_20040602_H |
17 |
#define escript_FunctionSpaceException_20040602_H |
18 |
#include "system_dep.h" |
19 |
|
20 |
#include "esysUtils/EsysException.h" |
21 |
|
22 |
namespace escript |
23 |
{ |
24 |
|
25 |
/** |
26 |
\brief |
27 |
FunctionSpaceException exception class. |
28 |
|
29 |
Description: |
30 |
FunctionSpaceException exception class. |
31 |
The class provides a public function returning the exception name |
32 |
*/ |
33 |
class FunctionSpaceException : public esysUtils::EsysException |
34 |
{ |
35 |
|
36 |
protected: |
37 |
|
38 |
typedef EsysException Parent; |
39 |
|
40 |
public: |
41 |
/** |
42 |
\brief |
43 |
Default constructor for the exception. |
44 |
*/ |
45 |
ESCRIPT_DLL_API |
46 |
FunctionSpaceException() : Parent() { updateMessage();} |
47 |
/** |
48 |
\brief |
49 |
Constructor for the exception. |
50 |
*/ |
51 |
ESCRIPT_DLL_API |
52 |
FunctionSpaceException(const char *cstr) : Parent(cstr) { updateMessage();} |
53 |
/** |
54 |
\brief |
55 |
Constructor for the exception. |
56 |
*/ |
57 |
ESCRIPT_DLL_API |
58 |
FunctionSpaceException(const std::string &str) : |
59 |
Parent(str) { updateMessage();} |
60 |
/** |
61 |
\brief |
62 |
Copy Constructor for the exception. |
63 |
*/ |
64 |
ESCRIPT_DLL_API |
65 |
FunctionSpaceException(const FunctionSpaceException &other) : Parent(other) |
66 |
{ |
67 |
updateMessage(); |
68 |
} |
69 |
|
70 |
ESCRIPT_DLL_API |
71 |
inline virtual FunctionSpaceException & |
72 |
operator=(const FunctionSpaceException &other ) THROW_ANY |
73 |
{ |
74 |
Parent::operator=(other); |
75 |
updateMessage(); |
76 |
return *this; |
77 |
} |
78 |
|
79 |
|
80 |
/// Destructor |
81 |
ESCRIPT_DLL_API |
82 |
virtual ~FunctionSpaceException() THROW_ANY {} |
83 |
/** |
84 |
\brief |
85 |
Returns the name of the exception. |
86 |
*/ |
87 |
ESCRIPT_DLL_API |
88 |
virtual const std::string & exceptionName() const; |
89 |
|
90 |
private: |
91 |
|
92 |
// |
93 |
// the exception name is immutable and class-wide. |
94 |
// Inheritor note; you need one of these too. |
95 |
// and an overloaded exceptionName() in your .cpp implementation file. |
96 |
static const std::string exceptionNameValue; |
97 |
}; |
98 |
|
99 |
} // end of namespace |
100 |
#endif |