/[escript]/trunk/dudley/src/CPPAdapter/DudleyAdapterException.h
ViewVC logotype

Annotation of /trunk/dudley/src/CPPAdapter/DudleyAdapterException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1649 - (hide annotations)
Tue Jul 15 08:41:02 2008 UTC (10 years, 9 months ago) by phornby
Original Path: trunk/finley/src/CPPAdapter/FinleyAdapterException.h
File MIME type: text/plain
File size: 2404 byte(s)
Make operator=() on exception non-virtual. Should silence the Altix compiler.
However, if an exception is cast to another parent type, and
operator=() is called when the exception so cast is an l-value in the assignment,
an "incomplete" assignment will occur, copying only the parent class members of the 
l-value in the assignmnet.
1 ksteube 1312
2     /* $Id$ */
3    
4     /*******************************************************
5 phornby 1455 *
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 ksteube 1312
16 jgs 82 #if !defined finley_FinleyAdapterException_20040526_H
17     #define finley_FinleyAdapterException_20040526_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20 robwdcock 682 #include "esysUtils/EsysException.h"
21 jgs 472
22 phornby 1455 namespace finley
23     {
24 jgs 82
25 phornby 1455 /**
26     \brief
27     FinleyAdapterException exception class.
28 jgs 82
29 phornby 1455 Description:
30     FinleyAdapterException exception class.
31     The class provides a public function returning the exception name
32     */
33     class FinleyAdapterException : public esysUtils::EsysException
34     {
35 jgs 82
36 phornby 1455 protected:
37 jgs 82
38 phornby 1455 typedef EsysException Parent;
39 phornby 1020
40 phornby 1455 public:
41     /**
42     \brief
43     Default constructor for the exception.
44     */
45     FINLEY_DLL_API
46     FinleyAdapterException() : Parent() { updateMessage();}
47     /**
48     \brief
49     Constructor for the exception.
50     */
51     FINLEY_DLL_API
52     FinleyAdapterException(const char *cstr) : Parent(cstr) { updateMessage();}
53     /**
54     \brief
55     Constructor for the exception.
56     */
57     FINLEY_DLL_API
58     FinleyAdapterException(const std::string &str) :
59     Parent(str) { updateMessage();}
60     /**
61     \brief
62     Copy Constructor for the exception.
63     */
64     FINLEY_DLL_API
65     FinleyAdapterException(const FinleyAdapterException &other) : Parent(other)
66     {
67     updateMessage();
68     }
69 jgs 82
70 phornby 1455 /// Destructor
71     FINLEY_DLL_API
72 phornby 1628 virtual ~FinleyAdapterException() THROW_ANY {}
73    
74 phornby 1455 /**
75     \brief
76 phornby 1628 Assignment operator.
77     */
78     FINLEY_DLL_API
79 phornby 1649 inline FinleyAdapterException &
80 phornby 1628 operator=(const FinleyAdapterException &other ) THROW_ANY
81     {
82     Parent::operator=(other);
83     updateMessage();
84     return *this;
85     }
86    
87     /**
88     \brief
89 phornby 1455 Returns the name of the exception.
90     */
91     FINLEY_DLL_API
92     virtual const std::string & exceptionName() const;
93    
94     private:
95    
96     //
97     // the exception name is immutable and class-wide.
98     // Inheritor note; you need one of these too.
99     // and an overloaded exceptionName() in your .cpp implementation file.
100     static const std::string exceptionNameValue;
101     };
102    
103 jgs 82 } // end of namespace
104     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26