Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_database.html
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>TB10.1 Example Applications: CDatabase Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<h1>CDatabase Class Reference</h1><!-- doxytag: class="CDatabase" -->
<p>
<a href="class_c_database-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#9a3adb67c04d4f1432556aab4149841e">~CDatabase</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#89047671e6c027e4551a8b7a276add96">CreateDatabaseL</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#e9fea33b26bf2ba7cdad59361ee45221">ReadfromDatabaseL</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#5df7d7393cfb36c850d562df4f35a0f6">WritetoDatabaseL</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#3546e400216858a7ae560808a9d1465e">PeriodicReadFuncL</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#4a0f7606f98a6db98addb52a7ca2b881">PeriodicWriteFuncL</a> ()</td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="class_c_database.html">CDatabase</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#ab355b9be127debd7a5d54e5ac8f9021">NewL</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static TInt </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#26f8d942e0dc5c8050afd5cbb0d80f18">PeriodicReadL</a> (TAny *aPtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static TInt </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#726242c03596e80a98deeef4c5c1681c">PeriodicWriteL</a> (TAny *aPtr)</td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_database.html#d3d6215a0fa65e7ead3533065905a747">ConstructL</a> ()</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This is a database class which is used by two different threads to demonstrate thread synchronization using a semaphore.
<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 & Destructor Documentation</h2>
<a class="anchor" name="9a3adb67c04d4f1432556aab4149841e"></a><!-- doxytag: member="CDatabase::~CDatabase" ref="9a3adb67c04d4f1432556aab4149841e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CDatabase::~CDatabase </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Destructor
<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><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ab355b9be127debd7a5d54e5ac8f9021"></a><!-- doxytag: member="CDatabase::NewL" ref="ab355b9be127debd7a5d54e5ac8f9021" 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> ) </td>
<td width="100%"><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<a class="el" href="class_c_database.html#ab355b9be127debd7a5d54e5ac8f9021">NewL()</a>
<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><p>
<a class="anchor" name="89047671e6c027e4551a8b7a276add96"></a><!-- doxytag: member="CDatabase::CreateDatabaseL" ref="89047671e6c027e4551a8b7a276add96" 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> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates database in the store and create a table and add columns to it.
<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><p>
<a class="anchor" name="e9fea33b26bf2ba7cdad59361ee45221"></a><!-- doxytag: member="CDatabase::ReadfromDatabaseL" ref="e9fea33b26bf2ba7cdad59361ee45221" 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> ) </td>
<td width="100%"></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>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><p>
<a class="anchor" name="5df7d7393cfb36c850d562df4f35a0f6"></a><!-- doxytag: member="CDatabase::WritetoDatabaseL" ref="5df7d7393cfb36c850d562df4f35a0f6" 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> ) </td>
<td width="100%"></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>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><p>
<a class="anchor" name="26f8d942e0dc5c8050afd5cbb0d80f18"></a><!-- doxytag: member="CDatabase::PeriodicReadL" ref="26f8d942e0dc5c8050afd5cbb0d80f18" 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 * </td>
<td class="paramname"> <em>aPtr</em> </td>
<td> ) </td>
<td width="100%"><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#e9fea33b26bf2ba7cdad59361ee45221">ReadfromDatabaseL()</a> function.
<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><p>
<a class="anchor" name="3546e400216858a7ae560808a9d1465e"></a><!-- doxytag: member="CDatabase::PeriodicReadFuncL" ref="3546e400216858a7ae560808a9d1465e" 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> ) </td>
<td width="100%"></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>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><p>
<a class="anchor" name="726242c03596e80a98deeef4c5c1681c"></a><!-- doxytag: member="CDatabase::PeriodicWriteL" ref="726242c03596e80a98deeef4c5c1681c" 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 * </td>
<td class="paramname"> <em>aPtr</em> </td>
<td> ) </td>
<td width="100%"><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#5df7d7393cfb36c850d562df4f35a0f6">WritetoDatabaseL()</a> function.
<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><p>
<a class="anchor" name="4a0f7606f98a6db98addb52a7ca2b881"></a><!-- doxytag: member="CDatabase::PeriodicWriteFuncL" ref="4a0f7606f98a6db98addb52a7ca2b881" 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> ) </td>
<td width="100%"></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>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><p>
<a class="anchor" name="d3d6215a0fa65e7ead3533065905a747"></a><!-- doxytag: member="CDatabase::ConstructL" ref="d3d6215a0fa65e7ead3533065905a747" 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> ) </td>
<td width="100%"><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Constructs a CPeriodic object, a database , opens the global semaphore.
<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><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:04 2010 for TB10.1 Example Applications by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>