ivd_Exception Class Reference
[Common, basic classes, functions and types]

#include <ivderror.h>

Inheritance diagram for ivd_Exception:

Inheritance graph
[legend]
Collaboration diagram for ivd_Exception:

Collaboration graph
[legend]

List of all members.


Detailed Description

Root exception class, used in IVD.

It defines basic architecture for exceptions. This class can not be thrown. Use this class in catch, when you want to catch all of the classes from the whole group.

Its derived classes provide additional functionality.

Derived classes define their own constructors and overload GetErrorText() to supply proper m_error to m_errorText translation.

Derived classes must call FormatText() member function to initialise the ivd_Exception::m_formatted member.

If a_logError == true is specified in construction, then an error log is generated (log_ERR_m). Otherwise, FormatText() function tries to get any useful information from stack and append it to the exception text.

An example of a derived class:


    class ivd_SpecialException : ivd_Exception {
    public:
        ivd_SpecialException(
            const int       a_ivdErr,
            const string    &a_context = "",
            bool            a_logError = false);

        virtual ~ivd_SpecialException();

    protected:
        virtual string GetErrorText();

    private:
        log_CLASSID_m;
    }

        ivd_SpecialException(
            const int       a_ivdErr,
            const string    &a_context = "",
            bool            a_logError = false);
    ivd_SpecialException::ivd_SpecialException(
        const int a_ivdErr, const string &a_context, bool a_logError)
        : ivd_Exception(a_ivdErr, a_context, false) {

        m_log = a_log_Error;
        FormatText(s_className);
        // Do some more processing if necessary.
    }

    string ivd_SpecialException::GetErrorText() {
        return ivd_GetSpecialErrorText(m_error);
    }

Note that constructor calls FormatText() with its class name as identifier and overloaded GetErrorText() member function, which provides a string representation of an error code (ivd_Exception::m_error member).

Author:
Matej Kenda, Hermes SoftLab
See also:
log_MARKLINE_m

log_Debugger::On()

ivd_SysError

ivd_Error

ivd_BaseException

Definition at line 111 of file ivderror.h.


Public Member Functions

virtual ~ivd_Exception () throw ()

Protected Member Functions

 ivd_Exception (const int a_err, const string &a_context, bool a_logError) throw ()
 ivd_Exception (const int a_err, const string &a_context, const string &a_detailed, bool a_logError) throw ()

Private Attributes

 log_CLASSID_m

Constructor & Destructor Documentation

virtual ivd_Exception::~ivd_Exception (  )  throw () [inline, virtual]

Definition at line 114 of file ivderror.h.

00114                                      {
00115         // Empty
00116     };

ivd_Exception::ivd_Exception ( const int  a_err,
const string &  a_context,
bool  a_logError 
) throw () [inline, protected]

Definition at line 119 of file ivderror.h.

00123         : 
00124         ivd_BaseException(a_err, a_context, a_logError) {
00125         // Empty
00126     };

ivd_Exception::ivd_Exception ( const int  a_err,
const string &  a_context,
const string &  a_detailed,
bool  a_logError 
) throw () [inline, protected]

Definition at line 128 of file ivderror.h.

00133         : 
00134         ivd_BaseException(a_err, a_context, a_detailed, a_logError) {
00135         // Empty
00136     };


Member Data Documentation

Reimplemented from ivd_BaseException.

Reimplemented in ivd_SysError, ivd_Error, ivd_DFError, and ivd_DBException.

Definition at line 136 of file ivderror.h.


The documentation for this class was generated from the following file:

Generated on Mon Feb 27 19:41:26 2012 for OPENARCHIVE by  doxygen 1.5.6