Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_database.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: CDatabase 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>CDatabase Class Reference</h1><!-- doxytag: class="CDatabase" -->
<p><a href="class_c_database-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_database.html#a9a3adb67c04d4f1432556aab4149841e">~CDatabase</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_database.html#a89047671e6c027e4551a8b7a276add96">CreateDatabaseL</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_database.html#ae9fea33b26bf2ba7cdad59361ee45221">ReadfromDatabaseL</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_database.html#a5df7d7393cfb36c850d562df4f35a0f6">WritetoDatabaseL</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_database.html#a3546e400216858a7ae560808a9d1465e">PeriodicReadFuncL</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_database.html#a4a0f7606f98a6db98addb52a7ca2b881">PeriodicWriteFuncL</a> ()</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_database.html">CDatabase</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#aab355b9be127debd7a5d54e5ac8f9021">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_database.html#a26f8d942e0dc5c8050afd5cbb0d80f18">PeriodicReadL</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_database.html#a726242c03596e80a98deeef4c5c1681c">PeriodicWriteL</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_database.html#ad3d6215a0fa65e7ead3533065905a747">ConstructL</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This is a database class which is used by two different threads to demonstrate thread synchronization using a semaphore. </p>

<p>Definition at line <a class="el" href="_c_database_8h_source.html#l00028">28</a> of file <a class="el" href="_c_database_8h_source.html">CDatabase.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9a3adb67c04d4f1432556aab4149841e"></a><!-- doxytag: member="CDatabase::~CDatabase" ref="a9a3adb67c04d4f1432556aab4149841e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CDatabase::~CDatabase </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="_c_database_8cpp_source.html#l00041">41</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aab355b9be127debd7a5d54e5ac8f9021"></a><!-- doxytag: member="CDatabase::NewL" ref="aab355b9be127debd7a5d54e5ac8f9021" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_c_database.html">CDatabase</a> * CDatabase::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_database.html#aab355b9be127debd7a5d54e5ac8f9021">NewL()</a> </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00029">29</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a89047671e6c027e4551a8b7a276add96"></a><!-- doxytag: member="CDatabase::CreateDatabaseL" ref="a89047671e6c027e4551a8b7a276add96" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::CreateDatabaseL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates database in the store and create a table and add columns to it. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00079">79</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae9fea33b26bf2ba7cdad59361ee45221"></a><!-- doxytag: member="CDatabase::ReadfromDatabaseL" ref="ae9fea33b26bf2ba7cdad59361ee45221" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::ReadfromDatabaseL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called by the ReaderThread in SemaphoreExample. It creates a console to display the data read from the database and starts a periodic function to read the database at an interval of 1 second. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00220">220</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a5df7d7393cfb36c850d562df4f35a0f6"></a><!-- doxytag: member="CDatabase::WritetoDatabaseL" ref="a5df7d7393cfb36c850d562df4f35a0f6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::WritetoDatabaseL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called by the WriteThread in the SemaphoreExample and it starts a periodic function to write data in the database at an interval of 1 sec. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00135">135</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a26f8d942e0dc5c8050afd5cbb0d80f18"></a><!-- doxytag: member="CDatabase::PeriodicReadL" ref="a26f8d942e0dc5c8050afd5cbb0d80f18" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CDatabase::PeriodicReadL </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>The call back function associated with the CPeriodic object of the <a class="el" href="class_c_database.html">CDatabase</a> class and is called by the <a class="el" href="class_c_database.html#ae9fea33b26bf2ba7cdad59361ee45221">ReadfromDatabaseL()</a> function. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00237">237</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3546e400216858a7ae560808a9d1465e"></a><!-- doxytag: member="CDatabase::PeriodicReadFuncL" ref="a3546e400216858a7ae560808a9d1465e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::PeriodicReadFuncL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called periodically at an interval of 1 second, it opens the database , reads one row and displays the numbers to the console. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00248">248</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a726242c03596e80a98deeef4c5c1681c"></a><!-- doxytag: member="CDatabase::PeriodicWriteL" ref="a726242c03596e80a98deeef4c5c1681c" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TInt CDatabase::PeriodicWriteL </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>The call back function associated with the CPeriodic object of the <a class="el" href="class_c_database.html">CDatabase</a> class and is called by the <a class="el" href="class_c_database.html#a5df7d7393cfb36c850d562df4f35a0f6">WritetoDatabaseL()</a> function. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00145">145</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a4a0f7606f98a6db98addb52a7ca2b881"></a><!-- doxytag: member="CDatabase::PeriodicWriteFuncL" ref="a4a0f7606f98a6db98addb52a7ca2b881" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::PeriodicWriteFuncL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function is called periodically at an interval of 1 sec, it opens the database, inserts one row and fills it with integer values. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00157">157</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ad3d6215a0fa65e7ead3533065905a747"></a><!-- doxytag: member="CDatabase::ConstructL" ref="ad3d6215a0fa65e7ead3533065905a747" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CDatabase::ConstructL </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs a CPeriodic object, a database , opens the global semaphore. </p>

<p>Definition at line <a class="el" href="_c_database_8cpp_source.html#l00054">54</a> of file <a class="el" href="_c_database_8cpp_source.html">CDatabase.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>