/[escript]/branches/windows_from_1431_trunk/esysUtils/src/EsysException.cpp
ViewVC logotype

Annotation of /branches/windows_from_1431_trunk/esysUtils/src/EsysException.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1441 - (hide annotations)
Thu Feb 28 06:50:26 2008 UTC (13 years, 9 months ago) by trankine
File size: 1810 byte(s)
We have a successful compile & link of escript & esysUtils.
1 jgs 82
2 ksteube 1312 /* $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 468 #include "EsysException.h"
17 jgs 82
18     using namespace esysUtils;
19    
20 trankine 1439 const std::string EsysException::exceptionNameValue("GeneralEsysException");
21    
22 trankine 1441 std::ostream &operator<<(std::ostream &output, EsysException &inException){
23 jgs 82 output << inException.toString();
24     return output;
25     }
26    
27     EsysException::EsysException():
28 trankine 1439 exception(),
29     m_reason()
30 jgs 82 {
31 trankine 1439 updateMessage();
32 jgs 82 }
33    
34 trankine 1439 EsysException::EsysException(const std::string &exceptionReason):
35     exception(),
36     m_reason(exceptionReason)
37 jgs 82 {
38 trankine 1439 updateMessage();
39 jgs 82 }
40    
41     // Copy Constructor.
42     EsysException::EsysException(const EsysException &inException):
43     exception(inException)
44     {
45     *this=inException;
46     }
47    
48     EsysException::EsysException( const char *cStr ):
49 trankine 1439 exception(),
50     m_reason(cStr)
51 jgs 82 {
52 trankine 1439 updateMessage();
53 jgs 82 }
54    
55 trankine 1439 EsysException::~EsysException()
56 jgs 82 {}
57    
58 trankine 1439 const std::string & EsysException::exceptionName() const
59 jgs 82 {
60 trankine 1439 return exceptionNameValue;
61 jgs 82 }
62 trankine 1439
63 jgs 82 //
64     // Overloaded assignment operator.
65 trankine 1439 EsysException& EsysException::operator=(const EsysException &inException)
66     {
67     if (this != &inException)
68     {
69     //
70     // call the base class operator=
71     // win32 refactor: parent class operator= shares pointer the result is
72     // all classes try to free the same pointer, dies on windows badly.
73     // exception::operator=(inException);
74     //
75     // copy the message buffer into this EsysException
76     m_reason = inException.m_reason;
77     updateMessage();
78 jgs 82 }
79     return *this;
80     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26