Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_semaphore_example.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TB9.2 Example Applications: CSemaphoreExample Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<div class="contents">
<h1>CSemaphoreExample Class Reference</h1><!-- doxytag: class="CSemaphoreExample" -->
<p><a href="class_c_semaphore_example-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#aa1bde5ce9ac1befd3249c4ea56a2d214">~CSemaphoreExample</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#a518cb178a863033b0eb4899035802924">StartThreads</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9760b73a11133bc1237d09ae2fc58242"></a><!-- doxytag: member="CSemaphoreExample::PrintMessage" ref="a9760b73a11133bc1237d09ae2fc58242" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>PrintMessage</b> ()</td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_c_semaphore_example.html">CSemaphoreExample</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#a12ed690de78daccf113004ba4ba02f42">NewL</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#a9a32bdc9ccf1e50c38b4accb4d7dfa56">ReadThreadFuncL</a> (TAny *aPtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#a38d9e05692b6122e501d04a4c481bdeb">WriteThreadFuncL</a> (TAny *aPtr)</td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_semaphore_example.html#a206ff3d040178008062e201ecf67577f">ConstructL</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This class is the main class which starts the application, and starts two threads to read to/write from a database. </p>

<p>Definition at line <a class="el" href="_semaphore_example_8h_source.html#l00027">27</a> of file <a class="el" href="_semaphore_example_8h_source.html">SemaphoreExample.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa1bde5ce9ac1befd3249c4ea56a2d214"></a><!-- doxytag: member="CSemaphoreExample::~CSemaphoreExample" ref="aa1bde5ce9ac1befd3249c4ea56a2d214" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CSemaphoreExample::~CSemaphoreExample </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destructor </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00023">23</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a12ed690de78daccf113004ba4ba02f42"></a><!-- doxytag: member="CSemaphoreExample::NewL" ref="a12ed690de78daccf113004ba4ba02f42" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_c_semaphore_example.html">CSemaphoreExample</a> * CSemaphoreExample::NewL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><a class="el" href="class_c_semaphore_example.html#a12ed690de78daccf113004ba4ba02f42">NewL()</a> </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00033">33</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9a32bdc9ccf1e50c38b4accb4d7dfa56"></a><!-- doxytag: member="CSemaphoreExample::ReadThreadFuncL" ref="a9a32bdc9ccf1e50c38b4accb4d7dfa56" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CSemaphoreExample::ReadThreadFuncL </td>
          <td>(</td>
          <td class="paramtype">TAny *&nbsp;</td>
          <td class="paramname"> <em>aPtr</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called when iReadThread is resumed. It creates a cleanup stack and calls ReadDbFunc(). </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00161">161</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a38d9e05692b6122e501d04a4c481bdeb"></a><!-- doxytag: member="CSemaphoreExample::WriteThreadFuncL" ref="a38d9e05692b6122e501d04a4c481bdeb" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CSemaphoreExample::WriteThreadFuncL </td>
          <td>(</td>
          <td class="paramtype">TAny *&nbsp;</td>
          <td class="paramname"> <em>aPtr</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called when iWriteThread is resumed. It creates a cleanup stack and calls WriteDbFunc(). </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00208">208</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a518cb178a863033b0eb4899035802924"></a><!-- doxytag: member="CSemaphoreExample::StartThreads" ref="a518cb178a863033b0eb4899035802924" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CSemaphoreExample::StartThreads </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Starts iReadThread and iWriteThread. </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00070">70</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a206ff3d040178008062e201ecf67577f"></a><!-- doxytag: member="CSemaphoreExample::ConstructL" ref="a206ff3d040178008062e201ecf67577f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CSemaphoreExample::ConstructL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates and resumes two threads, one for reading from the database and other for writing into the database. Prints messages to console depending on whether the USE_SEMAPHORE macro is enabled or disabled. </p>

<p>Definition at line <a class="el" href="_semaphore_example_8cpp_source.html#l00046">46</a> of file <a class="el" href="_semaphore_example_8cpp_source.html">SemaphoreExample.cpp</a>.</p>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>