Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/longnumber_8cpp-source.html
changeset 1 25a17d01db0c
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       
     2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
       
     3 <title>TB10.1 Example Applications: examples/Base/ArraysAndLists/linkedlist/sgllist/src/longnumber.cpp Source File</title>
       
     4 <link href="doxygen.css" rel="stylesheet" type="text/css">
       
     5 <link href="tabs.css" rel="stylesheet" type="text/css">
       
     6 </head><body>
       
     7 <!-- Generated by Doxygen 1.5.3 -->
       
     8 <h1>examples/Base/ArraysAndLists/linkedlist/sgllist/src/longnumber.cpp</h1><a href="longnumber_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
       
     9 <a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
       
    10 <a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
       
    11 <a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
       
    12 <a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
       
    13 <a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
       
    14 <a name="l00007"></a>00007 <span class="comment">//</span>
       
    15 <a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
       
    16 <a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
       
    17 <a name="l00010"></a>00010 <span class="comment">//</span>
       
    18 <a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
       
    19 <a name="l00012"></a>00012 <span class="comment">//</span>
       
    20 <a name="l00013"></a>00013 <span class="comment">// Description:</span>
       
    21 <a name="l00014"></a>00014 <span class="comment">// Contains definition of functions defined in the CLongNumber class.</span>
       
    22 <a name="l00015"></a>00015 <span class="comment">//</span>
       
    23 <a name="l00016"></a>00016 
       
    24 <a name="l00017"></a>00017 
       
    25 <a name="l00018"></a>00018 
       
    26 <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="longnumber_8h.html">longnumber.h</a>"</span>
       
    27 <a name="l00024"></a>00024 
       
    28 <a name="l00030"></a><a class="code" href="class_c_long_number.html#a6cb04e2afa3b0948941ab4910739331">00030</a> <a class="code" href="class_c_long_number.html">CLongNumber</a>* <a class="code" href="class_c_long_number.html#a6cb04e2afa3b0948941ab4910739331">CLongNumber::NewL</a>(CConsoleBase* aConsole)
       
    29 <a name="l00031"></a>00031         {
       
    30 <a name="l00032"></a>00032         <a class="code" href="class_c_long_number.html">CLongNumber</a>* <span class="keyword">self</span> = <span class="keyword">new</span> (ELeave) <a class="code" href="class_c_long_number.html">CLongNumber</a>(aConsole);
       
    31 <a name="l00033"></a>00033         <span class="keyword">self</span>-&gt;<a class="code" href="class_c_long_number.html#1c0ebc1c9dbcc9c34250ffef859b8a2f">AddToScheduler</a>();
       
    32 <a name="l00034"></a>00034         <span class="keywordflow">return</span> <span class="keyword">self</span>;
       
    33 <a name="l00035"></a>00035         }
       
    34 <a name="l00036"></a>00036 
       
    35 <a name="l00041"></a>00041 CLongNumber::CLongNumber(CConsoleBase* aConsole):
       
    36 <a name="l00042"></a>00042                                                                                                 <span class="comment">// Constructor of the base class.</span>
       
    37 <a name="l00043"></a>00043                                                                                                 CActive(CActive::EPriorityUserInput),
       
    38 <a name="l00044"></a>00044                                                                                                 <span class="comment">// Create the linked list.</span>
       
    39 <a name="l00045"></a>00045                                                                                                 iNumber(_FOFF(<a class="code" href="class_t_digit.html">TDigit</a>,iSLink)),
       
    40 <a name="l00046"></a>00046                                                                                                 iConsole(aConsole),
       
    41 <a name="l00047"></a>00047                                                                                                 <span class="comment">// Initialize the iterator.</span>
       
    42 <a name="l00048"></a>00048                                                                                                 iIterator(iNumber)
       
    43 <a name="l00049"></a>00049         {
       
    44 <a name="l00050"></a>00050         }
       
    45 <a name="l00051"></a>00051 
       
    46 <a name="l00052"></a>00052 
       
    47 <a name="l00056"></a><a class="code" href="class_c_long_number.html#1c0ebc1c9dbcc9c34250ffef859b8a2f">00056</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#1c0ebc1c9dbcc9c34250ffef859b8a2f">CLongNumber::AddToScheduler</a>()
       
    48 <a name="l00057"></a>00057         {
       
    49 <a name="l00058"></a>00058         CActiveScheduler::Add(<span class="keyword">this</span>);
       
    50 <a name="l00059"></a>00059         }
       
    51 <a name="l00060"></a>00060 
       
    52 <a name="l00064"></a><a class="code" href="class_c_long_number.html#1b7d3d5b97621f32d776d9b1a0d19d8a">00064</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#1b7d3d5b97621f32d776d9b1a0d19d8a">CLongNumber::RunL</a>()
       
    53 <a name="l00065"></a>00065         {
       
    54 <a name="l00066"></a>00066         <span class="comment">// Get the key code.</span>
       
    55 <a name="l00067"></a>00067         TUint8 option = iConsole-&gt;KeyCode();
       
    56 <a name="l00068"></a>00068         <span class="comment">// Print the selected option.</span>
       
    57 <a name="l00069"></a>00069         _LIT(KTextFormat,<span class="stringliteral">"%c\n"</span>);
       
    58 <a name="l00070"></a>00070         iConsole-&gt;Printf(KTextFormat,option);
       
    59 <a name="l00071"></a>00071 
       
    60 <a name="l00072"></a>00072         TInt number = option - (TUint)<span class="charliteral">'0'</span>;
       
    61 <a name="l00073"></a>00073         <span class="comment">// The user has entered a number.</span>
       
    62 <a name="l00074"></a>00074         <span class="keywordflow">if</span>(number &lt;10 &amp;&amp; number &gt; -1)
       
    63 <a name="l00075"></a>00075                 {
       
    64 <a name="l00076"></a>00076                 <span class="comment">// Append to the list based on iOption.</span>
       
    65 <a name="l00077"></a>00077                 <span class="keywordflow">switch</span>(iOption)
       
    66 <a name="l00078"></a>00078                         {
       
    67 <a name="l00079"></a>00079                         <span class="comment">// Call the TSglQue::AddFirst() function.</span>
       
    68 <a name="l00080"></a>00080                         <span class="keywordflow">case</span> EAddFirst:
       
    69 <a name="l00081"></a>00081                                 {
       
    70 <a name="l00082"></a>00082                                 <span class="comment">// Create an object of the TDigit class.</span>
       
    71 <a name="l00083"></a>00083                                 <a class="code" href="class_t_digit.html">TDigit</a>* digit = <span class="keyword">new</span> (ELeave) <a class="code" href="class_t_digit.html">TDigit</a>;
       
    72 <a name="l00084"></a>00084                                 <span class="comment">// Set TDigit::iDigit to the number entered by the user.</span>
       
    73 <a name="l00085"></a>00085                                 digit-&gt;<a class="code" href="class_t_digit.html#47ece24e5d32c125a2afea13179c6b65">Set</a>(number);
       
    74 <a name="l00086"></a>00086                                 <span class="comment">// Add TDigit to the start of the list.</span>
       
    75 <a name="l00087"></a>00087                                 iNumber.AddFirst(*digit);
       
    76 <a name="l00088"></a>00088                                 iOption = ETOptionNone;
       
    77 <a name="l00089"></a>00089                                 }
       
    78 <a name="l00090"></a>00090                                 <span class="comment">// Print the number.</span>
       
    79 <a name="l00091"></a>00091                                 <a class="code" href="class_c_long_number.html#ec695d1da24cd27f36fed7c4f0ffe0a6">PrintNumber</a>();
       
    80 <a name="l00092"></a>00092                                 <span class="keywordflow">break</span>;
       
    81 <a name="l00093"></a>00093                         <span class="comment">// Call the TSglQue::AddLast() function.</span>
       
    82 <a name="l00094"></a>00094                         <span class="keywordflow">case</span> EAddLast:
       
    83 <a name="l00095"></a>00095                                 {
       
    84 <a name="l00096"></a>00096                                 <span class="comment">// Create an object of the TDigit class.</span>
       
    85 <a name="l00097"></a>00097                                 <a class="code" href="class_t_digit.html">TDigit</a>* digit = <span class="keyword">new</span> (ELeave) <a class="code" href="class_t_digit.html">TDigit</a>;
       
    86 <a name="l00098"></a>00098                                 <span class="comment">// Set TDigit::iDigit to the number entered by the user.</span>
       
    87 <a name="l00099"></a>00099                                 digit-&gt;<a class="code" href="class_t_digit.html#47ece24e5d32c125a2afea13179c6b65">Set</a>(number);
       
    88 <a name="l00100"></a>00100                                 <span class="comment">// Add TDigit to the end of the list.</span>
       
    89 <a name="l00101"></a>00101                                 iNumber.AddLast(*digit);
       
    90 <a name="l00102"></a>00102                                 iOption = ETOptionNone;
       
    91 <a name="l00103"></a>00103                                 }
       
    92 <a name="l00104"></a>00104                                 <span class="comment">// Print the number.</span>
       
    93 <a name="l00105"></a>00105                                 <a class="code" href="class_c_long_number.html#ec695d1da24cd27f36fed7c4f0ffe0a6">PrintNumber</a>();
       
    94 <a name="l00106"></a>00106                                 <span class="keywordflow">break</span>;
       
    95 <a name="l00107"></a>00107                         <span class="keywordflow">case</span> ETOptionNone:
       
    96 <a name="l00108"></a>00108                                 _LIT(KInvalidOption,<span class="stringliteral">"Invalid Option!\n"</span>);
       
    97 <a name="l00109"></a>00109                                 iConsole-&gt;Printf(KInvalidOption);
       
    98 <a name="l00110"></a>00110                                 <span class="keywordflow">break</span>;
       
    99 <a name="l00111"></a>00111                         <span class="keywordflow">default</span>:
       
   100 <a name="l00112"></a>00112                                 iOption = ETOptionNone;
       
   101 <a name="l00113"></a>00113                                 <span class="keywordflow">break</span>;
       
   102 <a name="l00114"></a>00114                         }
       
   103 <a name="l00115"></a>00115                 <span class="comment">// Generate an asynchronous read request.</span>
       
   104 <a name="l00116"></a>00116                 <a class="code" href="class_c_long_number.html#1b5d110a5df39ccfeda083160370dc5c">ReadNumber</a>();
       
   105 <a name="l00117"></a>00117                 }
       
   106 <a name="l00118"></a>00118         <span class="comment">// The user has not entered a number.</span>
       
   107 <a name="l00119"></a>00119         <span class="comment">// Hence, process this request as an option,</span>
       
   108 <a name="l00120"></a>00120         <span class="comment">// which represented by the TOption enumeration.</span>
       
   109 <a name="l00121"></a>00121         <span class="keywordflow">else</span>
       
   110 <a name="l00122"></a>00122                 {
       
   111 <a name="l00123"></a>00123                 <span class="keywordflow">switch</span>(option)
       
   112 <a name="l00124"></a>00124                         {
       
   113 <a name="l00125"></a>00125                         <span class="keywordflow">case</span> <span class="charliteral">'f'</span>:
       
   114 <a name="l00126"></a>00126                                 {
       
   115 <a name="l00127"></a>00127                                 <span class="comment">// Add first.</span>
       
   116 <a name="l00128"></a>00128                                 iOption = EAddFirst;
       
   117 <a name="l00129"></a>00129                                 _LIT(KTextEnterDigit,<span class="stringliteral">"\nEnter a digit\n"</span>);
       
   118 <a name="l00130"></a>00130                                 iConsole-&gt;Printf(KTextEnterDigit);
       
   119 <a name="l00131"></a>00131                                 <span class="comment">// Read a digit.</span>
       
   120 <a name="l00132"></a>00132                                 ReadFunc();
       
   121 <a name="l00133"></a>00133                                 }
       
   122 <a name="l00134"></a>00134                                 <span class="keywordflow">break</span>;
       
   123 <a name="l00135"></a>00135                         <span class="keywordflow">case</span> <span class="charliteral">'l'</span>:
       
   124 <a name="l00136"></a>00136                                 {
       
   125 <a name="l00137"></a>00137                                 <span class="comment">// Add last.</span>
       
   126 <a name="l00138"></a>00138                                 iOption = EAddLast;
       
   127 <a name="l00139"></a>00139                                 _LIT(KTextEnterDigit,<span class="stringliteral">"\nEnter a digit\n"</span>);
       
   128 <a name="l00140"></a>00140                                 iConsole-&gt;Printf(KTextEnterDigit);
       
   129 <a name="l00141"></a>00141                                 <span class="comment">// Read a digit.</span>
       
   130 <a name="l00142"></a>00142                                 ReadFunc();
       
   131 <a name="l00143"></a>00143                                 }
       
   132 <a name="l00144"></a>00144                                 <span class="keywordflow">break</span>;
       
   133 <a name="l00145"></a>00145                         <span class="keywordflow">case</span> <span class="charliteral">'r'</span>:
       
   134 <a name="l00146"></a>00146                                 {
       
   135 <a name="l00147"></a>00147                                 <span class="keywordflow">if</span>(iNumber.IsEmpty())
       
   136 <a name="l00148"></a>00148                                         {
       
   137 <a name="l00149"></a>00149                                         _LIT(KTextEmpty,<span class="stringliteral">"Empty Queue !\n"</span>);
       
   138 <a name="l00150"></a>00150                                         iConsole-&gt;Printf(KTextEmpty);
       
   139 <a name="l00151"></a>00151                                         <a class="code" href="class_c_long_number.html#1b5d110a5df39ccfeda083160370dc5c">ReadNumber</a>();
       
   140 <a name="l00152"></a>00152                                         <span class="keywordflow">break</span>;
       
   141 <a name="l00153"></a>00153                                         }
       
   142 <a name="l00154"></a>00154                                 <span class="comment">// Remove the last element in the list.</span>
       
   143 <a name="l00155"></a>00155                                 <a class="code" href="class_t_digit.html">TDigit</a>* ptr = iNumber.Last();
       
   144 <a name="l00156"></a>00156                                 iNumber.Remove(*ptr);
       
   145 <a name="l00157"></a>00157                                 <span class="keyword">delete</span> ptr;
       
   146 <a name="l00158"></a>00158                                 <span class="comment">// Print the number.</span>
       
   147 <a name="l00159"></a>00159                                 <a class="code" href="class_c_long_number.html#ec695d1da24cd27f36fed7c4f0ffe0a6">PrintNumber</a>();
       
   148 <a name="l00160"></a>00160                                 <span class="comment">// Read a digit.</span>
       
   149 <a name="l00161"></a>00161                                 <a class="code" href="class_c_long_number.html#1b5d110a5df39ccfeda083160370dc5c">ReadNumber</a>();
       
   150 <a name="l00162"></a>00162                                 }
       
   151 <a name="l00163"></a>00163                                 <span class="keywordflow">break</span>;
       
   152 <a name="l00164"></a>00164                         <span class="keywordflow">default</span>:
       
   153 <a name="l00165"></a>00165                                 CActiveScheduler::Stop();
       
   154 <a name="l00166"></a>00166                         }
       
   155 <a name="l00167"></a>00167                 }
       
   156 <a name="l00168"></a>00168         }
       
   157 <a name="l00169"></a>00169 
       
   158 <a name="l00173"></a>00173 <span class="keywordtype">void</span> CLongNumber::ReadFunc()
       
   159 <a name="l00174"></a>00174         {
       
   160 <a name="l00175"></a>00175         <span class="comment">// Wait for a key press event.</span>
       
   161 <a name="l00176"></a>00176         iConsole-&gt;Read(iStatus);
       
   162 <a name="l00177"></a>00177         SetActive();
       
   163 <a name="l00178"></a>00178         }
       
   164 <a name="l00179"></a>00179 
       
   165 <a name="l00183"></a><a class="code" href="class_c_long_number.html#1b5d110a5df39ccfeda083160370dc5c">00183</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#1b5d110a5df39ccfeda083160370dc5c">CLongNumber::ReadNumber</a>()
       
   166 <a name="l00184"></a>00184         {
       
   167 <a name="l00185"></a>00185         _LIT(KTextMenu,<span class="stringliteral">"\nMenu\n***\nAdd [f]irst digit to number\nAdd [l]ast digit to number\n[r]emove last digit from number\nAny other NON-NUMERIC key to stop\n***\n"</span>);
       
   168 <a name="l00186"></a>00186         iConsole-&gt;Printf(KTextMenu);
       
   169 <a name="l00187"></a>00187         ReadFunc();
       
   170 <a name="l00188"></a>00188         }
       
   171 <a name="l00189"></a>00189 
       
   172 <a name="l00193"></a><a class="code" href="class_c_long_number.html#ec695d1da24cd27f36fed7c4f0ffe0a6">00193</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#ec695d1da24cd27f36fed7c4f0ffe0a6">CLongNumber::PrintNumber</a>()
       
   173 <a name="l00194"></a>00194         {
       
   174 <a name="l00195"></a>00195         <span class="keywordflow">if</span>(iNumber.IsEmpty())
       
   175 <a name="l00196"></a>00196                 {
       
   176 <a name="l00197"></a>00197                 _LIT(KTextEmpty,<span class="stringliteral">"Empty Queue !\n"</span>);
       
   177 <a name="l00198"></a>00198                 iConsole-&gt;Printf(KTextEmpty);                                                   
       
   178 <a name="l00199"></a>00199                 }
       
   179 <a name="l00200"></a>00200         _LIT(KTextNumber,<span class="stringliteral">"The number is: "</span>);
       
   180 <a name="l00201"></a>00201         iConsole-&gt;Printf(KTextNumber);
       
   181 <a name="l00202"></a>00202         <span class="comment">// Set the iterator to the first element of the list.</span>
       
   182 <a name="l00203"></a>00203         iIterator.SetToFirst();
       
   183 <a name="l00204"></a>00204 
       
   184 <a name="l00205"></a>00205         <span class="comment">// Iterate the list.</span>
       
   185 <a name="l00206"></a>00206         <span class="keywordflow">while</span>(iIterator != NULL)
       
   186 <a name="l00207"></a>00207                 {
       
   187 <a name="l00208"></a>00208                 <span class="comment">// Get the digit.</span>
       
   188 <a name="l00209"></a>00209                 <a class="code" href="class_t_digit.html">TDigit</a> digit = *iIterator;
       
   189 <a name="l00210"></a>00210                 <span class="comment">// Print the digit.</span>
       
   190 <a name="l00211"></a>00211                 _LIT(KTextInt,<span class="stringliteral">"%d"</span>);
       
   191 <a name="l00212"></a>00212                 iConsole-&gt;Printf(KTextInt,digit.<a class="code" href="class_t_digit.html#c59dd51bd32a1a8f614f96093ca29937">Get</a>());
       
   192 <a name="l00213"></a>00213                 <span class="comment">// Go to the next element of the list.</span>
       
   193 <a name="l00214"></a>00214                 iIterator++;
       
   194 <a name="l00215"></a>00215                 }
       
   195 <a name="l00216"></a>00216         }
       
   196 <a name="l00217"></a>00217 
       
   197 <a name="l00221"></a><a class="code" href="class_c_long_number.html#a7b7c59251aa6d2ffc25f0ec9312b59d">00221</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#a7b7c59251aa6d2ffc25f0ec9312b59d">CLongNumber::InitializeIter</a>()
       
   198 <a name="l00222"></a>00222         {
       
   199 <a name="l00223"></a>00223         iIterator.SetToFirst();
       
   200 <a name="l00224"></a>00224         }
       
   201 <a name="l00225"></a>00225 
       
   202 <a name="l00232"></a><a class="code" href="class_c_long_number.html#5ef806e05880bcf07c0506bd36beefe0">00232</a> TBool <a class="code" href="class_c_long_number.html#5ef806e05880bcf07c0506bd36beefe0">CLongNumber::GetNumber</a>(TInt&amp; aValue)
       
   203 <a name="l00233"></a>00233         {
       
   204 <a name="l00234"></a>00234         <span class="keywordflow">if</span>(iIterator == NULL)
       
   205 <a name="l00235"></a>00235                 {
       
   206 <a name="l00236"></a>00236                 <span class="comment">// The iterator has reached the end of the list.</span>
       
   207 <a name="l00237"></a>00237                 <span class="keywordflow">return</span> EFalse;
       
   208 <a name="l00238"></a>00238                 }
       
   209 <a name="l00239"></a>00239         <a class="code" href="class_t_digit.html">TDigit</a> digit = *iIterator;
       
   210 <a name="l00240"></a>00240         aValue = digit.<a class="code" href="class_t_digit.html#c59dd51bd32a1a8f614f96093ca29937">Get</a>();
       
   211 <a name="l00241"></a>00241         <span class="keywordflow">return</span> ETrue;
       
   212 <a name="l00242"></a>00242         }
       
   213 <a name="l00243"></a>00243 
       
   214 <a name="l00248"></a><a class="code" href="class_c_long_number.html#e717f76bb1203c1c495b5e37fa4d8ff9">00248</a> TBool <a class="code" href="class_c_long_number.html#e717f76bb1203c1c495b5e37fa4d8ff9">CLongNumber::Slide</a>()
       
   215 <a name="l00249"></a>00249         {
       
   216 <a name="l00250"></a>00250         <span class="comment">// Set the iterator to point to the next element.</span>
       
   217 <a name="l00251"></a>00251         iIterator++;
       
   218 <a name="l00252"></a>00252         <span class="keywordflow">if</span>(iIterator == NULL)
       
   219 <a name="l00253"></a>00253                 {
       
   220 <a name="l00254"></a>00254                 <span class="comment">// The iterator has reached the end of the list.</span>
       
   221 <a name="l00255"></a>00255                 <span class="keywordflow">return</span> EFalse;
       
   222 <a name="l00256"></a>00256                 }
       
   223 <a name="l00257"></a>00257         <span class="keywordflow">return</span> ETrue;
       
   224 <a name="l00258"></a>00258         }
       
   225 <a name="l00259"></a>00259 
       
   226 <a name="l00263"></a><a class="code" href="class_c_long_number.html#7039dbe9ebbf42b59f919ba2755dd8a3">00263</a> <span class="keywordtype">void</span> <a class="code" href="class_c_long_number.html#7039dbe9ebbf42b59f919ba2755dd8a3">CLongNumber::DoCancel</a>()
       
   227 <a name="l00264"></a>00264         {
       
   228 <a name="l00265"></a>00265         <span class="keywordflow">if</span>(IsActive())
       
   229 <a name="l00266"></a>00266                 {
       
   230 <a name="l00267"></a>00267                 <span class="comment">// Cancel any outstanding read requests.</span>
       
   231 <a name="l00268"></a>00268                 iConsole-&gt;ReadCancel();
       
   232 <a name="l00269"></a>00269                 }
       
   233 <a name="l00270"></a>00270         }
       
   234 <a name="l00271"></a>00271 
       
   235 <a name="l00277"></a><a class="code" href="class_c_long_number.html#2112ad5c07adc10adf5d63c33ef2d5cd">00277</a> <a class="code" href="class_c_long_number.html#2112ad5c07adc10adf5d63c33ef2d5cd">CLongNumber::~CLongNumber</a>()
       
   236 <a name="l00278"></a>00278         {
       
   237 <a name="l00279"></a>00279         <span class="comment">// Delete the elements from the list</span>
       
   238 <a name="l00280"></a>00280         <span class="keywordflow">if</span>(iIterator)
       
   239 <a name="l00281"></a>00281                 {
       
   240 <a name="l00282"></a>00282                 iIterator.SetToFirst();
       
   241 <a name="l00283"></a>00283                 <span class="comment">// Iterate the list and delete all TDigit objects</span>
       
   242 <a name="l00284"></a>00284                 <a class="code" href="class_t_digit.html">TDigit</a> *ptr = iIterator++;
       
   243 <a name="l00285"></a>00285                 <span class="keywordflow">while</span> (ptr != NULL)
       
   244 <a name="l00286"></a>00286                         {
       
   245 <a name="l00287"></a>00287                         <span class="keyword">delete</span> ptr;
       
   246 <a name="l00288"></a>00288                         ptr = iIterator++;
       
   247 <a name="l00289"></a>00289                         }
       
   248 <a name="l00290"></a>00290                 }
       
   249 <a name="l00291"></a>00291         }
       
   250 </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:55 2010 for TB10.1 Example Applications by&nbsp;
       
   251 <a href="http://www.doxygen.org/index.html">
       
   252 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
       
   253 </body>
       
   254 </html>