Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# oscl_exception.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //                     O S C L _ E X C E P T I O N
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00019 #ifndef OSCL_EXCEPTION_H_INCLUDED
    00020 #define OSCL_EXCEPTION_H_INCLUDED
    00021
    00022 // - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    00023
    00024 #ifndef OSCL_ERROR_H_INCLUDED
    00025 #include "oscl_error.h"
    00026 #endif
    00027
    00028 #ifndef OSCL_ERROR_IMP_H_INCLUDED
    00029 #include "oscl_error_imp.h"
    00030 #endif
    00031
    00032
    00033 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    00034
    00036
    00037
    00039
    00046 template <int LeaveCode> class OsclException
    00047 {
    00048     public:
    00049         OsclException() {}
    00050         static int getLeaveCode()
    00051         {
    00052             return LeaveCode;
    00053         };
    00054 };
    00055
    00056
    00058
    00062 #define OSCL_LEAVE(_leave_status) OsclError::Leave(_leave_status)
    00063
    00064
    00066
    00076 #define OSCL_TRY(_leave_status,_statements) _PV_TRAP(_leave_status,_statements)
    00077 //Same as above, but avoids the TLS lookup.
    00078 // param __trampimp is the OsclErrorTrapImp* for the current thread.
    00079 #define OSCL_TRY_NO_TLS(__trapimp,_leave_status,_statements) _PV_TRAP_NO_TLS(__trapimp,_leave_status,_statements)
    00080
    00082
    00084
    00090 #define OSCL_FIRST_CATCH_ANY(_leave_status, _statements) \
    00091    if (_leave_status!=OsclErrNone) { _statements; }
    00092
    00094
    00099 #define OSCL_FIRST_CATCH( _leave_status, _catch_value, _statements) \
    00100     if (_leave_status!=OsclErrNone && _leave_status == _catch_value){_statements;}
    00101
    00103
    00110 #define OSCL_CATCH( _leave_status, _catch_value, _statements) \
    00111     else if (_leave_status!=OsclErrNone && _leave_status == _catch_value){_statements;}
    00112
    00114
    00120 #define OSCL_CATCH_ANY(_leave_status,_statements) \
    00121     else if (_leave_status!=OsclErrNone){ _statements;}
    00122
    00124
    00130 #define OSCL_LAST_CATCH(_leave_status) \
    00131     else if (_leave_status!=OsclErrNone){OSCL_LEAVE(_leave_status);}
    00132
    00133
    00134 #endif // INCLUDED_OSCL_EXCEPTION_H
    00135
    00136
    00137