aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__queue_8h_source.html
blob: a91d3d23d9d77bb719d77376a468c1b405becf30 (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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!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_queue.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_queue.h</h1><a href="oscl__queue_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 
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="comment">//                     O S C L _ Q U E U E</span>
<a name="l00008"></a>00008 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
<a name="l00009"></a>00009 
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef OSCL_QUEUE_H_INCLUDED</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_QUEUE_H_INCLUDED</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
<a name="l00028"></a>00028 <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="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef OSCL_MEM_BASIC_FUNCTIONS_H_INCLUDED</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__mem__basic__functions_8h.html" title="This file contains prototypes for the basic memory functions.">oscl_mem_basic_functions.h</a>&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#endif</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef OSCL_ASSERT_H_INCLUDED</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__assert_8h.html" title="The file oscl_assert.h provides an OSCL_ASSERT macro to document assumptions and...">oscl_assert.h</a>&quot;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="preprocessor">#ifndef OSCL_OPAQUE_TYPE_H_INCLUDED</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__opaque__type_8h.html" title="The file oscl_opaque_type.h defines pure virtual classes for working with opaque...">oscl_opaque_type.h</a>&quot;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#endif</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00050"></a><a class="code" href="classOscl__Queue__Base.html">00050</a> <span class="keyword">class </span><a class="code" href="classOscl__Queue__Base.html">Oscl_Queue_Base</a>
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052     <span class="keyword">public</span>:
<a name="l00053"></a>00053 
<a name="l00057"></a><a class="code" href="classOscl__Queue__Base.html#a141d62496dd666b5564df7309f93c0bd">00057</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a141d62496dd666b5564df7309f93c0bd">size</a>()<span class="keyword"> const</span>
<a name="l00058"></a>00058 <span class="keyword">        </span>{
<a name="l00059"></a>00059             <span class="keywordflow">return</span> <a class="code" href="classOscl__Queue__Base.html#a5c38337e982f92e4b110897379cff0b1">numelems</a>;
<a name="l00060"></a>00060         }
<a name="l00061"></a>00061 
<a name="l00065"></a><a class="code" href="classOscl__Queue__Base.html#a2093ab0a4af2108fbd89452f20f69b30">00065</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a2093ab0a4af2108fbd89452f20f69b30">capacity</a>()<span class="keyword"> const</span>
<a name="l00066"></a>00066 <span class="keyword">        </span>{
<a name="l00067"></a>00067             <span class="keywordflow">return</span> <a class="code" href="classOscl__Queue__Base.html#a121a59865eabcd305e3e3c9c15fceea1">bufsize</a>;
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 
<a name="l00073"></a><a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">00073</a>         <span class="keywordtype">bool</span> <a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">empty</a>()<span class="keyword"> const</span>
<a name="l00074"></a>00074 <span class="keyword">        </span>{
<a name="l00075"></a>00075             <span class="keywordflow">return</span> <a class="code" href="classOscl__Queue__Base.html#a5c38337e982f92e4b110897379cff0b1">numelems</a> == 0;
<a name="l00076"></a>00076         }
<a name="l00077"></a>00077 
<a name="l00086"></a>00086         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#a8cbc2d495e7951447ed31321dd903b68">reserve</a>(uint32 n) ;
<a name="l00087"></a>00087 
<a name="l00088"></a>00088     <span class="keyword">protected</span>:
<a name="l00089"></a>00089 
<a name="l00090"></a>00090         <span class="comment">//for use in default constructor.  vtable is needed so this is a subroutine.</span>
<a name="l00091"></a>00091         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#a9bbfcb0742133b3dcaea1223fa8f69ae">construct</a>(<a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>* aType);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093         <span class="comment">//for use in constructor with pre-allocation for &quot;n&quot; elements.</span>
<a name="l00094"></a>00094         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#a9bbfcb0742133b3dcaea1223fa8f69ae">construct</a>(<a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>* aType, uint32 n) ;
<a name="l00095"></a>00095 
<a name="l00099"></a><a class="code" href="classOscl__Queue__Base.html#ac8eda6385aa63e9e8f943652bd976a3b">00099</a>         <span class="keyword">virtual</span> <a class="code" href="classOscl__Queue__Base.html#ac8eda6385aa63e9e8f943652bd976a3b">~Oscl_Queue_Base</a>()
<a name="l00100"></a>00100         {}
<a name="l00101"></a>00101 
<a name="l00105"></a>00105         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#a26f7b83b07bf6684572fb04dfe87d1ec">destroy</a>();
<a name="l00106"></a>00106 
<a name="l00112"></a>00112         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#ad12a167fce8b217fb459febc34d07160">push</a>(<span class="keyword">const</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>* x) ;
<a name="l00113"></a>00113 
<a name="l00117"></a>00117         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#ad7c894370a1def12ff526342a08c77a4">pop</a>() ;
<a name="l00118"></a>00118 
<a name="l00122"></a>00122         <a class="code" href="osclconfig_8h.html#a6de0f53c5c11f8f53ce72c70d74d9abc">OSCL_IMPORT_REF</a> <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#ad2f7a83415c0297e17f02bf96875e570">clear</a>() ;
<a name="l00123"></a>00123 
<a name="l00124"></a><a class="code" href="classOscl__Queue__Base.html#a5c38337e982f92e4b110897379cff0b1">00124</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a5c38337e982f92e4b110897379cff0b1">numelems</a>;  <span class="comment">// number of valid entries in queue</span>
<a name="l00125"></a><a class="code" href="classOscl__Queue__Base.html#a121a59865eabcd305e3e3c9c15fceea1">00125</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a121a59865eabcd305e3e3c9c15fceea1">bufsize</a>;   <span class="comment">// size of elems</span>
<a name="l00126"></a><a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">00126</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>* <a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>;   <span class="comment">// array holding the elements</span>
<a name="l00127"></a><a class="code" href="classOscl__Queue__Base.html#af52be910a2af53ad269a5aa768d36ce9">00127</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#af52be910a2af53ad269a5aa768d36ce9">sizeof_T</a>;
<a name="l00128"></a>00128 
<a name="l00129"></a><a class="code" href="classOscl__Queue__Base.html#a7becc95f947716715eccea27fdb53cd8">00129</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a7becc95f947716715eccea27fdb53cd8">ifront</a>;    <span class="comment">// front of queue: removal point</span>
<a name="l00130"></a><a class="code" href="classOscl__Queue__Base.html#a7d836f28a382837bffe2e89cf17ff60e">00130</a>         uint32 <a class="code" href="classOscl__Queue__Base.html#a7d836f28a382837bffe2e89cf17ff60e">irear</a>;     <span class="comment">// just before back of queue: increment=&gt;insertion point</span>
<a name="l00131"></a>00131 
<a name="l00132"></a>00132     <span class="keyword">private</span>:
<a name="l00133"></a>00133 
<a name="l00137"></a>00137         <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>* increment_T(<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_T, int32 n)<span class="keyword"> const</span>
<a name="l00138"></a>00138 <span class="keyword">        </span>{
<a name="l00139"></a>00139             <span class="keywordflow">return</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>*)((int32)p_T + n*<a class="code" href="classOscl__Queue__Base.html#af52be910a2af53ad269a5aa768d36ce9">sizeof_T</a>);
<a name="l00140"></a>00140         }
<a name="l00141"></a>00141 
<a name="l00145"></a>00145         <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>* front()
<a name="l00146"></a>00146         {
<a name="l00147"></a>00147             <span class="keywordflow">return</span> increment_T(<a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>, <a class="code" href="classOscl__Queue__Base.html#a7becc95f947716715eccea27fdb53cd8">ifront</a>);
<a name="l00148"></a>00148         }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150         <a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>* pOpaqueType;
<a name="l00151"></a>00151 };
<a name="l00152"></a>00152 
<a name="l00165"></a>00165 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T, <span class="keyword">class</span> Alloc&gt;
<a name="l00166"></a><a class="code" href="classOscl__Queue.html">00166</a> <span class="keyword">class </span><a class="code" href="classOscl__Queue.html">Oscl_Queue</a>
<a name="l00167"></a>00167         : <span class="keyword">public</span> <a class="code" href="classOscl__Queue__Base.html">Oscl_Queue_Base</a>
<a name="l00168"></a>00168         , <span class="keyword">public</span> <a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170 
<a name="l00171"></a>00171     <span class="keyword">public</span>:
<a name="l00172"></a><a class="code" href="classOscl__Queue.html#a865a97f0dfc2fab26ddc0e702aff894b">00172</a>         <span class="keyword">typedef</span> T <a class="code" href="classOscl__Queue.html#a865a97f0dfc2fab26ddc0e702aff894b">value_type</a>;
<a name="l00173"></a><a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">00173</a>         <span class="keyword">typedef</span> T* <a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>;
<a name="l00174"></a><a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">00174</a>         <span class="keyword">typedef</span> T&amp; <a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">reference</a>;
<a name="l00175"></a><a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">00175</a>         <span class="keyword">typedef</span> <span class="keyword">const</span> T&amp; <a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">const_reference</a>;
<a name="l00176"></a><a class="code" href="classOscl__Queue.html#a82ee42790ecc39fa4fe14561ad831e89">00176</a>         <span class="keyword">typedef</span> uint32 <a class="code" href="classOscl__Queue.html#a82ee42790ecc39fa4fe14561ad831e89">size_type</a>;
<a name="l00177"></a>00177 
<a name="l00181"></a><a class="code" href="classOscl__Queue.html#a9f7232cb455ff9b7d2550276b368df3f">00181</a>         <a class="code" href="classOscl__Queue.html#a9f7232cb455ff9b7d2550276b368df3f">Oscl_Queue</a>() : <a class="code" href="classOscl__Queue__Base.html">Oscl_Queue_Base</a>(), <a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>()
<a name="l00182"></a>00182         {
<a name="l00183"></a>00183             <a class="code" href="classOscl__Queue__Base.html#af52be910a2af53ad269a5aa768d36ce9">sizeof_T</a> = <span class="keyword">sizeof</span>(T);
<a name="l00184"></a>00184             <a class="code" href="classOscl__Queue__Base.html#a9bbfcb0742133b3dcaea1223fa8f69ae">Oscl_Queue_Base::construct</a>(<span class="keyword">this</span>);
<a name="l00185"></a>00185         }
<a name="l00186"></a>00186 
<a name="l00194"></a><a class="code" href="classOscl__Queue.html#aae645f2fdaf55e67b8d43d6b6197bf4c">00194</a>         <a class="code" href="classOscl__Queue.html#a9f7232cb455ff9b7d2550276b368df3f">Oscl_Queue</a>(uint32 n) : <a class="code" href="classOscl__Queue__Base.html">Oscl_Queue_Base</a>(), <a class="code" href="classOscl__Opaque__Type__Alloc.html">Oscl_Opaque_Type_Alloc</a>()
<a name="l00195"></a>00195         {
<a name="l00196"></a>00196             <a class="code" href="classOscl__Queue__Base.html#af52be910a2af53ad269a5aa768d36ce9">sizeof_T</a> = <span class="keyword">sizeof</span>(T);
<a name="l00197"></a>00197             <a class="code" href="classOscl__Queue__Base.html#a9bbfcb0742133b3dcaea1223fa8f69ae">Oscl_Queue_Base::construct</a>(<span class="keyword">this</span>, n);
<a name="l00198"></a>00198         }
<a name="l00199"></a>00199 
<a name="l00203"></a><a class="code" href="classOscl__Queue.html#a0cdb871b1b0911b9d8abb37c1b8501f4">00203</a>         <span class="keyword">virtual</span> <a class="code" href="classOscl__Queue.html#a0cdb871b1b0911b9d8abb37c1b8501f4">~Oscl_Queue</a>()
<a name="l00204"></a>00204         {
<a name="l00205"></a>00205             <a class="code" href="classOscl__Queue__Base.html#a26f7b83b07bf6684572fb04dfe87d1ec">Oscl_Queue_Base::destroy</a>();
<a name="l00206"></a>00206         }
<a name="l00207"></a>00207 
<a name="l00213"></a><a class="code" href="classOscl__Queue.html#ac72cf768ba6d5d695f20378f9b05ff71">00213</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue.html#ac72cf768ba6d5d695f20378f9b05ff71">push</a>(<span class="keyword">const</span> T&amp; x)
<a name="l00214"></a>00214         {
<a name="l00215"></a>00215             <a class="code" href="classOscl__Queue.html#ac72cf768ba6d5d695f20378f9b05ff71">Oscl_Queue_Base::push</a>(&amp;x);
<a name="l00216"></a>00216         }
<a name="l00217"></a>00217 
<a name="l00221"></a><a class="code" href="classOscl__Queue.html#a5bcc41e4bea1546281a2fa668d507960">00221</a>         <a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">reference</a> <a class="code" href="classOscl__Queue.html#a5bcc41e4bea1546281a2fa668d507960">front</a>()
<a name="l00222"></a>00222         {
<a name="l00223"></a>00223             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(! <a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">empty</a>());
<a name="l00224"></a>00224             <span class="keywordflow">return</span> (<a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">reference</a>)((<a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>)<a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>)[<a class="code" href="classOscl__Queue__Base.html#a7becc95f947716715eccea27fdb53cd8">ifront</a>];
<a name="l00225"></a>00225         }
<a name="l00226"></a>00226 
<a name="l00230"></a><a class="code" href="classOscl__Queue.html#a5b679075208f089b06cbf4cf2db6e7ad">00230</a>         <a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">const_reference</a> <a class="code" href="classOscl__Queue.html#a5bcc41e4bea1546281a2fa668d507960">front</a>()<span class="keyword"> const</span>
<a name="l00231"></a>00231 <span class="keyword">        </span>{
<a name="l00232"></a>00232             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(! <a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">empty</a>());
<a name="l00233"></a>00233             <span class="keywordflow">return</span> (<a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">const_reference</a>)((<a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>)<a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>)[<a class="code" href="classOscl__Queue__Base.html#a7becc95f947716715eccea27fdb53cd8">ifront</a>];
<a name="l00234"></a>00234         }
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 
<a name="l00240"></a><a class="code" href="classOscl__Queue.html#af0a6e2c0a4966971f54f0a4964fc74a9">00240</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue.html#af0a6e2c0a4966971f54f0a4964fc74a9">pop</a>()
<a name="l00241"></a>00241         {
<a name="l00242"></a>00242             <a class="code" href="classOscl__Queue.html#af0a6e2c0a4966971f54f0a4964fc74a9">Oscl_Queue_Base::pop</a>();
<a name="l00243"></a>00243         }
<a name="l00244"></a>00244 
<a name="l00250"></a><a class="code" href="classOscl__Queue.html#a697074a787ad90b523548b1fb59007ab">00250</a>         <a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">reference</a> <a class="code" href="classOscl__Queue.html#a697074a787ad90b523548b1fb59007ab">back</a>()
<a name="l00251"></a>00251         {
<a name="l00252"></a>00252             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(! <a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">empty</a>());
<a name="l00253"></a>00253             <span class="keywordflow">return</span> (<a class="code" href="classOscl__Queue.html#a696da1ecff2a57db76fa6636e5cbefc9">reference</a>)((<a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>)<a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>)[<a class="code" href="classOscl__Queue__Base.html#a7d836f28a382837bffe2e89cf17ff60e">irear</a>];
<a name="l00254"></a>00254         }
<a name="l00255"></a>00255 
<a name="l00259"></a><a class="code" href="classOscl__Queue.html#a26ea6f09244c4cb9d2e5ffab7e291e0d">00259</a>         <a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">const_reference</a> <a class="code" href="classOscl__Queue.html#a697074a787ad90b523548b1fb59007ab">back</a>()<span class="keyword"> const</span>
<a name="l00260"></a>00260 <span class="keyword">        </span>{
<a name="l00261"></a>00261             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(! <a class="code" href="classOscl__Queue__Base.html#a5061479493f9db9099aa7658bb1c33d8">empty</a>());
<a name="l00262"></a>00262             <span class="keywordflow">return</span> (<a class="code" href="classOscl__Queue.html#a1ffac6d0398a42a5c0e9cf2d562260b3">const_reference</a>)((<a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>)<a class="code" href="classOscl__Queue__Base.html#a33267f94920bb1bd2e43890d4c8ecdc0">elems</a>)[<a class="code" href="classOscl__Queue__Base.html#a7d836f28a382837bffe2e89cf17ff60e">irear</a>];
<a name="l00263"></a>00263         }
<a name="l00264"></a>00264 
<a name="l00268"></a><a class="code" href="classOscl__Queue.html#a05ad80382a2e63d1639e2de1e1d25c11">00268</a>         <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue.html#a05ad80382a2e63d1639e2de1e1d25c11">clear</a>()
<a name="l00269"></a>00269         {
<a name="l00270"></a>00270             <a class="code" href="classOscl__Queue.html#a05ad80382a2e63d1639e2de1e1d25c11">Oscl_Queue_Base::clear</a>();
<a name="l00271"></a>00271         }
<a name="l00272"></a>00272 
<a name="l00283"></a>00283     <span class="keyword">private</span>:
<a name="l00284"></a>00284         Alloc defAlloc;
<a name="l00285"></a>00285 
<a name="l00286"></a>00286         <span class="comment">//from Oscl_Opaque_Type_Alloc</span>
<a name="l00287"></a>00287         <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>* allocate(<span class="keyword">const</span> uint32 <a class="code" href="classOscl__Queue__Base.html#a141d62496dd666b5564df7309f93c0bd">size</a>)
<a name="l00288"></a>00288         {
<a name="l00289"></a>00289             <span class="keywordflow">return</span> defAlloc.allocate(size);
<a name="l00290"></a>00290         }
<a name="l00291"></a>00291 
<a name="l00292"></a>00292         <span class="comment">//from Oscl_Opaque_Type_Alloc</span>
<a name="l00293"></a>00293         <span class="keywordtype">void</span> deallocate(<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="l00294"></a>00294         {
<a name="l00295"></a>00295             defAlloc.deallocate(p);
<a name="l00296"></a>00296         }
<a name="l00297"></a>00297 
<a name="l00298"></a>00298         <span class="comment">//from Oscl_Opaque_Type_Alloc</span>
<a name="l00299"></a>00299         <span class="keywordtype">void</span> construct(<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, <span class="keyword">const</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>* x)
<a name="l00300"></a>00300         {
<a name="l00301"></a>00301             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(x);
<a name="l00302"></a>00302             <span class="keyword">new</span>(p) <a class="code" href="classOscl__Queue.html#a865a97f0dfc2fab26ddc0e702aff894b">value_type</a>(*((T*)x));
<a name="l00303"></a>00303         }
<a name="l00304"></a>00304 
<a name="l00305"></a>00305         <span class="comment">//from Oscl_Opaque_Type_Alloc</span>
<a name="l00306"></a>00306         <span class="keywordtype">void</span> <a class="code" href="classOscl__Queue__Base.html#a26f7b83b07bf6684572fb04dfe87d1ec">destroy</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>* first)
<a name="l00307"></a>00307         {
<a name="l00308"></a>00308             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(first);
<a name="l00309"></a>00309             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(first);
<a name="l00310"></a>00310             <span class="comment">//must use &quot;pointer&quot; instead of &quot;T*&quot; here to avoid ADS 1.2 compile error.</span>
<a name="l00311"></a>00311             ((<a class="code" href="classOscl__Queue.html#a61f2e9dbbd112f364294d3894867546a">pointer</a>)first)-&gt;~T();
<a name="l00312"></a>00312         }
<a name="l00313"></a>00313 
<a name="l00314"></a>00314 
<a name="l00315"></a>00315         <span class="comment">/***************************</span>
<a name="l00316"></a>00316 <span class="comment">         * things we don&#39;t believe are needed</span>
<a name="l00317"></a>00317 <span class="comment">         * -- private definitions to block implicit ones --</span>
<a name="l00318"></a>00318 <span class="comment">         */</span>
<a name="l00319"></a>00319 
<a name="l00325"></a>00325         <a class="code" href="classOscl__Queue.html">Oscl_Queue&lt;T, Alloc&gt;</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classOscl__Queue.html">Oscl_Queue&lt;T, Alloc&gt;</a>&amp; x)
<a name="l00326"></a>00326         {
<a name="l00327"></a>00327             <span class="comment">// Do we need to copy a queue?  Why...?</span>
<a name="l00328"></a>00328             <span class="comment">//  .. unless there&#39;s a need, let&#39;s not bother with the</span>
<a name="l00329"></a>00329             <span class="comment">//  complexity here..</span>
<a name="l00330"></a>00330             <span class="comment">// (need something here, we don&#39;t want implicit assignment either</span>
<a name="l00331"></a>00331             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(x);
<a name="l00332"></a>00332             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(<span class="keyword">false</span>);
<a name="l00333"></a>00333             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00334"></a>00334         }
<a name="l00335"></a>00335 
<a name="l00341"></a>00341         <a class="code" href="classOscl__Queue.html#a9f7232cb455ff9b7d2550276b368df3f">Oscl_Queue</a>(<span class="keyword">const</span> <a class="code" href="classOscl__Queue.html">Oscl_Queue&lt;T, Alloc&gt;</a>&amp; x)
<a name="l00342"></a>00342                 : <a class="code" href="classOscl__Queue__Base.html">Oscl_Queue_Base</a>(sizeof(T), this, this)
<a name="l00343"></a>00343         {
<a name="l00344"></a>00344             <a class="code" href="group__osclbase.html#ga0ac3a7c93a978fa6d04c2a5d810612dd">OSCL_UNUSED_ARG</a>(x);
<a name="l00345"></a>00345             <a class="code" href="group__osclbase.html#gaf7c21e5b6e4fee4247225dd31f89c8ca">OSCL_ASSERT</a>(<span class="keyword">false</span>);
<a name="l00346"></a>00346         }
<a name="l00347"></a>00347 };  <span class="comment">// end class oscl_queue</span>
<a name="l00348"></a>00348 
<a name="l00352"></a>00352 <span class="preprocessor">#endif</span>
<a name="l00353"></a>00353 <span class="preprocessor"></span>
<a name="l00354"></a>00354 
</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.002.1.1 </small>
</small></address>
</body>
</html>