Public Member Functions | Protected Member Functions | Private Attributes

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

Root exception class, used in IVD. More...

#include <ivderror.h>

Inheritance diagram for ivd_Exception:
Inheritance graph
[legend]
Collaboration diagram for ivd_Exception:
Collaboration graph
[legend]

List of all members.

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

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 126 of file ivderror.h.


Constructor & Destructor Documentation

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

Definition at line 129 of file ivderror.h.

                                     {
        // Empty
    };

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

Definition at line 134 of file ivderror.h.

        :
        ivd_BaseException(a_err, a_context, a_logError) {
        // Empty
    };

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 143 of file ivderror.h.

        :
        ivd_BaseException(a_err, a_context, a_detailed, a_logError) {
        // Empty
    };


Member Data Documentation

Reimplemented from ivd_BaseException.

Reimplemented in ivd_SysError, ivd_Error, ivd_DFError, and ivd_DBException.

Definition at line 151 of file ivderror.h.


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