Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_consumer.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: CConsumer 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>CConsumer Class Reference</h1><!-- doxytag: class="CConsumer" -->
<p>
<a href="class_c_consumer-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_consumer.html#e769aaadb4500557f88dfe64755a4db5">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_consumer.html#7c2ffe71d0d3f918b183152bd285b417">ResumeCons</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b643d3f0daf4606eaf961709598104aa"></a><!-- doxytag: member="CConsumer::Consume" ref="b643d3f0daf4606eaf961709598104aa" args="()" -->
void </td><td class="memItemRight" valign="bottom"><b>Consume</b> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_consumer.html#19534e537b8036dac44e58a460ce7a01">~CConsumer</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_consumer.html">CConsumer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_consumer.html#7ba476d5a42cbd16448b540867bd141b">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_consumer.html#986aa37709261200c981221e8d6c093e">ConsThreadFunc</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_consumer.html#ee1ff1fbf228d676e06aa5bd7c1d9799">RemoveFunction</a> (TAny *aPtr)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class owns the consumer thread. It provides an interface to remove tokens from 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="consumer_8h-source.html#l00034">34</a> of file <a class="el" href="consumer_8h-source.html">consumer.h</a>.</p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="19534e537b8036dac44e58a460ce7a01"></a><!-- doxytag: member="CConsumer::~CConsumer" ref="19534e537b8036dac44e58a460ce7a01" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CConsumer::~CConsumer </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="consumer_8cpp-source.html#l00111">111</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="7ba476d5a42cbd16448b540867bd141b"></a><!-- doxytag: member="CConsumer::NewL" ref="7ba476d5a42cbd16448b540867bd141b" args="(CConsoleBase *aConsole, CQueue *aTokens)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_c_consumer.html">CConsumer</a> * CConsumer::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_consumer.html">CConsumer</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_consumer.html">CConsumer</a> object. </dd></dl>
<p>Definition at line <a class="el" href="consumer_8cpp-source.html#l00031">31</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="e769aaadb4500557f88dfe64755a4db5"></a><!-- doxytag: member="CConsumer::ConstructL" ref="e769aaadb4500557f88dfe64755a4db5" args="(CConsoleBase *aConsole, CQueue *aTokens)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CConsumer::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_consumer.html">CConsumer</a> class. It creates the following member objects of the class:<ul>
<li>iPeriodicCons</li><li>iConsThread The call back function of the iPeriodicCons object - <a class="el" href="class_c_consumer.html#ee1ff1fbf228d676e06aa5bd7c1d9799">RemoveFunction()</a> invokes the iConsThread 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="consumer_8cpp-source.html#l00051">51</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="986aa37709261200c981221e8d6c093e"></a><!-- doxytag: member="CConsumer::ConsThreadFunc" ref="986aa37709261200c981221e8d6c093e" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TInt CConsumer::ConsThreadFunc </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 consumer thread function. It removes a token from 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="consumer_8cpp-source.html#l00082">82</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="7c2ffe71d0d3f918b183152bd285b417"></a><!-- doxytag: member="CConsumer::ResumeCons" ref="7c2ffe71d0d3f918b183152bd285b417" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CConsumer::ResumeCons </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 consumer thread.
<p>Definition at line <a class="el" href="consumer_8cpp-source.html#l00101">101</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="ee1ff1fbf228d676e06aa5bd7c1d9799"></a><!-- doxytag: member="CConsumer::RemoveFunction" ref="ee1ff1fbf228d676e06aa5bd7c1d9799" args="(TAny *aPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TInt CConsumer::RemoveFunction </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_consumer.html">CConsumer</a> class. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_consumer.html#e769aaadb4500557f88dfe64755a4db5">CConsumer::ConstructL()</a>. <p>
CPeriodic. </dd></dl>
<p>Definition at line <a class="el" href="consumer_8cpp-source.html#l00123">123</a> of file <a class="el" href="consumer_8cpp-source.html">consumer.cpp</a>.</p>
</div>
</div><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:03 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>