21 |
|
|
22 |
namespace esysUtils { |
namespace esysUtils { |
23 |
/** |
/** |
24 |
@memo |
\page esys_exception Esys Exceptions |
25 |
A base class for exception classes used within Esys system. |
A base class for exception classes used within Esys system. |
26 |
|
|
27 |
@version 1.0.0 |
\version 1.0.0 |
28 |
|
|
29 |
@doc |
\section class_desc Class Description: |
|
|
|
|
Class Description: |
|
30 |
A base class for exception classes used within Esys system. |
A base class for exception classes used within Esys system. |
31 |
|
|
32 |
Class Limitations: |
\section class_limits Class Limitations: |
33 |
None |
None |
34 |
|
|
35 |
Class Conditions of Use: |
\section class_conds Class Conditions of Use: |
36 |
None |
None |
37 |
|
|
38 |
Throws: |
\section throws Throws: |
39 |
None |
None |
40 |
|
|
41 |
*/ |
*/ |
42 |
class EsysException:public std::exception { |
class EsysException:public std::exception { |
43 |
public: |
public: |
44 |
/** |
/** |
45 |
@memo |
\brief |
46 |
Default Constructor. Creates an exception with no message. |
Default Constructor. Creates an exception with no message. |
47 |
*/ |
*/ |
48 |
EsysException(); |
EsysException(); |
49 |
/** |
/** |
50 |
@memo |
* \brief |
51 |
Constructor which creates a EsysException with the given message |
Constructor which creates a EsysException with the given message |
52 |
|
|
53 |
@param exceptionReason Input - Exception message. |
@param exceptionReason Input - Exception message. |
54 |
*/ |
*/ |
55 |
EsysException(const std::string &exceptionReason); |
EsysException(const std::string &exceptionReason); |
56 |
/** |
/** |
57 |
@memo |
* \brief |
58 |
Constructor which creates a EsysException with the given message |
Constructor which creates a EsysException with the given message |
59 |
|
|
60 |
@param cStr - Exception message. |
@param cStr - Exception message. |
61 |
*/ |
*/ |
62 |
EsysException( const char *cStr ); |
EsysException( const char *cStr ); |
63 |
/** |
/** |
64 |
@memo |
* \brief |
65 |
Copy constructor |
Copy constructor |
66 |
|
|
67 |
@param inException Input - EsysException |
@param inException Input - EsysException |
68 |
*/ |
*/ |
69 |
EsysException(const EsysException &inException); |
EsysException(const EsysException &inException); |
70 |
/// Destructor |
/// Destructor |
71 |
virtual ~EsysException() throw(); |
virtual ~EsysException() throw(); |
72 |
/** |
/** |
73 |
@memo |
\brief |
74 |
Assignment operator. |
Assignment operator. |
75 |
|
|
76 |
@param inException Input - Exception to be copied. |
@param inException Input - Exception to be copied. |
77 |
*/ |
*/ |
78 |
EsysException &operator=(const EsysException &inException); |
EsysException &operator=(const EsysException &inException); |
79 |
/** |
/** |
80 |
@memo |
\brief |
81 |
Return the exception message in the form |
Return the exception message in the form |
82 |
<Exception Name>: <Exception Message> |
<Exception Name>: <Exception Message> |
83 |
|
|
84 |
@return the exception message. |
@return the exception message. |
85 |
*/ |
*/ |
86 |
std::string toString() const; |
std::string toString() const; |
87 |
/** |
/** |
88 |
@memo |
\brief |
89 |
Return the name of the exception. This is expected to be overloaded |
Return the name of the exception. This is expected to be overloaded |
90 |
in derived classes with the derived class name. |
in derived classes with the derived class name. |
91 |
|
|
92 |
@return the name of the exception. |
@return the name of the exception. |
93 |
*/ |
*/ |
94 |
virtual std::string exceptionName() const; |
virtual std::string exceptionName() const; |
95 |
/** |
/** |
96 |
@memo |
\brief |
97 |
Return the ostrstream that contains the exception message. |
Return the ostrstream that contains the exception message. |
98 |
This is useful for entering or adding to the message as the stream |
This is useful for entering or adding to the message as the stream |
99 |
insertion operators can then be used. |
insertion operators can then be used. |
100 |
|
|
101 |
@return the ostrstream for the exception reason. |
@return the ostrstream for the exception reason. |
102 |
*/ |
*/ |
103 |
std::ostringstream& reason(); |
std::ostringstream& reason(); |
104 |
/** |
/** |
105 |
@memo |
\brief |
106 |
Return a description of the exception in the same format as the toString |
Return a description of the exception in the same format as the toString |
107 |
method. |
method. |
108 |
|
|
109 |
@return a description of the exception. |
@return a description of the exception. |
110 |
*/ |
*/ |
111 |
virtual const char* what() const throw(); |
virtual const char* what() const throw(); |
118 |
mutable std::string m_exceptionMessage; |
mutable std::string m_exceptionMessage; |
119 |
}; |
}; |
120 |
/** |
/** |
121 |
@memo |
\brief |
122 |
Stream insertion operator for EsysExceptions |
Stream insertion operator for EsysExceptions |
123 |
|
|
124 |
@param output Input - Output stream. |
@param output Input - Output stream. |
125 |
@param inException Input - The exception to be inserted into the output |
@param inException Input - The exception to be inserted into the output |
126 |
stream. |
stream. |