/[escript]/branches/windows_from_1456_trunk_1522_merged_in/esysUtils/src/EsysAssertException.h
ViewVC logotype

Contents of /branches/windows_from_1456_trunk_1522_merged_in/esysUtils/src/EsysAssertException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1533 - (show annotations)
Tue Apr 29 03:12:46 2008 UTC (12 years, 7 months ago) by phornby
File MIME type: text/plain
File size: 2755 byte(s)
Be explicit about the external linkage of constructors.
Fix syntax to compile on linux.


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

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26