Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_smp_example.html
changeset 1 25a17d01db0c
child 6 43e37759235e
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: CSmpExample Class Reference</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>CSmpExample Class Reference</h1><!-- doxytag: class="CSmpExample" -->
       
     9 <p>
       
    10 <a href="class_c_smp_example-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
       
    11 <tr><td></td></tr>
       
    12 <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
       
    13 <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#4f902855860346e1529c8aad989100f0">~CSmpExample</a> ()</td></tr>
       
    14 
       
    15 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#6ed7d09453967159b3cb9cb8c271aeab">CreateDatabaseL</a> (const TDesC &amp;aDbName)</td></tr>
       
    16 
       
    17 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#8eaf4cbbf9c4b69d0854140963a22e51">PrintMessage</a> ()</td></tr>
       
    18 
       
    19 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#fdb87a66a6b0a41cbea465aa2495aa1c">StartThreads</a> ()</td></tr>
       
    20 
       
    21 <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
       
    22 <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="class_c_smp_example.html">CSmpExample</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#af2dab332a98167a1dde6309732a2460">NewL</a> ()</td></tr>
       
    23 
       
    24 <tr><td class="memItemLeft" nowrap align="right" valign="top">static TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#c56a561b32603f3d9fccb186b90ee28b">ReadThreadFuncL</a> (TAny *aPtr)</td></tr>
       
    25 
       
    26 <tr><td class="memItemLeft" nowrap align="right" valign="top">static TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#3a99e9be00e57c1d8489de6f62d00a2b">WriteThread1FuncL</a> (TAny *aPtr)</td></tr>
       
    27 
       
    28 <tr><td class="memItemLeft" nowrap align="right" valign="top">static TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#41ccf5be445f2ad57cee4fa93b8830c6">WriteThread2FuncL</a> (TAny *aPtr)</td></tr>
       
    29 
       
    30 <tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#70e2ac4866c0bea841d38203ae2f6194">ReadBothDatabasesL</a> ()</td></tr>
       
    31 
       
    32 <tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#3b589411b99d71c460442290516e04ec">ReadDatabaseL</a> (const TDesC &amp;aDbName, CConsoleBase &amp;<a class="el" href="localeupdate_8cpp.html#d789d40251baeb2f60e118de4856583d">console</a>)</td></tr>
       
    33 
       
    34 <tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#26abdb02599626bb596e73e90a145037">WriteDbFuncL</a> (const TDesC &amp;aDbName, TInt aNum)</td></tr>
       
    35 
       
    36 <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
       
    37 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_smp_example.html#a9bbdb0f3c1cb00236cf6eedc2fe0840">ConstructL</a> ()</td></tr>
       
    38 
       
    39 </table>
       
    40 <hr><a name="_details"></a><h2>Detailed Description</h2>
       
    41 This class creates three threads to demonstrate multithreading in a unicore and a SMP environment. 
       
    42 <p>Definition at line <a class="el" href="_smp_example_8h-source.html#l00028">28</a> of file <a class="el" href="_smp_example_8h-source.html">SmpExample.h</a>.</p>
       
    43 <hr><h2>Constructor &amp; Destructor Documentation</h2>
       
    44 <a class="anchor" name="4f902855860346e1529c8aad989100f0"></a><!-- doxytag: member="CSmpExample::~CSmpExample" ref="4f902855860346e1529c8aad989100f0" args="()" -->
       
    45 <div class="memitem">
       
    46 <div class="memproto">
       
    47       <table class="memname">
       
    48         <tr>
       
    49           <td class="memname">CSmpExample::~CSmpExample           </td>
       
    50           <td>(</td>
       
    51           <td class="paramname">          </td>
       
    52           <td>&nbsp;)&nbsp;</td>
       
    53           <td width="100%"><code> [virtual]</code></td>
       
    54         </tr>
       
    55       </table>
       
    56 </div>
       
    57 <div class="memdoc">
       
    58 
       
    59 <p>
       
    60 Destructor 
       
    61 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00022">22</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
    62 
       
    63 </div>
       
    64 </div><p>
       
    65 <hr><h2>Member Function Documentation</h2>
       
    66 <a class="anchor" name="af2dab332a98167a1dde6309732a2460"></a><!-- doxytag: member="CSmpExample::NewL" ref="af2dab332a98167a1dde6309732a2460" args="()" -->
       
    67 <div class="memitem">
       
    68 <div class="memproto">
       
    69       <table class="memname">
       
    70         <tr>
       
    71           <td class="memname"><a class="el" href="class_c_smp_example.html">CSmpExample</a> * CSmpExample::NewL           </td>
       
    72           <td>(</td>
       
    73           <td class="paramname">          </td>
       
    74           <td>&nbsp;)&nbsp;</td>
       
    75           <td width="100%"><code> [static]</code></td>
       
    76         </tr>
       
    77       </table>
       
    78 </div>
       
    79 <div class="memdoc">
       
    80 
       
    81 <p>
       
    82 <a class="el" href="class_c_smp_example.html#af2dab332a98167a1dde6309732a2460">NewL()</a> 
       
    83 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00033">33</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
    84 
       
    85 </div>
       
    86 </div><p>
       
    87 <a class="anchor" name="6ed7d09453967159b3cb9cb8c271aeab"></a><!-- doxytag: member="CSmpExample::CreateDatabaseL" ref="6ed7d09453967159b3cb9cb8c271aeab" args="(const TDesC &amp;aDbName)" -->
       
    88 <div class="memitem">
       
    89 <div class="memproto">
       
    90       <table class="memname">
       
    91         <tr>
       
    92           <td class="memname">void CSmpExample::CreateDatabaseL           </td>
       
    93           <td>(</td>
       
    94           <td class="paramtype">const TDesC &amp;&nbsp;</td>
       
    95           <td class="paramname"> <em>aDbName</em>          </td>
       
    96           <td>&nbsp;)&nbsp;</td>
       
    97           <td width="100%"></td>
       
    98         </tr>
       
    99       </table>
       
   100 </div>
       
   101 <div class="memdoc">
       
   102 
       
   103 <p>
       
   104 Creates a named database with the name specified in the parameter, creates a table and adds columns to it. 
       
   105 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00351">351</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   106 
       
   107 </div>
       
   108 </div><p>
       
   109 <a class="anchor" name="c56a561b32603f3d9fccb186b90ee28b"></a><!-- doxytag: member="CSmpExample::ReadThreadFuncL" ref="c56a561b32603f3d9fccb186b90ee28b" args="(TAny *aPtr)" -->
       
   110 <div class="memitem">
       
   111 <div class="memproto">
       
   112       <table class="memname">
       
   113         <tr>
       
   114           <td class="memname">TInt CSmpExample::ReadThreadFuncL           </td>
       
   115           <td>(</td>
       
   116           <td class="paramtype">TAny *&nbsp;</td>
       
   117           <td class="paramname"> <em>aPtr</em>          </td>
       
   118           <td>&nbsp;)&nbsp;</td>
       
   119           <td width="100%"><code> [static]</code></td>
       
   120         </tr>
       
   121       </table>
       
   122 </div>
       
   123 <div class="memdoc">
       
   124 
       
   125 <p>
       
   126 This function is called when iReadThread is resumed. It creates a cleanup stack and calls <a class="el" href="class_c_smp_example.html#70e2ac4866c0bea841d38203ae2f6194">ReadBothDatabasesL()</a> to read both the databases. 
       
   127 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00220">220</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   128 
       
   129 </div>
       
   130 </div><p>
       
   131 <a class="anchor" name="3a99e9be00e57c1d8489de6f62d00a2b"></a><!-- doxytag: member="CSmpExample::WriteThread1FuncL" ref="3a99e9be00e57c1d8489de6f62d00a2b" args="(TAny *aPtr)" -->
       
   132 <div class="memitem">
       
   133 <div class="memproto">
       
   134       <table class="memname">
       
   135         <tr>
       
   136           <td class="memname">TInt CSmpExample::WriteThread1FuncL           </td>
       
   137           <td>(</td>
       
   138           <td class="paramtype">TAny *&nbsp;</td>
       
   139           <td class="paramname"> <em>aPtr</em>          </td>
       
   140           <td>&nbsp;)&nbsp;</td>
       
   141           <td width="100%"><code> [static]</code></td>
       
   142         </tr>
       
   143       </table>
       
   144 </div>
       
   145 <div class="memdoc">
       
   146 
       
   147 <p>
       
   148 This function is called when iWriteThread is resumed. It creates a cleanup stack and calls <a class="el" href="class_c_smp_example.html#26abdb02599626bb596e73e90a145037">WriteDbFuncL()</a> to write integers to KDatabase1. 
       
   149 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00324">324</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   150 
       
   151 </div>
       
   152 </div><p>
       
   153 <a class="anchor" name="41ccf5be445f2ad57cee4fa93b8830c6"></a><!-- doxytag: member="CSmpExample::WriteThread2FuncL" ref="41ccf5be445f2ad57cee4fa93b8830c6" args="(TAny *aPtr)" -->
       
   154 <div class="memitem">
       
   155 <div class="memproto">
       
   156       <table class="memname">
       
   157         <tr>
       
   158           <td class="memname">TInt CSmpExample::WriteThread2FuncL           </td>
       
   159           <td>(</td>
       
   160           <td class="paramtype">TAny *&nbsp;</td>
       
   161           <td class="paramname"> <em>aPtr</em>          </td>
       
   162           <td>&nbsp;)&nbsp;</td>
       
   163           <td width="100%"><code> [static]</code></td>
       
   164         </tr>
       
   165       </table>
       
   166 </div>
       
   167 <div class="memdoc">
       
   168 
       
   169 <p>
       
   170 This function is called when iWriteThread is resumed. It creates a cleanup stack and calls <a class="el" href="class_c_smp_example.html#26abdb02599626bb596e73e90a145037">WriteDbFuncL()</a> to write integers to KDatabase2. 
       
   171 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00297">297</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   172 
       
   173 </div>
       
   174 </div><p>
       
   175 <a class="anchor" name="70e2ac4866c0bea841d38203ae2f6194"></a><!-- doxytag: member="CSmpExample::ReadBothDatabasesL" ref="70e2ac4866c0bea841d38203ae2f6194" args="()" -->
       
   176 <div class="memitem">
       
   177 <div class="memproto">
       
   178       <table class="memname">
       
   179         <tr>
       
   180           <td class="memname">void CSmpExample::ReadBothDatabasesL           </td>
       
   181           <td>(</td>
       
   182           <td class="paramname">          </td>
       
   183           <td>&nbsp;)&nbsp;</td>
       
   184           <td width="100%"><code> [static]</code></td>
       
   185         </tr>
       
   186       </table>
       
   187 </div>
       
   188 <div class="memdoc">
       
   189 
       
   190 <p>
       
   191 Creates a console, reads the databases and prints output to the console. 
       
   192 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00199">199</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   193 
       
   194 </div>
       
   195 </div><p>
       
   196 <a class="anchor" name="3b589411b99d71c460442290516e04ec"></a><!-- doxytag: member="CSmpExample::ReadDatabaseL" ref="3b589411b99d71c460442290516e04ec" args="(const TDesC &amp;aDbName, CConsoleBase &amp;console)" -->
       
   197 <div class="memitem">
       
   198 <div class="memproto">
       
   199       <table class="memname">
       
   200         <tr>
       
   201           <td class="memname">void CSmpExample::ReadDatabaseL           </td>
       
   202           <td>(</td>
       
   203           <td class="paramtype">const TDesC &amp;&nbsp;</td>
       
   204           <td class="paramname"> <em>aDbName</em>, </td>
       
   205         </tr>
       
   206         <tr>
       
   207           <td class="paramkey"></td>
       
   208           <td></td>
       
   209           <td class="paramtype">CConsoleBase &amp;&nbsp;</td>
       
   210           <td class="paramname"> <em>console</em></td><td>&nbsp;</td>
       
   211         </tr>
       
   212         <tr>
       
   213           <td></td>
       
   214           <td>)</td>
       
   215           <td></td><td></td><td width="100%"><code> [static]</code></td>
       
   216         </tr>
       
   217       </table>
       
   218 </div>
       
   219 <div class="memdoc">
       
   220 
       
   221 <p>
       
   222 Opens the database named in the first parameter, reads it and prints the output to the console. 
       
   223 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00131">131</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   224 
       
   225 </div>
       
   226 </div><p>
       
   227 <a class="anchor" name="26abdb02599626bb596e73e90a145037"></a><!-- doxytag: member="CSmpExample::WriteDbFuncL" ref="26abdb02599626bb596e73e90a145037" args="(const TDesC &amp;aDbName, TInt aNum)" -->
       
   228 <div class="memitem">
       
   229 <div class="memproto">
       
   230       <table class="memname">
       
   231         <tr>
       
   232           <td class="memname">void CSmpExample::WriteDbFuncL           </td>
       
   233           <td>(</td>
       
   234           <td class="paramtype">const TDesC &amp;&nbsp;</td>
       
   235           <td class="paramname"> <em>aDbName</em>, </td>
       
   236         </tr>
       
   237         <tr>
       
   238           <td class="paramkey"></td>
       
   239           <td></td>
       
   240           <td class="paramtype">TInt&nbsp;</td>
       
   241           <td class="paramname"> <em>aNum</em></td><td>&nbsp;</td>
       
   242         </tr>
       
   243         <tr>
       
   244           <td></td>
       
   245           <td>)</td>
       
   246           <td></td><td></td><td width="100%"><code> [static]</code></td>
       
   247         </tr>
       
   248       </table>
       
   249 </div>
       
   250 <div class="memdoc">
       
   251 
       
   252 <p>
       
   253 Opens the database specified in the first parameter aDbName and writes consecutive integers to it starting from the number specified in the second parameter aNum. 
       
   254 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00245">245</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   255 
       
   256 </div>
       
   257 </div><p>
       
   258 <a class="anchor" name="8eaf4cbbf9c4b69d0854140963a22e51"></a><!-- doxytag: member="CSmpExample::PrintMessage" ref="8eaf4cbbf9c4b69d0854140963a22e51" args="()" -->
       
   259 <div class="memitem">
       
   260 <div class="memproto">
       
   261       <table class="memname">
       
   262         <tr>
       
   263           <td class="memname">void CSmpExample::PrintMessage           </td>
       
   264           <td>(</td>
       
   265           <td class="paramname">          </td>
       
   266           <td>&nbsp;)&nbsp;</td>
       
   267           <td width="100%"></td>
       
   268         </tr>
       
   269       </table>
       
   270 </div>
       
   271 <div class="memdoc">
       
   272 
       
   273 <p>
       
   274 Prints welcome message and purpose of the example. 
       
   275 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00106">106</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   276 
       
   277 </div>
       
   278 </div><p>
       
   279 <a class="anchor" name="fdb87a66a6b0a41cbea465aa2495aa1c"></a><!-- doxytag: member="CSmpExample::StartThreads" ref="fdb87a66a6b0a41cbea465aa2495aa1c" args="()" -->
       
   280 <div class="memitem">
       
   281 <div class="memproto">
       
   282       <table class="memname">
       
   283         <tr>
       
   284           <td class="memname">void CSmpExample::StartThreads           </td>
       
   285           <td>(</td>
       
   286           <td class="paramname">          </td>
       
   287           <td>&nbsp;)&nbsp;</td>
       
   288           <td width="100%"></td>
       
   289         </tr>
       
   290       </table>
       
   291 </div>
       
   292 <div class="memdoc">
       
   293 
       
   294 <p>
       
   295 Starts the three threads 
       
   296 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00075">75</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   297 
       
   298 </div>
       
   299 </div><p>
       
   300 <a class="anchor" name="a9bbdb0f3c1cb00236cf6eedc2fe0840"></a><!-- doxytag: member="CSmpExample::ConstructL" ref="a9bbdb0f3c1cb00236cf6eedc2fe0840" args="()" -->
       
   301 <div class="memitem">
       
   302 <div class="memproto">
       
   303       <table class="memname">
       
   304         <tr>
       
   305           <td class="memname">void CSmpExample::ConstructL           </td>
       
   306           <td>(</td>
       
   307           <td class="paramname">          </td>
       
   308           <td>&nbsp;)&nbsp;</td>
       
   309           <td width="100%"><code> [protected]</code></td>
       
   310         </tr>
       
   311       </table>
       
   312 </div>
       
   313 <div class="memdoc">
       
   314 
       
   315 <p>
       
   316 Creates three threads; one for reading from the databases and the other two for writing to the databases. 
       
   317 <p>Definition at line <a class="el" href="_smp_example_8cpp-source.html#l00045">45</a> of file <a class="el" href="_smp_example_8cpp-source.html">SmpExample.cpp</a>.</p>
       
   318 
       
   319 </div>
       
   320 </div><p>
       
   321 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:07 2010 for TB10.1 Example Applications by&nbsp;
       
   322 <a href="http://www.doxygen.org/index.html">
       
   323 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
       
   324 </body>
       
   325 </html>