/[escript]/trunk/esysUtils/src/EsysAssertException.h
ViewVC logotype

Contents of /trunk/esysUtils/src/EsysAssertException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1455 - (show annotations)
Thu Feb 28 17:19:44 2008 UTC (11 years, 3 months ago) by phornby
File MIME type: text/plain
File size: 2316 byte(s)
Merge of branches/windows_from_1431_trunk.

Revamp of the exception system.
Fix unused vars and signed/unsigned comparisons.
defined a macro THROW(ARG) in the system_dep.h's to
deal with the expectations of declarations on different architectures.

Details in the logs of branches/windows_from_1431_trunk.

pre-merge snapshot of the trunk in tags/trunk_at_1452


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 EsysAssertException() : Parent() { updateMessage();}
45 /**
46 \brief
47 Constructor for the exception.
48 */
49 EsysAssertException(const char *cstr) : Parent(cstr) { updateMessage();}
50 /**
51 \brief
52 Constructor for the exception.
53 */
54 EsysAssertException(const std::string &str) :
55 Parent(str) { updateMessage();}
56 /**
57 \brief
58 Copy Constructor for the exception.
59 */
60 EsysAssertException(const EsysAssertException &other) : Parent(other)
61 {
62 updateMessage();
63 }
64
65
66 /// Destructor
67 virtual ~EsysAssertException() THROW() {}
68
69 /**
70 \brief
71 Returns the name of the exception.
72 */
73 virtual const std::string & exceptionName() const;
74
75 /**
76 \brief
77 Builds a formatted message and throws an EsysAssertException.
78 */
79 static void assertFailure (const std::string& assertion,
80 const std::string& date,
81 const std::string& file,
82 int line, const std::string& errDesc);
83 private:
84
85 //
86 // the exception name is immutable and class-wide.
87 // Inheritor note; you need one of these too.
88 // and an overloaded exceptionName() in your .cpp implementation file.
89 static const std::string exceptionNameValue;
90 };
91
92 } // end of namespace
93
94 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26