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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (show annotations)
Mon Jun 26 13:12:56 2006 UTC (16 years, 9 months ago) by woo409
File MIME type: text/plain
File size: 3450 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

1 /*
2 ************************************************************
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 */
12
13 #ifndef ESYSEXCEPTION_H
14 #define ESYSEXCEPTION_H
15 #include "system_dep.h"
16
17 #include <string>
18 #include <sstream>
19 #include <exception>
20 #include <algorithm>
21
22 namespace esysUtils {
23 /**
24 \page esys_exception Esys Exceptions
25 A base class for exception classes used within Esys system.
26
27 \version 1.0.0
28
29 \section class_desc Class Description:
30 A base class for exception classes used within Esys system.
31
32 \section class_limits Class Limitations:
33 None
34
35 \section class_conds Class Conditions of Use:
36 None
37
38 \section throws Throws:
39 None
40
41 */
42 class EsysException:public std::exception {
43 public:
44 /**
45 \brief
46 Default Constructor. Creates an exception with no message.
47 */
48 EsysException();
49 /**
50 * \brief
51 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 * \brief
58 Constructor which creates a EsysException with the given message
59
60 @param cStr - Exception message.
61 */
62 EsysException( const char *cStr );
63 /**
64 * \brief
65 Copy constructor
66
67 @param inException Input - EsysException
68 */
69 EsysException(const EsysException &inException);
70 /// Destructor
71 virtual ~EsysException() throw();
72 /**
73 \brief
74 Assignment operator.
75
76 @param inException Input - Exception to be copied.
77 */
78 EsysException &operator=(const EsysException &inException);
79 /**
80 \brief
81 Return the exception message in the form
82 &lt;Exception Name&gt;: &lt;Exception Message&gt;
83
84 @return the exception message.
85 */
86 std::string toString() const;
87 /**
88 \brief
89 Return the name of the exception. This is expected to be overloaded
90 in derived classes with the derived class name.
91
92 @return the name of the exception.
93 */
94 virtual std::string exceptionName() const;
95 /**
96 \brief
97 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
101 @return the ostrstream for the exception reason.
102 */
103 std::ostringstream& reason();
104 /**
105 \brief
106 Return a description of the exception in the same format as the toString
107 method.
108
109 @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 \brief
122 Stream insertion operator for EsysExceptions
123
124 @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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26