Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_producer.html
week 10 bug fix submission: Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
<!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: CProducer 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>CProducer Class Reference</h1><!-- doxytag: class="CProducer" -->
<p>
<a href="class_c_producer-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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_producer.html#0040101a0f8608387a61d40dcd1df1e1">ConstructL</a> (CConsoleBase *aConsole, <a class="el" href="class_c_queue.html">CQueue</a> *aTokens)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_producer.html#bcfcc99dcdc64e03c08243375822dcf0">ResumeProd</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_producer.html#18ffcf23a5cb4d45b6e4ed9399b4c026">Display</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_producer.html#0d0ebcf368ff02703286cfae62965e8f">Produce</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_producer.html#8edcde2babed9948f65057d75e6b3899">~CProducer</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_producer.html">CProducer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_producer.html#3897c9436f1aae1654b3ae1c5a4b6673">NewL</a> (CConsoleBase *aConsole, <a class="el" href="class_c_queue.html">CQueue</a> *aTokens)</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_producer.html#1dc386d260d55e131f450a61553a49c7">ProdThreadFunc</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_producer.html#2a8f3ef760142c8e424936df25c167d3">InsertFunction</a> (TAny *aPtr)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class owns the producer thread. It provides an interface to insert tokens into the CQueue::iArray queue. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_queue.html">CQueue</a>. <p>
CPeriodic. </dd></dl>
<p>Definition at line <a class="el" href="producer_8h-source.html#l00034">34</a> of file <a class="el" href="producer_8h-source.html">producer.h</a>.</p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="8edcde2babed9948f65057d75e6b3899"></a><!-- doxytag: member="CProducer::~CProducer" ref="8edcde2babed9948f65057d75e6b3899" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CProducer::~CProducer </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Destructor.
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00146">146</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="3897c9436f1aae1654b3ae1c5a4b6673"></a><!-- doxytag: member="CProducer::NewL" ref="3897c9436f1aae1654b3ae1c5a4b6673" args="(CConsoleBase *aConsole, CQueue *aTokens)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_c_producer.html">CProducer</a> * CProducer::NewL </td>
<td>(</td>
<td class="paramtype">CConsoleBase * </td>
<td class="paramname"> <em>aConsole</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_c_queue.html">CQueue</a> * </td>
<td class="paramname"> <em>aTokens</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Performs the two-phase construction of an object of the <a class="el" href="class_c_producer.html">CProducer</a> class. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>aConsole</em> </td><td>The console object. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>aTokens</em> </td><td>A pointer to the <a class="el" href="class_c_queue.html">CQueue</a> object containing the tokens' queue. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A <a class="el" href="class_c_producer.html">CProducer</a> object. </dd></dl>
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00031">31</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="0040101a0f8608387a61d40dcd1df1e1"></a><!-- doxytag: member="CProducer::ConstructL" ref="0040101a0f8608387a61d40dcd1df1e1" args="(CConsoleBase *aConsole, CQueue *aTokens)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CProducer::ConstructL </td>
<td>(</td>
<td class="paramtype">CConsoleBase * </td>
<td class="paramname"> <em>aConsole</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_c_queue.html">CQueue</a> * </td>
<td class="paramname"> <em>aTokens</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The second phase constructor of the <a class="el" href="class_c_producer.html">CProducer</a> class. It creates the following member objects of the class:<ul>
<li>iPeriodicProd</li><li>iProdThread The call back function of the iPeriodicProd object - <a class="el" href="class_c_producer.html#2a8f3ef760142c8e424936df25c167d3">InsertFunction()</a> invokes the iProdThread every second. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>aConsole</em> </td><td>The console object. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>aTokens</em> </td><td>A pointer to the <a class="el" href="class_c_queue.html">CQueue</a> object containing the tokens' queue. </td></tr>
</table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd>CPeriodic::Start(). <p>
RThread::Create(). </dd></dl>
</li></ul>
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00051">51</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="1dc386d260d55e131f450a61553a49c7"></a><!-- doxytag: member="CProducer::ProdThreadFunc" ref="1dc386d260d55e131f450a61553a49c7" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TInt CProducer::ProdThreadFunc </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 producer thread function. It inserts a token into the queue. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>aPtr</em> </td><td>A pointer to the arguments passed to the thread function. </td></tr>
</table>
</dl>
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00109">109</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="bcfcc99dcdc64e03c08243375822dcf0"></a><!-- doxytag: member="CProducer::ResumeProd" ref="bcfcc99dcdc64e03c08243375822dcf0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CProducer::ResumeProd </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Resumes the execution of the producer thread.
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00127">127</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="18ffcf23a5cb4d45b6e4ed9399b4c026"></a><!-- doxytag: member="CProducer::Display" ref="18ffcf23a5cb4d45b6e4ed9399b4c026" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CProducer::Display </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Displays the contents of the queue.
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00079">79</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="0d0ebcf368ff02703286cfae62965e8f"></a><!-- doxytag: member="CProducer::Produce" ref="0d0ebcf368ff02703286cfae62965e8f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CProducer::Produce </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Produce a token.
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00137">137</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="2a8f3ef760142c8e424936df25c167d3"></a><!-- doxytag: member="CProducer::InsertFunction" ref="2a8f3ef760142c8e424936df25c167d3" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TInt CProducer::InsertFunction </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_producer.html">CProducer</a> class. <dl class="see" compact><dt><b>See also:</b></dt><dd>CProducer::iPeriodicProd. <p>
CPeriodic. </dd></dl>
<p>Definition at line <a class="el" href="producer_8cpp-source.html#l00158">158</a> of file <a class="el" href="producer_8cpp-source.html">producer.cpp</a>.</p>
</div>
</div><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:07 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>