/[escript]/branches/windows_from_1383_trunk/esysUtils/src/EsysException.h
ViewVC logotype

Annotation of /branches/windows_from_1383_trunk/esysUtils/src/EsysException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1398 - (hide annotations)
Wed Jan 23 07:46:09 2008 UTC (14 years, 6 months ago) by trankine
File MIME type: text/plain
File size: 3309 byte(s)
Remove the throw() modifier from the destructor declaration.
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 82 #ifndef ESYSEXCEPTION_H
17     #define ESYSEXCEPTION_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20     #include <string>
21     #include <sstream>
22     #include <exception>
23 jgs 468 #include <algorithm>
24 jgs 82
25     namespace esysUtils {
26     /**
27 jgs 121 \page esys_exception Esys Exceptions
28 jgs 82 A base class for exception classes used within Esys system.
29    
30 jgs 121 \version 1.0.0
31 jgs 82
32 jgs 121 \section class_desc Class Description:
33 jgs 82 A base class for exception classes used within Esys system.
34    
35 jgs 121 \section class_limits Class Limitations:
36 jgs 82 None
37    
38 jgs 121 \section class_conds Class Conditions of Use:
39 jgs 82 None
40    
41 jgs 121 \section throws Throws:
42 jgs 82 None
43    
44     */
45     class EsysException:public std::exception {
46     public:
47     /**
48 jgs 121 \brief
49 jgs 82 Default Constructor. Creates an exception with no message.
50     */
51     EsysException();
52     /**
53 jgs 121 * \brief
54 jgs 82 Constructor which creates a EsysException with the given message
55    
56     @param exceptionReason Input - Exception message.
57     */
58     EsysException(const std::string &exceptionReason);
59     /**
60 jgs 121 * \brief
61 jgs 82 Constructor which creates a EsysException with the given message
62 jgs 121
63 jgs 82 @param cStr - Exception message.
64     */
65     EsysException( const char *cStr );
66     /**
67 jgs 121 * \brief
68 jgs 82 Copy constructor
69 jgs 121
70 jgs 82 @param inException Input - EsysException
71     */
72     EsysException(const EsysException &inException);
73     /// Destructor
74 trankine 1398 virtual ~EsysException();
75 jgs 82 /**
76 jgs 121 \brief
77 jgs 82 Assignment operator.
78 jgs 121
79 jgs 82 @param inException Input - Exception to be copied.
80     */
81     EsysException &operator=(const EsysException &inException);
82     /**
83 jgs 121 \brief
84 jgs 82 Return the exception message in the form
85 jgs 121 &lt;Exception Name&gt;: &lt;Exception Message&gt;
86    
87 jgs 82 @return the exception message.
88     */
89     std::string toString() const;
90     /**
91 jgs 121 \brief
92 jgs 82 Return the name of the exception. This is expected to be overloaded
93     in derived classes with the derived class name.
94 jgs 121
95 jgs 82 @return the name of the exception.
96     */
97     virtual std::string exceptionName() const;
98     /**
99 jgs 121 \brief
100 jgs 82 Return the ostrstream that contains the exception message.
101     This is useful for entering or adding to the message as the stream
102     insertion operators can then be used.
103 jgs 121
104 jgs 82 @return the ostrstream for the exception reason.
105     */
106     std::ostringstream& reason();
107     /**
108 jgs 121 \brief
109 jgs 82 Return a description of the exception in the same format as the toString
110     method.
111 jgs 121
112 jgs 82 @return a description of the exception.
113     */
114     virtual const char* what() const throw();
115     private:
116     //
117     // the exception message
118     std::ostringstream m_reason;
119     //
120     // the full exception message kept in permenant storage
121     mutable std::string m_exceptionMessage;
122     };
123     /**
124 jgs 121 \brief
125 jgs 82 Stream insertion operator for EsysExceptions
126 jgs 121
127 jgs 82 @param output Input - Output stream.
128     @param inException Input - The exception to be inserted into the output
129     stream.
130     */
131     std::ostream &operator<<(std::ostream &output, EsysException &inException);
132    
133     }
134    
135     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26