aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__defalloc_8h_source.html
blob: 92ea734d9733f5607ea901af9facface7fae10e1 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!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_defalloc.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_defalloc.h</h1><a href="oscl__defalloc_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 _ D E F A L L O C</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_DEFALLOC_H_INCLUDED</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_DEFALLOC_H_INCLUDED</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__base_8h.html" title="The file oscl_base.h is the public header that should be included to pick up the...">oscl_base.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><a class="code" href="group__osclbase.html#ga9fcc278d0a7a8d1c95f95c3bd7067994">00025</a> <span class="preprocessor">#define OSCL_DISABLE_WARNING_TRUNCATE_DEBUG_MESSAGE</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="osclconfig__compiler__warnings_8h.html" title="This file contains the ability to turn off/on compiler warnings.">osclconfig_compiler_warnings.h</a>&quot;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef OSCL_MEM_INST_H_INCLUDED</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__mem__inst_8h.html" title="The file defines default memory instrumentation level.">oscl_mem_inst.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="comment">//A macro for using the Oscl_Alloc or Oscl_DefAlloc call with file name and</span>
<a name="l00033"></a>00033 <span class="comment">//line number inputs to aid memory auditing.</span>
<a name="l00034"></a>00034 <span class="preprocessor">#if(PVMEM_INST_LEVEL&gt;0)</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define ALLOCATE(n) allocate_fl(n,__FILE__,__LINE__)</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00037"></a><a class="code" href="group__osclbase.html#ga9a6a685a04fb90ece237939b8d56780b">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define ALLOCATE(n) allocate(n)</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="comment">//A macro for using the Oscl_TAlloc call with file name and line number inputs</span>
<a name="l00041"></a>00041 <span class="comment">//to aid memory auditing.</span>
<a name="l00042"></a>00042 <span class="preprocessor">#if(PVMEM_INST_LEVEL&gt;0)</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define ALLOC_AND_CONSTRUCT(n) alloc_and_construct_fl(n,__FILE__,__LINE__)</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00045"></a><a class="code" href="group__osclbase.html#ga27169a7b4078321760bc56067f4d8669">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define ALLOC_AND_CONSTRUCT(n) alloc_and_construct(n)</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a><a class="code" href="classOscl__Alloc.html">00048</a> <span class="keyword">class </span><a class="code" href="classOscl__Alloc.html">Oscl_Alloc</a>
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050     <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="classOscl__Alloc.html#aab879a97b68e7e3d108df793474e346a">00051</a>         <span class="keyword">virtual</span> <a class="code" href="classOscl__Alloc.html#aab879a97b68e7e3d108df793474e346a">~Oscl_Alloc</a>() {}
<a name="l00052"></a>00052         <span class="keyword">virtual</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* <a class="code" href="classOscl__Alloc.html#a114adb53b0446f2dc8c2099b8b60ba07">allocate</a>(<span class="keyword">const</span> uint32 size) = 0;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054         <span class="comment">//Allocator with file name and line number inputs to aid memory auditing.</span>
<a name="l00055"></a>00055         <span class="comment">//This call should be used in cases where the allocation will invoke</span>
<a name="l00056"></a>00056         <span class="comment">//the Oscl memory manager.</span>
<a name="l00057"></a>00057         <span class="comment">//A default implementation is provided for use with allocators that don&#39;t</span>
<a name="l00058"></a>00058         <span class="comment">//invoke Oscl memory manager.</span>
<a name="l00059"></a><a class="code" href="classOscl__Alloc.html#af7b190ec84ceea395aace4f28eb5018c">00059</a>         <span class="keyword">virtual</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* <a class="code" href="classOscl__Alloc.html#af7b190ec84ceea395aace4f28eb5018c">allocate_fl</a>(<span class="keyword">const</span> uint32 size, <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num)
<a name="l00060"></a>00060         {
<a name="l00061"></a>00061             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(file_name);
<a name="l00062"></a>00062             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(line_num);
<a name="l00063"></a>00063             <span class="keywordflow">return</span> <a class="code" href="classOscl__Alloc.html#a114adb53b0446f2dc8c2099b8b60ba07">allocate</a>(size);
<a name="l00064"></a>00064         }
<a name="l00065"></a>00065 };
<a name="l00066"></a>00066 
<a name="l00067"></a><a class="code" href="classOscl__Dealloc.html">00067</a> <span class="keyword">class </span><a class="code" href="classOscl__Dealloc.html">Oscl_Dealloc</a>
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069     <span class="keyword">public</span>:
<a name="l00070"></a>00070         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOscl__Dealloc.html#a28d88b14d823ea6d6225d2bea76f87ae">deallocate</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* p) = 0;
<a name="l00071"></a><a class="code" href="classOscl__Dealloc.html#a5070d5843599728c7a08afc4037d6d4f">00071</a>         <span class="keyword">virtual</span> <a class="code" href="classOscl__Dealloc.html#a5070d5843599728c7a08afc4037d6d4f">~Oscl_Dealloc</a>() {}
<a name="l00072"></a>00072 };
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 
<a name="l00075"></a><a class="code" href="classOscl__DefAlloc.html">00075</a> <span class="keyword">class </span><a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> : <span class="keyword">public</span> <a class="code" href="classOscl__Alloc.html">Oscl_Alloc</a>, <span class="keyword">public</span> <a class="code" href="classOscl__Dealloc.html">Oscl_Dealloc</a>
<a name="l00076"></a>00076 {
<a name="l00077"></a>00077     <span class="keyword">public</span>:
<a name="l00078"></a>00078         <span class="keyword">virtual</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* <a class="code" href="classOscl__DefAlloc.html#a9ce71dcd2aa11b34e7d30a175fef42e0">allocate</a>(<span class="keyword">const</span> uint32 size) = 0;
<a name="l00079"></a>00079 
<a name="l00080"></a>00080         <span class="comment">//Allocator with file name and line number inputs to aid memory auditing.</span>
<a name="l00081"></a>00081         <span class="comment">//This call should be used in cases where the allocation will invoke</span>
<a name="l00082"></a>00082         <span class="comment">//the Oscl memory manager.</span>
<a name="l00083"></a>00083         <span class="comment">//A default implementation is provided for use with allocators that don&#39;t</span>
<a name="l00084"></a>00084         <span class="comment">//invoke Oscl memory manager.</span>
<a name="l00085"></a><a class="code" href="classOscl__DefAlloc.html#a71b1baadee2468c912d0f6336cf4e563">00085</a>         <span class="keyword">virtual</span> <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* <a class="code" href="classOscl__DefAlloc.html#a71b1baadee2468c912d0f6336cf4e563">allocate_fl</a>(<span class="keyword">const</span> uint32 size, <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num)
<a name="l00086"></a>00086         {
<a name="l00087"></a>00087             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(file_name);
<a name="l00088"></a>00088             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(line_num);
<a name="l00089"></a>00089             <span class="keywordflow">return</span> <a class="code" href="classOscl__DefAlloc.html#a9ce71dcd2aa11b34e7d30a175fef42e0">allocate</a>(size);
<a name="l00090"></a>00090         }
<a name="l00091"></a>00091         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOscl__DefAlloc.html#a517d6b431b966f79a745e73d1a0a438f">deallocate</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* p) = 0;
<a name="l00092"></a>00092 };
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 
<a name="l00095"></a><a class="code" href="classOsclDestructDealloc.html">00095</a> <span class="keyword">class </span><a class="code" href="classOsclDestructDealloc.html">OsclDestructDealloc</a>
<a name="l00096"></a>00096 {
<a name="l00097"></a>00097     <span class="keyword">public</span>:
<a name="l00098"></a><a class="code" href="classOsclDestructDealloc.html#a32afa57757dfcdb4195f62468780c7be">00098</a>         <span class="keyword">virtual</span> <a class="code" href="classOsclDestructDealloc.html#a32afa57757dfcdb4195f62468780c7be">~OsclDestructDealloc</a>() {}
<a name="l00099"></a>00099         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOsclDestructDealloc.html#ad7ceb70eb3012d71a588854d36ddedef">destruct_and_dealloc</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* ptr) = 0;
<a name="l00100"></a>00100 };
<a name="l00101"></a>00101 
<a name="l00102"></a><a class="code" href="classOsclAllocDestructDealloc.html">00102</a> <span class="keyword">class </span><a class="code" href="classOsclAllocDestructDealloc.html">OsclAllocDestructDealloc</a>
<a name="l00103"></a>00103         : <span class="keyword">public</span> <a class="code" href="classOsclDestructDealloc.html">OsclDestructDealloc</a>, <span class="keyword">public</span> <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a>
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105 
<a name="l00106"></a>00106     <span class="keyword">public</span>:
<a name="l00107"></a><a class="code" href="classOsclAllocDestructDealloc.html#ad141f2da8040f55779e271afd2f71576">00107</a>         <span class="keyword">virtual</span> <a class="code" href="classOsclAllocDestructDealloc.html#ad141f2da8040f55779e271afd2f71576">~OsclAllocDestructDealloc</a>() {};
<a name="l00108"></a>00108 };
<a name="l00109"></a>00109 
<a name="l00110"></a>00110 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T, <span class="keyword">class</span> Alloc&gt;
<a name="l00111"></a><a class="code" href="classOscl__TAlloc.html">00111</a> <span class="keyword">class </span><a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc</a> : <span class="keyword">public</span> <a class="code" href="classOsclDestructDealloc.html">OsclDestructDealloc</a>
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113     <span class="keyword">public</span>:
<a name="l00114"></a><a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">00114</a>         <span class="keyword">typedef</span> T           <a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">value_type</a>;
<a name="l00115"></a><a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">00115</a>         <span class="keyword">typedef</span> T           * <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>;
<a name="l00116"></a><a class="code" href="classOscl__TAlloc.html#a938a95b50ced39f0acdc201fc84d2a25">00116</a>         <span class="keyword">typedef</span> <span class="keyword">const</span> T     * <a class="code" href="classOscl__TAlloc.html#a938a95b50ced39f0acdc201fc84d2a25">const_pointer</a>;
<a name="l00117"></a><a class="code" href="classOscl__TAlloc.html#ae46cb2e079c378851fa3f8c83f72bb25">00117</a>         <span class="keyword">typedef</span> uint32      <a class="code" href="classOscl__TAlloc.html#ae46cb2e079c378851fa3f8c83f72bb25">size_type</a>;
<a name="l00118"></a><a class="code" href="classOscl__TAlloc.html#a3465b3eb3cdae480a121a3a3b0fae89b">00118</a>         <span class="keyword">typedef</span> T&amp;          <a class="code" href="classOscl__TAlloc.html#a3465b3eb3cdae480a121a3a3b0fae89b">reference</a>;
<a name="l00119"></a><a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">00119</a>         <span class="keyword">typedef</span> <span class="keyword">const</span> T&amp;    <a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">const_reference</a>;
<a name="l00120"></a>00120 
<a name="l00121"></a><a class="code" href="classOscl__TAlloc.html#a18d940245775daac1adc1c02b9a007a3">00121</a>         <span class="keyword">virtual</span> <a class="code" href="classOscl__TAlloc.html#a18d940245775daac1adc1c02b9a007a3">~Oscl_TAlloc</a>() {};
<a name="l00122"></a>00122 
<a name="l00123"></a>00123         <span class="comment">//this is the preferred call-- with file and line number recorded by</span>
<a name="l00124"></a>00124         <span class="comment">//the caller.  It can be invoked with the ALLOCATE macro.</span>
<a name="l00125"></a><a class="code" href="classOscl__TAlloc.html#a43d8385b7421fefc0e264da002b002cb">00125</a>         <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> <a class="code" href="classOscl__TAlloc.html#a43d8385b7421fefc0e264da002b002cb">allocate_fl</a>(uint32 size , <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num)
<a name="l00126"></a>00126         {
<a name="l00127"></a>00127             <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* tmp = alloc.allocate_fl(size * <span class="keyword">sizeof</span>(<a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">value_type</a>), file_name, line_num);
<a name="l00128"></a>00128             <span class="keywordflow">return</span> <a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp);
<a name="l00129"></a>00129         }
<a name="l00130"></a>00130 
<a name="l00131"></a><a class="code" href="classOscl__TAlloc.html#abd4d816b6b4c0cebc5e1bb32982c0483">00131</a>         <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> <a class="code" href="classOscl__TAlloc.html#abd4d816b6b4c0cebc5e1bb32982c0483">allocate</a>(uint32 size)
<a name="l00132"></a>00132         {
<a name="l00133"></a>00133             <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* tmp = alloc.allocate_fl(size * <span class="keyword">sizeof</span>(<a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">value_type</a>), <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>, 0);
<a name="l00134"></a>00134             <span class="keywordflow">return</span> <a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp);
<a name="l00135"></a>00135         }
<a name="l00136"></a>00136 
<a name="l00137"></a>00137         <span class="comment">//this is the preferred call-- with file and line number recorded by</span>
<a name="l00138"></a>00138         <span class="comment">//the caller.  It can be invoked by the ALLOC_AND_CONSTRUCT macro.</span>
<a name="l00139"></a><a class="code" href="classOscl__TAlloc.html#a80a1164f19c5607f69c7261cdf9b757f">00139</a>         <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> <a class="code" href="classOscl__TAlloc.html#a80a1164f19c5607f69c7261cdf9b757f">alloc_and_construct_fl</a>(<a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">const_reference</a> val, <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num)
<a name="l00140"></a>00140         {
<a name="l00141"></a>00141             <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* tmp = alloc.allocate_fl(<span class="keyword">sizeof</span>(<a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">value_type</a>), file_name, line_num);
<a name="l00142"></a>00142             <a class="code" href="classOscl__TAlloc.html#a1ec0e8cf3d2f5f516956d842a34717b4">construct</a>(<a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp), val);
<a name="l00143"></a>00143             <span class="keywordflow">return</span> <a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp);
<a name="l00144"></a>00144         }
<a name="l00145"></a>00145 
<a name="l00146"></a><a class="code" href="classOscl__TAlloc.html#ab3060080d948f0605ee92faa1e37c7a2">00146</a>         <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> <a class="code" href="classOscl__TAlloc.html#ab3060080d948f0605ee92faa1e37c7a2">alloc_and_construct</a>(<a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">const_reference</a> val)
<a name="l00147"></a>00147         {
<a name="l00148"></a>00148             <span class="comment">//note: recording file &amp; line # here is not useful-- the caller</span>
<a name="l00149"></a>00149             <span class="comment">//should provide them.  Just pass zero to aid debugging.</span>
<a name="l00150"></a>00150             <a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* tmp = alloc.allocate_fl(<span class="keyword">sizeof</span>(<a class="code" href="classOscl__TAlloc.html#a2f62eb46419136b4b44b944dba0296de">value_type</a>), <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>, 0);
<a name="l00151"></a>00151             <a class="code" href="classOscl__TAlloc.html#a1ec0e8cf3d2f5f516956d842a34717b4">construct</a>(<a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp), val);
<a name="l00152"></a>00152             <span class="keywordflow">return</span> <a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, tmp);
<a name="l00153"></a>00153         }
<a name="l00154"></a>00154 
<a name="l00155"></a><a class="code" href="classOscl__TAlloc.html#aad556619cdcb4169d32df057fa4bce93">00155</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__TAlloc.html#aad556619cdcb4169d32df057fa4bce93">deallocate</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* p)
<a name="l00156"></a>00156         {
<a name="l00157"></a>00157             alloc.deallocate(p);
<a name="l00158"></a>00158         }
<a name="l00159"></a>00159 
<a name="l00160"></a><a class="code" href="classOscl__TAlloc.html#a4cc545b20c4bfa04a6fda602c1b85cda">00160</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__TAlloc.html#aad556619cdcb4169d32df057fa4bce93">deallocate</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* p, <a class="code" href="classOscl__TAlloc.html#ae46cb2e079c378851fa3f8c83f72bb25">size_type</a> n)
<a name="l00161"></a>00161         {
<a name="l00162"></a>00162             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(n);
<a name="l00163"></a>00163             alloc.deallocate(p);
<a name="l00164"></a>00164         }
<a name="l00165"></a>00165 
<a name="l00166"></a><a class="code" href="classOscl__TAlloc.html#a912532ea50bb41ffa9470f1d0213d436">00166</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__TAlloc.html#a912532ea50bb41ffa9470f1d0213d436">destruct_and_dealloc</a>(<a class="code" href="group__osclbase.html#ga3bac54662348f5e6c08b97ca97066b89" title="The OsclAny is meant to be used the context of a generic pointer (i.e., no specific...">OsclAny</a>* p)
<a name="l00167"></a>00167         {
<a name="l00168"></a>00168             <a class="code" href="classOscl__TAlloc.html#a049f986a2405e892c4bcc0cefdff1cfc">destroy</a>(<a class="code" href="group__osclbase.html#ga6872259ca6fd7080c6299210e4b13a6f">OSCL_STATIC_CAST</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a>, p));
<a name="l00169"></a>00169             <a class="code" href="classOscl__TAlloc.html#aad556619cdcb4169d32df057fa4bce93">deallocate</a>(p);
<a name="l00170"></a>00170         }
<a name="l00171"></a>00171 
<a name="l00172"></a><a class="code" href="classOscl__TAlloc.html#a616161b21a85ca8b790a427e7d2eb1db">00172</a>         <a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> <a class="code" href="classOscl__TAlloc.html#a616161b21a85ca8b790a427e7d2eb1db">address</a>(<a class="code" href="classOscl__TAlloc.html#a3465b3eb3cdae480a121a3a3b0fae89b">reference</a> r)
<a name="l00173"></a>00173         {
<a name="l00174"></a>00174             <span class="keywordflow">return</span> &amp;r;
<a name="l00175"></a>00175         }
<a name="l00176"></a><a class="code" href="classOscl__TAlloc.html#acd4f3f1c56355ab65b1a94ef11a78cc0">00176</a>         <a class="code" href="classOscl__TAlloc.html#a938a95b50ced39f0acdc201fc84d2a25">const_pointer</a> <a class="code" href="classOscl__TAlloc.html#a616161b21a85ca8b790a427e7d2eb1db">address</a>(<a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">const_reference</a> r)<span class="keyword"> const</span>
<a name="l00177"></a>00177 <span class="keyword">        </span>{
<a name="l00178"></a>00178             <span class="keywordflow">return</span> &amp;r;
<a name="l00179"></a>00179         }
<a name="l00180"></a>00180 
<a name="l00181"></a><a class="code" href="classOscl__TAlloc.html#a1ec0e8cf3d2f5f516956d842a34717b4">00181</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__TAlloc.html#a1ec0e8cf3d2f5f516956d842a34717b4">construct</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> p, <a class="code" href="classOscl__TAlloc.html#ae1334db60f6951616080d3d48e4aa1a4">const_reference</a> val)
<a name="l00182"></a>00182         {
<a name="l00183"></a>00183             <span class="keyword">new</span>(p) T(val);
<a name="l00184"></a>00184         }
<a name="l00185"></a><a class="code" href="classOscl__TAlloc.html#a049f986a2405e892c4bcc0cefdff1cfc">00185</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__TAlloc.html#a049f986a2405e892c4bcc0cefdff1cfc">destroy</a>(<a class="code" href="classOscl__TAlloc.html#a5a93f2ccf0844ecf76e7da85bb9eaff0">pointer</a> p)
<a name="l00186"></a>00186         {
<a name="l00187"></a>00187             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(p);
<a name="l00188"></a>00188             p-&gt;~T();
<a name="l00189"></a>00189         }
<a name="l00190"></a>00190 
<a name="l00191"></a>00191         <span class="keyword">template</span> &lt;<span class="keyword">class</span> U, <span class="keyword">class</span> V&gt;
<a name="l00192"></a><a class="code" href="structOscl__TAlloc_1_1rebind.html">00192</a>         <span class="keyword">struct </span><a class="code" href="structOscl__TAlloc_1_1rebind.html">rebind</a>
<a name="l00193"></a>00193         {
<a name="l00194"></a><a class="code" href="structOscl__TAlloc_1_1rebind.html#aff9f7d67a2650c68f6143c8df792e1de">00194</a>             <span class="keyword">typedef</span> <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc&lt;U, V&gt;</a> <a class="code" href="classOscl__TAlloc.html">other</a>;
<a name="l00195"></a>00195         };
<a name="l00196"></a>00196 
<a name="l00197"></a>00197     <span class="keyword">private</span>:
<a name="l00198"></a>00198         Alloc alloc;
<a name="l00199"></a>00199 };
<a name="l00200"></a>00200 
<a name="l00201"></a>00201 
<a name="l00204"></a>00204 <span class="preprocessor">#endif</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>