| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| <title>oscl_error_imp_cppexceptions.h Source File</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css"> |
| </head><body> |
| <!-- Generated by Doxygen 1.2.18 --> |
| <center> |
| <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> |
| <hr><h1>oscl_error_imp_cppexceptions.h</h1><a href="oscl__error__imp__cppexceptions_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> |
| 00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00003 |
| 00004 <span class="comment">// O S C L _ E R R O R _ I M P _ C P P E X C E P T I O N S</span> |
| 00005 |
| 00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00007 |
| 00018 <span class="preprocessor">#ifndef OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span> |
| 00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span> |
| 00020 <span class="preprocessor"></span> |
| 00021 <span class="preprocessor">#ifndef OSCL_ERROR_TRAPCLEANUP_H_INCLUDED</span> |
| 00022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__error__trapcleanup_8h.html">oscl_error_trapcleanup.h</a>"</span> |
| 00023 <span class="preprocessor">#endif</span> |
| 00024 <span class="preprocessor"></span> |
| 00025 <span class="comment">//Implementation file for Leave using C++ exceptions.</span> |
| 00026 |
| 00027 <span class="comment">//This is a full implementation of Leave.</span> |
| 00028 |
| <a name="l00029"></a><a class="code" href="classinternalLeave.html">00029</a> <span class="keyword">class </span><a class="code" href="classinternalLeave.html">internalLeave</a> |
| 00030 { |
| 00031 <span class="keyword">public</span>: |
| <a name="l00032"></a><a class="code" href="classinternalLeave.html#m0">00032</a> <span class="keywordtype">int</span> <a class="code" href="classinternalLeave.html#m0">a</a>; |
| 00033 }; |
| 00034 |
| 00035 <span class="comment">//Leave throws C++ exceptions.</span> |
| <a name="l00036"></a><a class="code" href="group__osclerror.html#a38">00036</a> <span class="preprocessor">#define PVError_DoLeave() internalLeave __ilv;__ilv.a=0;throw(__ilv)</span> |
| 00037 <span class="preprocessor"></span> |
| 00038 |
| 00039 <span class="comment">//_PV_TRAP catches Leaves.</span> |
| 00040 <span class="comment">//_r is the leave code, _s are statements to execute</span> |
| <a name="l00041"></a><a class="code" href="group__osclerror.html#a39">00041</a> <span class="preprocessor">#define _PV_TRAP(__r,__s)\</span> |
| 00042 <span class="preprocessor"> __r=OsclErrNone;\</span> |
| 00043 <span class="preprocessor"> {\</span> |
| 00044 <span class="preprocessor"> OsclErrorTrapImp* __tr=OsclErrorTrapImp::Trap();\</span> |
| 00045 <span class="preprocessor"> if(!__tr){__s;}else{\</span> |
| 00046 <span class="preprocessor"> try{__s;}\</span> |
| 00047 <span class="preprocessor"> catch(internalLeave __lv)\</span> |
| 00048 <span class="preprocessor"> {__lv.a=__r=__tr->iLeave;}\</span> |
| 00049 <span class="preprocessor"> __tr->UnTrap();}\</span> |
| 00050 <span class="preprocessor"> }</span> |
| 00051 <span class="preprocessor"></span> |
| 00052 <span class="comment">//_PV_TRAP_NO_TLS catches Leaves.</span> |
| 00053 <span class="comment">//_r is the leave code, _s are statements to execute</span> |
| <a name="l00054"></a><a class="code" href="group__osclerror.html#a40">00054</a> <span class="preprocessor">#define _PV_TRAP_NO_TLS(__trapimp,__r,__s)\</span> |
| 00055 <span class="preprocessor"> __r=OsclErrNone;\</span> |
| 00056 <span class="preprocessor"> {\</span> |
| 00057 <span class="preprocessor"> OsclErrorTrapImp* __tr=OsclErrorTrapImp::TrapNoTls(__trapimp);\</span> |
| 00058 <span class="preprocessor"> if(!__tr){__s;}else{\</span> |
| 00059 <span class="preprocessor"> try{__s;}\</span> |
| 00060 <span class="preprocessor"> catch(internalLeave __lv)\</span> |
| 00061 <span class="preprocessor"> {__lv.a=__r=__tr->iLeave;}\</span> |
| 00062 <span class="preprocessor"> __tr->UnTrap();}\</span> |
| 00063 <span class="preprocessor"> }</span> |
| 00064 <span class="preprocessor"></span> |
| 00065 |
| 00066 <span class="preprocessor">#endif // OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span> |
| 00067 <span class="preprocessor"></span> |
| </pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> |
| <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> |
| </small></address> |
| </body> |
| </html> |