1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3<title>oscl_linked_list.h Source File</title> 4<link href="doxygen.css" rel="stylesheet" type="text/css"> 5</head><body> 6<!-- Generated by Doxygen 1.2.18 --> 7<center> 8<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> 9<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> 1000002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1100003 1200004 <span class="comment">// O S C L _ L I N K E D _ L I S T</span> 1300005 1400006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1500007 1600018 <span class="preprocessor">#ifndef OSCL_LINKED_LIST_H_INCLUDED</span> 1700019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_LINKED_LIST_H_INCLUDED</span> 1800020 <span class="preprocessor"></span> 1900021 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span> 2000022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span> 2100023 <span class="preprocessor">#endif</span> 2200024 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span> 2300025 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span> 2400026 <span class="preprocessor">#endif</span> 2500027 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_OPAQUE_TYPE_H_INCLUDED</span> 2600028 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__opaque__type_8h.html">oscl_opaque_type.h</a>"</span> 2700029 <span class="preprocessor">#endif</span> 2800030 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_ASSERT_H_INCLUDED</span> 2900031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__assert_8h.html">oscl_assert.h</a>"</span> 3000032 <span class="preprocessor">#endif</span> 3100033 <span class="preprocessor"></span> 3200034 3300043 <span class="keyword">template</span> <<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc> <span class="keyword">class </span><a class="code" href="classOscl__Linked__List.html">Oscl_Linked_List</a>; 34<a name="l00047"></a><a class="code" href="classLinkedListElement.html">00047</a> <span class="keyword">template</span> <<span class="keyword">class</span> LLClass> <span class="keyword">class </span><a class="code" href="classLinkedListElement.html">LinkedListElement</a> 3500048 { 3600049 3700050 <span class="keyword">public</span>: 38<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) 3900052 { 4000053 <a class="code" href="classLinkedListElement.html#m1">data</a> = in_data; 4100054 <a class="code" href="classLinkedListElement.html#m0">next</a> = <a class="code" href="group__osclbase.html#a81">NULL</a>; 4200055 }; 4300056 <span class="comment">// ~LinkedListElement() {};</span> 4400057 4500058 <span class="comment">// friend class Oscl_Linked_List<LLClass>;</span> 46<a name="l00059"></a><a class="code" href="classLinkedListElement.html#m0">00059</a> <a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>* <a class="code" href="classLinkedListElement.html#m0">next</a>; 47<a name="l00060"></a><a class="code" href="classLinkedListElement.html#m1">00060</a> LLClass <a class="code" href="classLinkedListElement.html#m1">data</a>; 4800061 4900062 <span class="keyword">private</span>: 5000063 }; 5100064 52<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> 5300070 { 5400071 <span class="keyword">protected</span>: 55<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>() 5600073 {} 5700074 5800075 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); 5900076 6000077 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOscl__Linked__List__Base.html#b2">destroy</a>(); 6100078 6200085 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); 6300086 6400093 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); 6500094 6600100 OSCL_IMPORT_REF int32 <a class="code" href="classOscl__Linked__List__Base.html#b5">check_list</a>(); 6700101 6800108 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); 6900109 7000117 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); 7100118 7200124 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); 7300125 7400131 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); 7500132 7600139 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); 7700140 7800146 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); 7900147 8000153 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); 8100154 8200160 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); 8300161 84<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>; 85<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>; 86<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>; 87<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>; 88<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>; 8900167 9000168 <span class="keyword">private</span>: 9100169 <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a>* pOpaqueType; 9200170 }; 9300171 94<a name="l00175"></a><a class="code" href="classOscl__Linked__List.html">00175</a> <span class="keyword">template</span> <<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc> <span class="keyword">class </span><a class="code" href="classOscl__Linked__List.html">Oscl_Linked_List</a> 9500176 : <span class="keyword">public</span> <a class="code" href="classOscl__Linked__List__Base.html">Oscl_Linked_List_Base</a> 9600177 , <span class="keyword">public</span> <a class="code" href="classOscl__Opaque__Type__Alloc__LL.html">Oscl_Opaque_Type_Alloc_LL</a> 9700178 { 9800179 9900180 <span class="keyword">public</span>: 100<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>() 10100185 { 10200186 <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<LLClass></a>); 10300187 <a class="code" href="classOscl__Linked__List__Base.html#b1">Oscl_Linked_List_Base::construct</a>(<span class="keyword">this</span>); 10400188 } 10500189 106<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>() 10700194 { 10800195 <a class="code" href="classOscl__Linked__List__Base.html#b2">Oscl_Linked_List_Base::destroy</a>(); 10900196 } 11000197 111<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 & element) 11200199 { 11300200 <a class="code" href="classOscl__Linked__List.html#a9">get_element</a>(0, element); 11400201 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List.html#a10">remove_element</a>((int32) 0); 11500202 } 11600203 <span class="comment">// get_first() and get_next() together provide iterator function</span> 11700204 118<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 & ele) 11900212 { 12000213 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b3">Oscl_Linked_List_Base::get_first</a>(&ele); 12100214 } 12200215 123<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 & ele) 12400223 { 12500224 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b4">Oscl_Linked_List_Base::get_next</a>(&ele); 12600225 } 12700226 128<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>() 12900233 { 13000234 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b5">Oscl_Linked_List_Base::check_list</a>(); 13100235 } 13200236 133<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>() 13400242 { 13500243 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#n3">num_elements</a>; 13600244 } 13700245 138<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& new_element) 13900253 { 14000254 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b6">Oscl_Linked_List_Base::add_element</a>(&new_element); 14100255 } 14200256 143<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& new_element) 14400265 { 14500266 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b7">Oscl_Linked_List_Base::add_to_front</a>(&new_element); 14600267 } 14700268 148<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& element) 14900275 { 15000276 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b8">Oscl_Linked_List_Base::get_element</a>(index, &element); 15100277 } 15200278 153<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& data_to_remove) 15400285 { 15500286 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b9">Oscl_Linked_List_Base::remove_element</a>(&data_to_remove); 15600287 } 15700288 158<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& data) 15900296 { 16000297 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b10">Oscl_Linked_List_Base::get_index</a>(&data); 16100298 } 16200299 163<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) 16400306 { 16500307 <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); 16600308 } 16700309 168<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& data_to_move) 16900316 { 17000317 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b12">Oscl_Linked_List_Base::move_to_end</a>(&data_to_move); 17100318 } 17200319 173<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& data_to_move) 17400326 { 17500327 <span class="keywordflow">return</span> <a class="code" href="classOscl__Linked__List__Base.html#b13">Oscl_Linked_List_Base::move_to_front</a>(&data_to_move); 17600328 } 17700329 17800330 17900331 <span class="keyword">private</span>: 18000332 18100333 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 18200334 <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) 18300335 { 18400336 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(init_val); 18500337 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(p); 18600338 <span class="keyword">new</span>(p) <a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>(*(LLClass*)init_val); 18700339 } 18800340 18900341 <span class="comment">//this typedef is needed to avoid compile errors ADS 1.2 compiler.</span> 19000342 <span class="keyword">typedef</span> <a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>* p_elem_type; 19100343 19200344 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 19300345 <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) 19400346 { 19500347 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(p); 19600348 ((p_elem_type)p)->~LinkedListElement<LLClass>(); 19700349 } 19800350 19900351 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 20000352 <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) 20100353 { 20200354 <span class="keywordflow">return</span> alloc.ALLOCATE(size); 20300355 } 20400356 20500357 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 20600358 <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) 20700359 { 20800360 alloc.deallocate(p); 20900361 } 21000362 21100363 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 21200364 <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> 21300365 { 21400366 <span class="keywordflow">return</span> ((<a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>*)elem)->next; 21500367 } 21600368 21700369 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 21800370 <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) 21900371 { 22000372 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem); 22100373 ((<a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>*)elem)->next = (<a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>*)nextelem; 22200374 } 22300375 22400376 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 22500377 <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) 22600378 { 22700379 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem); 22800380 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(data_val); 22900381 *((LLClass*)data_val) = ((<a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>*)elem)->data ; 23000382 } 23100383 23200384 <span class="comment">//from Oscl_Opaque_Type_Alloc_LL</span> 23300385 <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> 23400386 { 23500387 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(elem); 23600388 <a class="code" href="group__osclbase.html#a78">OSCL_ASSERT</a>(data_val); 23700389 <span class="keywordflow">return</span> ((<a class="code" href="classLinkedListElement.html">LinkedListElement<LLClass></a>*)elem)->data == *((LLClass*)data_val); 23800390 } 23900391 24000392 Alloc alloc; 24100393 24200394 }; 24300395 244<a name="l00401"></a><a class="code" href="classOscl__MTLinked__List.html">00401</a> <span class="keyword">template</span> <<span class="keyword">class</span> LLClass, <span class="keyword">class</span> Alloc, <span class="keyword">class</span> TheLock> <span class="keyword">class </span><a class="code" href="classOscl__MTLinked__List.html">Oscl_MTLinked_List</a> 24500402 { 24600403 24700404 <span class="keyword">public</span>: 248<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>() {}; 24900409 250<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>() {}; 25100414 252<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 & element) 25300416 { 25400417 int32 status; 25500418 TheLock Mylock; 25600419 Mylock.Lock(); 25700420 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.dequeue_element(element); 25800421 Mylock.Unlock(); 25900422 <span class="keywordflow">return</span> status; 26000423 } 26100424 262<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& new_element) 26300433 { 26400434 int32 status; 26500435 TheLock Mylock; 26600436 Mylock.Lock(); 26700437 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.add_element(new_element); 26800438 Mylock.Unlock(); 26900439 <span class="keywordflow">return</span> status; 27000440 } 27100441 272<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& new_element) 27300450 { 27400451 int32 status; 27500452 TheLock Mylock; 27600453 Mylock.Lock(); 27700454 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.add_to_front(new_element); 27800455 Mylock.Unlock(); 27900456 <span class="keywordflow">return</span> status; 28000457 } 28100458 282<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& element) 28300466 { 28400467 28500468 int32 status; 28600469 TheLock Mylock; 28700470 Mylock.Lock(); 28800471 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.get_element(index, element); 28900472 Mylock.Unlock(); 29000473 <span class="keywordflow">return</span> status; 29100474 } 29200475 293<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& data_to_remove) 29400482 { 29500483 int32 status; 29600484 TheLock Mylock; 29700485 Mylock.Lock(); 29800486 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.remove_element(data_to_remove); 29900487 Mylock.Unlock(); 30000488 <span class="keywordflow">return</span> status; 30100489 } 30200490 303<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& data) 30400498 { 30500499 int32 status; 30600500 TheLock Mylock; 30700501 Mylock.Lock(); 30800502 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.get_index(data); 30900503 Mylock.Unlock(); 31000504 <span class="keywordflow">return</span> status; 31100505 } 31200506 313<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) 31400513 { 31500514 int32 status; 31600515 TheLock Mylock; 31700516 Mylock.Lock(); 31800517 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.remove_element(index_to_remove); 31900518 Mylock.Unlock(); 32000519 <span class="keywordflow">return</span> status; 32100520 } 32200521 323<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& data_to_move) 32400528 { 32500529 int32 status; 32600530 TheLock Mylock; 32700531 Mylock.Lock(); 32800532 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.move_to_end(data_to_move); 32900533 Mylock.Unlock(); 33000534 <span class="keywordflow">return</span> status; 33100535 } 33200536 333<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& data_to_move) 33400543 { 33500544 int32 status; 33600545 TheLock Mylock; 33700546 Mylock.Lock(); 33800547 status = <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>.move_to_front(data_to_move); 33900548 Mylock.Unlock(); 34000549 <span class="keywordflow">return</span> status; 34100550 } 34200551 34300552 <span class="keyword">protected</span>: 344<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<LLClass, Alloc></a> <a class="code" href="classOscl__MTLinked__List.html#n0">the_list</a>; 34500554 <span class="comment">// PVMutex mutex;</span> 34600555 34700556 }; 34800557 34900558 35000562 <span class="preprocessor">#endif // __LINKED_LIST_H</span> 35100563 <span class="preprocessor"></span> 352</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 353<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 354</small></address> 355</body> 356</html> 357