/[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 1530 - (show annotations)
Tue Apr 29 02:15:27 2008 UTC (12 years, 6 months ago) by phornby
File MIME type: text/plain
File size: 2670 byte(s)
Add operator=()
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 inline
45 EsysAssertException() : Parent() { updateMessage();}
46 /**
47 \brief
48 Constructor for the exception.
49 */
50 inline
51 EsysAssertException(const char *cstr) : Parent(cstr) { updateMessage();}
52 /**
53 \brief
54 Constructor for the exception.
55 */
56 inline
57 EsysAssertException(const std::string &str) :
58 Parent(str) { updateMessage();}
59 /**
60 \brief
61 Copy Constructor for the exception.
62 */
63 inline
64 EsysAssertException(const EsysAssertException &other) : Parent(other)
65 {
66 updateMessage();
67 }
68
69 inline
70 EsysAssertException &
71 EsysAssertException::operator=(const EsysAssertException &other)
72 THROW_ANY
73 {
74 Parent::operator=(other);
75 updateMessage();
76 return *this;
77 }
78
79
80 /// Destructor
81 ESYSUTILS_DLL_API
82 virtual ~EsysAssertException() THROW_ANY {}
83
84 /**
85 \brief
86 Returns the name of the exception.
87 */
88 ESYSUTILS_DLL_API
89 virtual const std::string & exceptionName() const;
90
91 /**
92 \brief
93 Builds a formatted message and throws an EsysAssertException.
94 */
95 ESYSUTILS_DLL_API
96 static void assertFailure (const std::string& assertion,
97 const std::string& date,
98 const std::string& file,
99 int line, const std::string& errDesc);
100 private:
101
102 //
103 // the exception name is immutable and class-wide.
104 // Inheritor note; you need one of these too.
105 // and an overloaded exceptionName() in your .cpp implementation file.
106 static const std::string exceptionNameValue;
107 };
108
109 } // end of namespace
110
111 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26