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

Annotation of /trunk/esysUtils/src/EsysException.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (hide annotations)
Fri May 6 04:26:16 2005 UTC (17 years, 10 months ago) by jgs
Original Path: trunk/esys2/esysUtils/src/EsysException.h
File MIME type: text/plain
File size: 3733 byte(s)
Merge of development branch back to main trunk on 2005-05-06

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26