/[escript]/branches/trilinos_from_5897/paso/src/PasoException.h
ViewVC logotype

Contents of /branches/trilinos_from_5897/paso/src/PasoException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5933 - (show annotations)
Wed Feb 17 23:53:30 2016 UTC (21 months, 4 weeks ago) by caltinay
File MIME type: text/plain
File size: 2290 byte(s)
sync with trunk.

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 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 #ifndef __PASO_EXCEPTION_H__
18 #define __PASO_EXCEPTION_H__
19
20 #include <esysUtils/EsysException.h>
21
22 namespace paso {
23
24 /**
25 \brief
26 PasoException exception class.
27
28 Description:
29 PasoException exception class.
30 The class provides a public function returning the exception name
31 */
32 class PasoException : public esysUtils::EsysException
33 {
34
35 protected:
36 typedef EsysException Parent;
37
38 public:
39 /**
40 \brief
41 Default constructor for the exception.
42 */
43 PasoException() : Parent() { updateMessage(); }
44
45 /**
46 \brief
47 Constructor for the exception.
48 */
49 PasoException(const char *cstr) : Parent(cstr) { updateMessage(); }
50
51 /**
52 \brief
53 Constructor for the exception.
54 */
55 PasoException(const std::string &str) : Parent(str) { updateMessage(); }
56
57 /**
58 \brief
59 Copy Constructor for the exception.
60 */
61 PasoException(const PasoException &other) : Parent(other)
62 {
63 updateMessage();
64 }
65
66 /// Destructor
67 virtual ~PasoException() THROW(NO_ARG) {}
68
69 /**
70 \brief
71 Assignment operator.
72 */
73 inline PasoException& operator=(const PasoException &other ) THROW(NO_ARG)
74 {
75 Parent::operator=(other);
76 updateMessage();
77 return *this;
78 }
79
80 /**
81 \brief
82 Returns the name of the exception.
83 */
84 virtual const std::string & exceptionName() const;
85
86 private:
87 //
88 // the exception name is immutable and class-wide.
89 // Inheritor note; you need one of these too.
90 // and an overloaded exceptionName() in your .cpp implementation file.
91 static const std::string exceptionNameValue;
92 };
93
94 void checkPasoError();
95
96
97 } // end of namespace
98
99 #endif // __PASO_EXCEPTION_H__
100

  ViewVC Help
Powered by ViewVC 1.1.26