blob: 5fd42d3ba43a39a4ebf394e4f075e944ba7f5007 [file] [log] [blame]
<!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_linked_list.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> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>oscl_linked_list.h</h1><a href="oscl__linked__list_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 _ L I N K E D _ L I S T</span>
00005
00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
00007
00018 <span class="preprocessor">#ifndef OSCL_LINKED_LIST_H_INCLUDED</span>
00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_LINKED_LIST_H_INCLUDED</span>
00020 <span class="preprocessor"></span>
00021 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
00022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span>
00023 <span class="preprocessor">#endif</span>
00024 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span>
00025 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span>
00026 <span class="preprocessor">#endif</span>
00027 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_OPAQUE_TYPE_H_INCLUDED</span>
00028 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__opaque__type_8h.html">oscl_opaque_type.h</a>"</span>
00029 <span class="preprocessor">#endif</span>
00030 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_ASSERT_H_INCLUDED</span>
00031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__assert_8h.html">oscl_assert.h</a>"</span>
00032 <span class="preprocessor">#endif</span>
00033 <span class="preprocessor"></span>
00034
00043 <span class="keyword">template</span> &lt;<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc&gt; <span class="keyword">class </span><a class="code" href="classOscl__Linked__List.html">Oscl_Linked_List</a>;
<a name="l00047"></a><a class="code" href="classLinkedListElement.html">00047</a> <span class="keyword">template</span> &lt;<span class="keyword">class</span> LLClass&gt; <span class="keyword">class </span><a class="code" href="classLinkedListElement.html">LinkedListElement</a>
00048 {
00049
00050 <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="classLinkedListElement.html#a0">00051</a> <a class="code" href="classLinkedListElement.html#a0">LinkedListElement</a>(LLClass in_data)
00052 {
00053 <a class="code" href="classLinkedListElement.html#m1">data</a> = in_data;
00054 <a class="code" href="classLinkedListElement.html#m0">next</a> = <a class="code" href="group__osclbase.html#a81">NULL</a>;
00055 };
00056 <span class="comment">// ~LinkedListElement() {};</span>
00057
00058 <span class="comment">// friend class Oscl_Linked_List&lt;LLClass&gt;;</span>
<a name="l00059"></a><a class="code" href="classLinkedListElement.html#m0">00059</a> <a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>* <a class="code" href="classLinkedListElement.html#m0">next</a>;
<a name="l00060"></a><a class="code" href="classLinkedListElement.html#m1">00060</a> LLClass <a class="code" href="classLinkedListElement.html#m1">data</a>;
00061
00062 <span class="keyword">private</span>:
00063 };
00064
<a name="l00069"></a><a class="code" href="classOscl__Linked__List__Base.html">00069</a> <span class="keyword">class </span><a class="code" href="classOscl__Linked__List__Base.html">Oscl_Linked_List_Base</a>
00070 {
00071 <span class="keyword">protected</span>:
<a name="l00072"></a><a class="code" href="classOscl__Linked__List__Base.html#b0">00072</a> <span class="keyword">virtual</span> <a class="code" href="classOscl__Linked__List__Base.html#b0">~Oscl_Linked_List_Base</a>()
00073 {}
00074
00075 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOscl__Linked__List__Base.html#b1">construct</a>(<a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a>* op);
00076
00077 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOscl__Linked__List__Base.html#b2">destroy</a>();
00078
00085 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b3">get_first</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* ele);
00086
00093 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b4">get_next</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* ele);
00094
00100 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b5">check_list</a>();
00101
00108 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b6">add_element</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* new_element);
00109
00117 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b7">add_to_front</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* new_element);
00118
00124 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b8">get_element</a>(int32 index, <a class="code" href="group__osclbase.html#a25">OsclAny</a>* element);
00125
00131 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b9">remove_element</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* data_to_remove);
00132
00139 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b10">get_index</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* data);
00140
00146 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b9">remove_element</a>(<span class="keyword">const</span> int32 index_to_remove);
00147
00153 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b12">move_to_end</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* data_to_move);
00154
00160 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b13">move_to_front</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* data_to_move);
00161
<a name="l00162"></a><a class="code" href="classOscl__Linked__List__Base.html#n0">00162</a> <a class="code" href="group__osclbase.html#a25">OsclAny</a> *<a class="code" href="classOscl__Linked__List__Base.html#n0">head</a>;
<a name="l00163"></a><a class="code" href="classOscl__Linked__List__Base.html#n1">00163</a> <a class="code" href="group__osclbase.html#a25">OsclAny</a> *<a class="code" href="classOscl__Linked__List__Base.html#n1">tail</a>;
<a name="l00164"></a><a class="code" href="classOscl__Linked__List__Base.html#n2">00164</a> <a class="code" href="group__osclbase.html#a25">OsclAny</a> *<a class="code" href="classOscl__Linked__List__Base.html#n2">iterator</a>;
<a name="l00165"></a><a class="code" href="classOscl__Linked__List__Base.html#n3">00165</a> int32 <a class="code" href="classOscl__Linked__List__Base.html#n3">num_elements</a>;
<a name="l00166"></a><a class="code" href="classOscl__Linked__List__Base.html#n4">00166</a> uint32 <a class="code" href="classOscl__Linked__List__Base.html#n4">sizeof_T</a>;
00167
00168 <span class="keyword">private</span>:
00169 <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a>* pOpaqueType;
00170 };
00171
<a name="l00175"></a><a class="code" href="classOscl__Linked__List.html">00175</a> <span class="keyword">template</span> &lt;<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc&gt; <span class="keyword">class </span><a class="code" href="classOscl__Linked__List.html">Oscl_Linked_List</a>
00176 : <span class="keyword">public</span> <a class="code" href="classOscl__Linked__List__Base.html">Oscl_Linked_List_Base</a>
00177 , <span class="keyword">public</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a>
00178 {
00179
00180 <span class="keyword">public</span>:
<a name="l00184"></a><a class="code" href="classOscl__Linked__List.html#a0">00184</a> <a class="code" href="classOscl__Linked__List.html#a0">Oscl_Linked_List</a>(): <a class="code" href="classOscl__Linked__List__Base.html">Oscl_Linked_List_Base</a>(), <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a>()
00185 {
00186 <a class="code" href="classOscl__Linked__List__Base.html#n4">sizeof_T</a> = <span class="keyword">sizeof</span>(<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>);
00187 <a class="code" href="classOscl__Linked__List__Base.html#b1">Oscl_Linked_List_Base::construct</a>(<span class="keyword">this</span>);
00188 }
00189
<a name="l00193"></a><a class="code" href="classOscl__Linked__List.html#a1">00193</a> <a class="code" href="classOscl__Linked__List.html#a1">~Oscl_Linked_List</a>()
00194 {
00195 <a class="code" href="classOscl__Linked__List__Base.html#b2">Oscl_Linked_List_Base::destroy</a>();
00196 }
00197
<a name="l00198"></a><a class="code" href="classOscl__Linked__List.html#a2">00198</a> int32 <a class="code" href="classOscl__Linked__List.html#a2">dequeue_element</a>(LLClass &amp; element)
00199 {
00200 <a class="code" href="classOscl__Linked__List.html#a9">get_element</a>(0, element);
00201 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List.html#a10">remove_element</a>((int32) 0);
00202 }
00203 <span class="comment">// get_first() and get_next() together provide iterator function</span>
00204
<a name="l00211"></a><a class="code" href="classOscl__Linked__List.html#a3">00211</a> int32 <a class="code" href="classOscl__Linked__List.html#a3">get_first</a>(LLClass &amp; ele)
00212 {
00213 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b3">Oscl_Linked_List_Base::get_first</a>(&amp;ele);
00214 }
00215
<a name="l00222"></a><a class="code" href="classOscl__Linked__List.html#a4">00222</a> int32 <a class="code" href="classOscl__Linked__List.html#a4">get_next</a>(LLClass &amp; ele)
00223 {
00224 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b4">Oscl_Linked_List_Base::get_next</a>(&amp;ele);
00225 }
00226
<a name="l00232"></a><a class="code" href="classOscl__Linked__List.html#a5">00232</a> int32 <a class="code" href="classOscl__Linked__List.html#a5">check_list</a>()
00233 {
00234 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b5">Oscl_Linked_List_Base::check_list</a>();
00235 }
00236
<a name="l00241"></a><a class="code" href="classOscl__Linked__List.html#a6">00241</a> int32 <a class="code" href="classOscl__Linked__List.html#a6">get_num_elements</a>()
00242 {
00243 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#n3">num_elements</a>;
00244 }
00245
<a name="l00252"></a><a class="code" href="classOscl__Linked__List.html#a7">00252</a> int32 <a class="code" href="classOscl__Linked__List.html#a7">add_element</a>(LLClass&amp; new_element)
00253 {
00254 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b6">Oscl_Linked_List_Base::add_element</a>(&amp;new_element);
00255 }
00256
<a name="l00264"></a><a class="code" href="classOscl__Linked__List.html#a8">00264</a> int32 <a class="code" href="classOscl__Linked__List.html#a8">add_to_front</a>(<span class="keyword">const</span> LLClass&amp; new_element)
00265 {
00266 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b7">Oscl_Linked_List_Base::add_to_front</a>(&amp;new_element);
00267 }
00268
<a name="l00274"></a><a class="code" href="classOscl__Linked__List.html#a9">00274</a> int32 <a class="code" href="classOscl__Linked__List.html#a9">get_element</a>(int32 index, LLClass&amp; element)
00275 {
00276 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b8">Oscl_Linked_List_Base::get_element</a>(index, &amp;element);
00277 }
00278
<a name="l00284"></a><a class="code" href="classOscl__Linked__List.html#a10">00284</a> int32 <a class="code" href="classOscl__Linked__List.html#a10">remove_element</a>(<span class="keyword">const</span> LLClass&amp; data_to_remove)
00285 {
00286 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b9">Oscl_Linked_List_Base::remove_element</a>(&amp;data_to_remove);
00287 }
00288
<a name="l00295"></a><a class="code" href="classOscl__Linked__List.html#a11">00295</a> int32 <a class="code" href="classOscl__Linked__List.html#a11">get_index</a>(<span class="keyword">const</span> LLClass&amp; data)
00296 {
00297 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b10">Oscl_Linked_List_Base::get_index</a>(&amp;data);
00298 }
00299
<a name="l00305"></a><a class="code" href="classOscl__Linked__List.html#a12">00305</a> int32 <a class="code" href="classOscl__Linked__List.html#a10">remove_element</a>(<span class="keyword">const</span> int32 index_to_remove)
00306 {
00307 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b9">Oscl_Linked_List_Base::remove_element</a>(index_to_remove);
00308 }
00309
<a name="l00315"></a><a class="code" href="classOscl__Linked__List.html#a13">00315</a> int32 <a class="code" href="classOscl__Linked__List.html#a13">move_to_end</a>(<span class="keyword">const</span> LLClass&amp; data_to_move)
00316 {
00317 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b12">Oscl_Linked_List_Base::move_to_end</a>(&amp;data_to_move);
00318 }
00319
<a name="l00325"></a><a class="code" href="classOscl__Linked__List.html#a14">00325</a> int32 <a class="code" href="classOscl__Linked__List.html#a14">move_to_front</a>(<span class="keyword">const</span> LLClass&amp; data_to_move)
00326 {
00327 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b13">Oscl_Linked_List_Base::move_to_front</a>(&amp;data_to_move);
00328 }
00329
00330
00331 <span class="keyword">private</span>:
00332
00333 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00334 <span class="keywordtype">void</span> <a class="code" href="classOscl__Linked__List__Base.html#b1">construct</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* p, <span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* init_val)
00335 {
00336 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(init_val);
00337 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(p);
00338 <span class="keyword">new</span>(p) <a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>(*(LLClass*)init_val);
00339 }
00340
00341 <span class="comment">//this typedef is needed to avoid compile errors ADS 1.2 compiler.</span>
00342 <span class="keyword">typedef</span> <a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>* p_elem_type;
00343
00344 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00345 <span class="keywordtype">void</span> <a class="code" href="classOscl__Linked__List__Base.html#b2">destroy</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* p)
00346 {
00347 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(p);
00348 ((p_elem_type)p)-&gt;~LinkedListElement&lt;LLClass&gt;();
00349 }
00350
00351 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00352 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html#a2">allocate</a>(<span class="keyword">const</span> uint32 size)
00353 {
00354 <span class="keywordflow">return</span> alloc.ALLOCATE(size);
00355 }
00356
00357 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00358 <span class="keywordtype">void</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html#a3">deallocate</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* p)
00359 {
00360 alloc.deallocate(p);
00361 }
00362
00363 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00364 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOscl__Linked__List.html#a4">get_next</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* elem)<span class="keyword">const</span>
00365 {
00366 <span class="keywordflow">return</span> ((<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>*)elem)-&gt;next;
00367 }
00368
00369 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00370 <span class="keywordtype">void</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html#a5">set_next</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* elem, <span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* nextelem)
00371 {
00372 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem);
00373 ((<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>*)elem)-&gt;next = (<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>*)nextelem;
00374 }
00375
00376 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00377 <span class="keywordtype">void</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html#a6">get_data</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>*elem, <a class="code" href="group__osclbase.html#a25">OsclAny</a>*data_val)
00378 {
00379 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem);
00380 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(data_val);
00381 *((LLClass*)data_val) = ((<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>*)elem)-&gt;data ;
00382 }
00383
00384 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span>
00385 <span class="keywordtype">bool</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html#a7">compare_data</a>(<span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>*elem, <span class="keyword">const</span> <a class="code" href="group__osclbase.html#a25">OsclAny</a>*data_val)<span class="keyword">const</span>
00386 {
00387 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem);
00388 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(data_val);
00389 <span class="keywordflow">return</span> ((<a class="code" href="classLinkedListElement.html">LinkedListElement&lt;LLClass&gt;</a>*)elem)-&gt;data == *((LLClass*)data_val);
00390 }
00391
00392 Alloc alloc;
00393
00394 };
00395
<a name="l00401"></a><a class="code" href="classOscl__MTLinked__List.html">00401</a> <span class="keyword">template</span> &lt;<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc, <span class="keyword">class</span> TheLock&gt; <span class="keyword">class </span><a class="code" href="classOscl__MTLinked__List.html">Oscl_MTLinked_List</a>
00402 {
00403
00404 <span class="keyword">public</span>:
<a name="l00408"></a><a class="code" href="classOscl__MTLinked__List.html#a0">00408</a> <a class="code" href="classOscl__MTLinked__List.html#a0">Oscl_MTLinked_List</a>() {};
00409
<a name="l00413"></a><a class="code" href="classOscl__MTLinked__List.html#a1">00413</a> <a class="code" href="classOscl__MTLinked__List.html#a1">~Oscl_MTLinked_List</a>() {};
00414
<a name="l00415"></a><a class="code" href="classOscl__MTLinked__List.html#a2">00415</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a2">dequeue_element</a>(LLClass &amp; element)
00416 {
00417 int32 status;
00418 TheLock Mylock;
00419 Mylock.Lock();
00420 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.dequeue_element(element);
00421 Mylock.Unlock();
00422 <span class="keywordflow">return</span> status;
00423 }
00424
<a name="l00432"></a><a class="code" href="classOscl__MTLinked__List.html#a3">00432</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a3">add_element</a>(LLClass&amp; new_element)
00433 {
00434 int32 status;
00435 TheLock Mylock;
00436 Mylock.Lock();
00437 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.add_element(new_element);
00438 Mylock.Unlock();
00439 <span class="keywordflow">return</span> status;
00440 }
00441
<a name="l00449"></a><a class="code" href="classOscl__MTLinked__List.html#a4">00449</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a4">add_to_front</a>(LLClass&amp; new_element)
00450 {
00451 int32 status;
00452 TheLock Mylock;
00453 Mylock.Lock();
00454 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.add_to_front(new_element);
00455 Mylock.Unlock();
00456 <span class="keywordflow">return</span> status;
00457 }
00458
<a name="l00465"></a><a class="code" href="classOscl__MTLinked__List.html#a5">00465</a> uint32 <a class="code" href="classOscl__MTLinked__List.html#a5">get_element</a>(int32 index, LLClass&amp; element)
00466 {
00467
00468 int32 status;
00469 TheLock Mylock;
00470 Mylock.Lock();
00471 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.get_element(index, element);
00472 Mylock.Unlock();
00473 <span class="keywordflow">return</span> status;
00474 }
00475
<a name="l00481"></a><a class="code" href="classOscl__MTLinked__List.html#a6">00481</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a6">remove_element</a>(<span class="keyword">const</span> LLClass&amp; data_to_remove)
00482 {
00483 int32 status;
00484 TheLock Mylock;
00485 Mylock.Lock();
00486 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.remove_element(data_to_remove);
00487 Mylock.Unlock();
00488 <span class="keywordflow">return</span> status;
00489 }
00490
<a name="l00497"></a><a class="code" href="classOscl__MTLinked__List.html#a7">00497</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a7">get_index</a>(<span class="keyword">const</span> LLClass&amp; data)
00498 {
00499 int32 status;
00500 TheLock Mylock;
00501 Mylock.Lock();
00502 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.get_index(data);
00503 Mylock.Unlock();
00504 <span class="keywordflow">return</span> status;
00505 }
00506
<a name="l00512"></a><a class="code" href="classOscl__MTLinked__List.html#a8">00512</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a6">remove_element</a>(<span class="keyword">const</span> int32 index_to_remove)
00513 {
00514 int32 status;
00515 TheLock Mylock;
00516 Mylock.Lock();
00517 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.remove_element(index_to_remove);
00518 Mylock.Unlock();
00519 <span class="keywordflow">return</span> status;
00520 }
00521
<a name="l00527"></a><a class="code" href="classOscl__MTLinked__List.html#a9">00527</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a9">move_to_end</a>(<span class="keyword">const</span> LLClass&amp; data_to_move)
00528 {
00529 int32 status;
00530 TheLock Mylock;
00531 Mylock.Lock();
00532 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.move_to_end(data_to_move);
00533 Mylock.Unlock();
00534 <span class="keywordflow">return</span> status;
00535 }
00536
<a name="l00542"></a><a class="code" href="classOscl__MTLinked__List.html#a10">00542</a> int32 <a class="code" href="classOscl__MTLinked__List.html#a10">move_to_front</a>(<span class="keyword">const</span> LLClass&amp; data_to_move)
00543 {
00544 int32 status;
00545 TheLock Mylock;
00546 Mylock.Lock();
00547 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.move_to_front(data_to_move);
00548 Mylock.Unlock();
00549 <span class="keywordflow">return</span> status;
00550 }
00551
00552 <span class="keyword">protected</span>:
<a name="l00553"></a><a class="code" href="classOscl__MTLinked__List.html#n0">00553</a> <a class="code" href="classOscl__Linked__List.html">Oscl_Linked_List&lt;LLClass, Alloc&gt;</a> <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>;
00554 <span class="comment">// PVMutex mutex;</span>
00555
00556 };
00557
00558
00562 <span class="preprocessor">#endif // __LINKED_LIST_H</span>
00563 <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>