#include <OWBI1_Exception.hpp>
Inheritance diagram for OWBI1::Exception:
Public Member Functions | |
virtual const char * | type () const |
Returns a string representing the concrete type. | |
virtual const char * | getMessage () const |
Returns the message. | |
const char * | getFile () const |
Returns the file. | |
int | getLine () const |
int | getSubClassId () const |
const Exception * | getSubException () const |
Returns the sub exception if available, otherwise 0. | |
int | getErrorCode () const |
Returns the error code representing the error which occurred. | |
virtual const char * | what () const throw () |
Returns getMessage(). | |
virtual Exception * | clone () const |
Make a copy of this exception object. | |
char * | dupString (const char *str) |
Utility function to copy a string. | |
Static Public Attributes | |
static const int | UNKNOWN_SUBCLASS_ID = -1 |
static const int | UNKNOWN_ERROR_CODE = -1 |
Protected Member Functions | |
Exception (const char *file, int line, const char *msg, int errorCode, const Exception *otherException=0, int subClassId=UNKNOWN_SUBCLASS_ID) | |
Exception (const Exception &e) | |
Exception & | operator= (const Exception &rhs) |
void | swap (Exception &x) |
virtual | ~Exception () throw () |
void | setSubClassId (int subClassId) |
void | setErrorCode (int errorCode) |
Private Attributes | |
char * | m_file |
int | m_line |
char * | m_msg |
int | m_subClassId |
const Exception * | m_subException |
int | m_errorCode |
It cannot be constructed directly, only subclasses can be instantiated.
Creating a correct subclass is facilitated by the macros defined in this file.
Exceptions should be thrown by using one of the OWBI1_THROWBI1_* macros which inserts the file and line number among other helpful things.
Definition at line 60 of file OWBI1_Exception.hpp.
|
Definition at line 85 of file OWBI1_Exception.cpp. References m_mutex, and OW_NAMESPACE::StackTrace::printStackTrace(). Referenced by clone(), and operator=(). |
|
Definition at line 102 of file OWBI1_Exception.cpp. References m_mutex. |
|
Definition at line 116 of file OWBI1_Exception.cpp. References OWBI1::freeBuf(), m_file, m_msg, m_mutex, and m_subException. |
|
Make a copy of this exception object. If allocation fails, return 0. Subclasses need to override this function. This function must not throw. Here is an example of how to implement this in a derived class: virtual DerivedException* clone() const { return new(std::nothrow) DerivedException(*this); } Reimplemented in OWBI1::CIMException, OWBI1::OutOfBoundsException, OWBI1::DateTimeException, OWBI1::EnumerationException, OWBI1::LoggerException, OWBI1::NoSuchPropertyException, OWBI1::NoSuchQualifierException, OWBI1::NULLValueException, OWBI1::ContextDataNotFoundException, OWBI1::StringConversionException, and OWBI1::TypeMismatchException. Definition at line 241 of file OWBI1_Exception.cpp. References Exception(). |
|
Utility function to copy a string. This function will not throw--if allocation fails, 0 is returned. The result must be free[]'d. if str == 0, 0 is returned. TODO: This function doesn't really belong on this class, but so far only this class and subclasses have a use for it. Definition at line 70 of file OWBI1_Exception.cpp. |
|
Returns the error code representing the error which occurred. Code are unique only in the scope of the derived exception class. May return UNKNONWN_ERROR_CODE if the error is unavailable. Definition at line 255 of file OWBI1_Exception.cpp. References m_errorCode. |
|
Returns the file. May return 0. Definition at line 174 of file OWBI1_Exception.cpp. References m_file. Referenced by OWBI1::operator<<(). |
|
Definition at line 161 of file OWBI1_Exception.cpp. References m_line. |
|
Returns the message. May return 0. This function will not throw. Derived class implementations must not throw. Definition at line 168 of file OWBI1_Exception.cpp. References m_msg. Referenced by what(). |
|
Definition at line 227 of file OWBI1_Exception.cpp. References m_subClassId. |
|
Returns the sub exception if available, otherwise 0.
Definition at line 248 of file OWBI1_Exception.cpp. References m_subException. |
|
Definition at line 134 of file OWBI1_Exception.cpp. References Exception(). |
|
Definition at line 262 of file OWBI1_Exception.cpp. References m_errorCode. |
|
Definition at line 234 of file OWBI1_Exception.cpp. References m_subClassId. |
|
Definition at line 141 of file OWBI1_Exception.cpp. References m_errorCode, m_file, m_line, m_msg, m_subClassId, m_subException, and OW_NAMESPACE::swap(). |
|
Returns a string representing the concrete type. e.g. "SocketException". Will not return 0. This function will not throw. Derived class implementations must not throw. Reimplemented in OWBI1::CIMException, OWBI1::OutOfBoundsException, OWBI1::DateTimeException, OWBI1::EnumerationException, OWBI1::LoggerException, OWBI1::NoSuchPropertyException, OWBI1::NoSuchQualifierException, OWBI1::NULLValueException, OWBI1::ContextDataNotFoundException, OWBI1::StringConversionException, and OWBI1::TypeMismatchException. Definition at line 154 of file OWBI1_Exception.cpp. |
|
Returns getMessage().
Definition at line 220 of file OWBI1_Exception.cpp. References getMessage(). |
|
Definition at line 161 of file OWBI1_Exception.hpp. Referenced by getErrorCode(), setErrorCode(), and swap(). |
|
Definition at line 156 of file OWBI1_Exception.hpp. Referenced by getFile(), swap(), and ~Exception(). |
|
Definition at line 157 of file OWBI1_Exception.hpp. |
|
Definition at line 158 of file OWBI1_Exception.hpp. Referenced by getMessage(), swap(), and ~Exception(). |
|
Definition at line 159 of file OWBI1_Exception.hpp. Referenced by getSubClassId(), setSubClassId(), and swap(). |
|
Definition at line 160 of file OWBI1_Exception.hpp. Referenced by getSubException(), swap(), and ~Exception(). |
|
Definition at line 100 of file OWBI1_Exception.hpp. |
|
Definition at line 99 of file OWBI1_Exception.hpp. |