aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__error__imp__cppexceptions_8h_source.html
blob: 97afadf5e97c08664d4e08e3b9124e2dcafa7e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>oscl: oscl_error_imp_cppexceptions.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<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 class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- c++ -*-</span>
<a name="l00002"></a>00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00003"></a>00003 
<a name="l00004"></a>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>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00007"></a>00007 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef OSCL_ERROR_TRAPCLEANUP_H_INCLUDED</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__error__trapcleanup_8h.html" title="OSCL Error trap and cleanup implementation include file.">oscl_error_trapcleanup.h</a>&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#endif</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="comment">//Implementation file for Leave using C++ exceptions.</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="comment">//This is a full implementation of Leave.</span>
<a name="l00028"></a>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>
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031     <span class="keyword">public</span>:
<a name="l00032"></a><a class="code" href="classinternalLeave.html#ad4d78d9e309fe59183629be25d9cafe6">00032</a>         <span class="keywordtype">int</span> <a class="code" href="classinternalLeave.html#ad4d78d9e309fe59183629be25d9cafe6">a</a>;
<a name="l00033"></a>00033 };
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="comment">//Leave throws C++ exceptions.</span>
<a name="l00036"></a><a class="code" href="group__osclerror.html#ga6905eff15f5430b4131a7d83c82f049d">00036</a> <span class="preprocessor">#define PVError_DoLeave() internalLeave __ilv;__ilv.a=0;throw(__ilv)</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="comment">//_PV_TRAP catches Leaves.</span>
<a name="l00040"></a>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#ga04851440465e223d0f2710135ea661a4">00041</a> <span class="preprocessor">#define _PV_TRAP(__r,__s)\</span>
<a name="l00042"></a>00042 <span class="preprocessor">    __r=OsclErrNone;\</span>
<a name="l00043"></a>00043 <span class="preprocessor">    {\</span>
<a name="l00044"></a>00044 <span class="preprocessor">        OsclErrorTrapImp* __tr=OsclErrorTrapImp::Trap();\</span>
<a name="l00045"></a>00045 <span class="preprocessor">        if(!__tr){__s;}else{\</span>
<a name="l00046"></a>00046 <span class="preprocessor">        try{__s;}\</span>
<a name="l00047"></a>00047 <span class="preprocessor">        catch(internalLeave __lv)\</span>
<a name="l00048"></a>00048 <span class="preprocessor">        {__lv.a=__r=__tr-&gt;iLeave;}\</span>
<a name="l00049"></a>00049 <span class="preprocessor">        __tr-&gt;UnTrap();}\</span>
<a name="l00050"></a>00050 <span class="preprocessor">    }</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span>
<a name="l00052"></a>00052 <span class="comment">//_PV_TRAP_NO_TLS catches Leaves.</span>
<a name="l00053"></a>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#gae93e1c9a624029fa749b929f9c9c9158">00054</a> <span class="preprocessor">#define _PV_TRAP_NO_TLS(__trapimp,__r,__s)\</span>
<a name="l00055"></a>00055 <span class="preprocessor">    __r=OsclErrNone;\</span>
<a name="l00056"></a>00056 <span class="preprocessor">    {\</span>
<a name="l00057"></a>00057 <span class="preprocessor">        OsclErrorTrapImp* __tr=OsclErrorTrapImp::TrapNoTls(__trapimp);\</span>
<a name="l00058"></a>00058 <span class="preprocessor">        if(!__tr){__s;}else{\</span>
<a name="l00059"></a>00059 <span class="preprocessor">        try{__s;}\</span>
<a name="l00060"></a>00060 <span class="preprocessor">        catch(internalLeave __lv)\</span>
<a name="l00061"></a>00061 <span class="preprocessor">        {__lv.a=__r=__tr-&gt;iLeave;}\</span>
<a name="l00062"></a>00062 <span class="preprocessor">        __tr-&gt;UnTrap();}\</span>
<a name="l00063"></a>00063 <span class="preprocessor">    }</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="preprocessor">#endif // OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: CORE_9.004.1.1 </small>
</small></address>
</body>
</html>