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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1530 - (hide annotations)
Tue Apr 29 02:15:27 2008 UTC (14 years, 3 months ago) by phornby
File MIME type: text/plain
File size: 2670 byte(s)
Add operator=()
1 ksteube 1312
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 jgs 102 #if !defined escript_EsysAssertException_20040330_H
17 jgs 82 #define escript_EsysAssertException_20040330_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20 jgs 468 #include "EsysException.h"
21 jgs 82
22     namespace esysUtils {
23    
24 phornby 1455 /**
25     \brief
26     EsysAssertException exception class.
27 jgs 82
28 phornby 1455 Description:
29     EsysAssertException exception class.
30     The class provides a public function returning the exception name.
31     */
32     class EsysAssertException : public EsysException
33     {
34 jgs 82
35 phornby 1455 protected:
36 jgs 102
37 phornby 1455 typedef EsysException Parent;
38 jgs 102
39 phornby 1455 public:
40     /**
41     \brief
42     Default constructor for the exception.
43     */
44 trankine 1509 inline
45 phornby 1455 EsysAssertException() : Parent() { updateMessage();}
46     /**
47     \brief
48     Constructor for the exception.
49     */
50 trankine 1509 inline
51 phornby 1455 EsysAssertException(const char *cstr) : Parent(cstr) { updateMessage();}
52     /**
53     \brief
54     Constructor for the exception.
55     */
56 trankine 1509 inline
57 phornby 1455 EsysAssertException(const std::string &str) :
58     Parent(str) { updateMessage();}
59     /**
60     \brief
61     Copy Constructor for the exception.
62     */
63 trankine 1509 inline
64 phornby 1455 EsysAssertException(const EsysAssertException &other) : Parent(other)
65     {
66     updateMessage();
67     }
68 jgs 102
69 phornby 1530 inline
70     EsysAssertException &
71     EsysAssertException::operator=(const EsysAssertException &other)
72     THROW_ANY
73     {
74     Parent::operator=(other);
75     updateMessage();
76     return *this;
77     }
78 jgs 102
79 phornby 1530
80 phornby 1455 /// Destructor
81 trankine 1509 ESYSUTILS_DLL_API
82 trankine 1462 virtual ~EsysAssertException() THROW_ANY {}
83 phornby 1020
84 phornby 1455 /**
85     \brief
86     Returns the name of the exception.
87     */
88 trankine 1509 ESYSUTILS_DLL_API
89 phornby 1455 virtual const std::string & exceptionName() const;
90 jgs 102
91 phornby 1455 /**
92     \brief
93     Builds a formatted message and throws an EsysAssertException.
94     */
95 trankine 1509 ESYSUTILS_DLL_API
96 phornby 1455 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 jgs 82
102 phornby 1455 //
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 jgs 82
109     } // end of namespace
110 jgs 468
111 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26