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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 644 - (hide annotations)
Fri Mar 24 01:05:42 2006 UTC (13 years, 6 months ago) by elspeth
Original Path: trunk/esysUtils/src/EsysException.h
File MIME type: text/plain
File size: 3426 byte(s)
More copyright.

1 jgs 82 /*
2 elspeth 644 ************************************************************
3     * Copyright 2006 by ACcESS MNRF *
4     * *
5     * http://www.access.edu.au *
6     * Primary Business: Queensland, Australia *
7     * Licensed under the Open Software License version 3.0 *
8     * http://www.opensource.org/licenses/osl-3.0.php *
9     * *
10     ************************************************************
11 jgs 82 */
12    
13     #ifndef ESYSEXCEPTION_H
14     #define ESYSEXCEPTION_H
15    
16     #include <string>
17     #include <sstream>
18     #include <exception>
19 jgs 468 #include <algorithm>
20 jgs 82
21     namespace esysUtils {
22     /**
23 jgs 121 \page esys_exception Esys Exceptions
24 jgs 82 A base class for exception classes used within Esys system.
25    
26 jgs 121 \version 1.0.0
27 jgs 82
28 jgs 121 \section class_desc Class Description:
29 jgs 82 A base class for exception classes used within Esys system.
30    
31 jgs 121 \section class_limits Class Limitations:
32 jgs 82 None
33    
34 jgs 121 \section class_conds Class Conditions of Use:
35 jgs 82 None
36    
37 jgs 121 \section throws Throws:
38 jgs 82 None
39    
40     */
41     class EsysException:public std::exception {
42     public:
43     /**
44 jgs 121 \brief
45 jgs 82 Default Constructor. Creates an exception with no message.
46     */
47     EsysException();
48     /**
49 jgs 121 * \brief
50 jgs 82 Constructor which creates a EsysException with the given message
51    
52     @param exceptionReason Input - Exception message.
53     */
54     EsysException(const std::string &exceptionReason);
55     /**
56 jgs 121 * \brief
57 jgs 82 Constructor which creates a EsysException with the given message
58 jgs 121
59 jgs 82 @param cStr - Exception message.
60     */
61     EsysException( const char *cStr );
62     /**
63 jgs 121 * \brief
64 jgs 82 Copy constructor
65 jgs 121
66 jgs 82 @param inException Input - EsysException
67     */
68     EsysException(const EsysException &inException);
69     /// Destructor
70     virtual ~EsysException() throw();
71     /**
72 jgs 121 \brief
73 jgs 82 Assignment operator.
74 jgs 121
75 jgs 82 @param inException Input - Exception to be copied.
76     */
77     EsysException &operator=(const EsysException &inException);
78     /**
79 jgs 121 \brief
80 jgs 82 Return the exception message in the form
81 jgs 121 &lt;Exception Name&gt;: &lt;Exception Message&gt;
82    
83 jgs 82 @return the exception message.
84     */
85     std::string toString() const;
86     /**
87 jgs 121 \brief
88 jgs 82 Return the name of the exception. This is expected to be overloaded
89     in derived classes with the derived class name.
90 jgs 121
91 jgs 82 @return the name of the exception.
92     */
93     virtual std::string exceptionName() const;
94     /**
95 jgs 121 \brief
96 jgs 82 Return the ostrstream that contains the exception message.
97     This is useful for entering or adding to the message as the stream
98     insertion operators can then be used.
99 jgs 121
100 jgs 82 @return the ostrstream for the exception reason.
101     */
102     std::ostringstream& reason();
103     /**
104 jgs 121 \brief
105 jgs 82 Return a description of the exception in the same format as the toString
106     method.
107 jgs 121
108 jgs 82 @return a description of the exception.
109     */
110     virtual const char* what() const throw();
111     private:
112     //
113     // the exception message
114     std::ostringstream m_reason;
115     //
116     // the full exception message kept in permenant storage
117     mutable std::string m_exceptionMessage;
118     };
119     /**
120 jgs 121 \brief
121 jgs 82 Stream insertion operator for EsysExceptions
122 jgs 121
123 jgs 82 @param output Input - Output stream.
124     @param inException Input - The exception to be inserted into the output
125     stream.
126     */
127     std::ostream &operator<<(std::ostream &output, EsysException &inException);
128    
129     }
130    
131     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26