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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26