|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
|
3 <title>TB10.1 Example Applications: CConsumer Class Reference</title> |
|
4 <link href="doxygen.css" rel="stylesheet" type="text/css"> |
|
5 <link href="tabs.css" rel="stylesheet" type="text/css"> |
|
6 </head><body> |
|
7 <!-- Generated by Doxygen 1.5.3 --> |
|
8 <h1>CConsumer Class Reference</h1><!-- doxytag: class="CConsumer" --> |
|
9 <p> |
|
10 <a href="class_c_consumer-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
|
11 <tr><td></td></tr> |
|
12 <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
|
13 <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> |
|
14 |
|
15 <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> |
|
16 |
|
17 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b643d3f0daf4606eaf961709598104aa"></a><!-- doxytag: member="CConsumer::Consume" ref="b643d3f0daf4606eaf961709598104aa" args="()" --> |
|
18 void </td><td class="memItemRight" valign="bottom"><b>Consume</b> ()</td></tr> |
|
19 |
|
20 <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> |
|
21 |
|
22 <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> |
|
23 <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> |
|
24 |
|
25 <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> |
|
26 |
|
27 <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> |
|
28 |
|
29 </table> |
|
30 <hr><a name="_details"></a><h2>Detailed Description</h2> |
|
31 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> |
|
32 CPeriodic. </dd></dl> |
|
33 |
|
34 <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> |
|
35 <hr><h2>Constructor & Destructor Documentation</h2> |
|
36 <a class="anchor" name="19534e537b8036dac44e58a460ce7a01"></a><!-- doxytag: member="CConsumer::~CConsumer" ref="19534e537b8036dac44e58a460ce7a01" args="()" --> |
|
37 <div class="memitem"> |
|
38 <div class="memproto"> |
|
39 <table class="memname"> |
|
40 <tr> |
|
41 <td class="memname">CConsumer::~CConsumer </td> |
|
42 <td>(</td> |
|
43 <td class="paramname"> </td> |
|
44 <td> ) </td> |
|
45 <td width="100%"></td> |
|
46 </tr> |
|
47 </table> |
|
48 </div> |
|
49 <div class="memdoc"> |
|
50 |
|
51 <p> |
|
52 Destructor. |
|
53 <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> |
|
54 |
|
55 </div> |
|
56 </div><p> |
|
57 <hr><h2>Member Function Documentation</h2> |
|
58 <a class="anchor" name="7ba476d5a42cbd16448b540867bd141b"></a><!-- doxytag: member="CConsumer::NewL" ref="7ba476d5a42cbd16448b540867bd141b" args="(CConsoleBase *aConsole, CQueue *aTokens)" --> |
|
59 <div class="memitem"> |
|
60 <div class="memproto"> |
|
61 <table class="memname"> |
|
62 <tr> |
|
63 <td class="memname"><a class="el" href="class_c_consumer.html">CConsumer</a> * CConsumer::NewL </td> |
|
64 <td>(</td> |
|
65 <td class="paramtype">CConsoleBase * </td> |
|
66 <td class="paramname"> <em>aConsole</em>, </td> |
|
67 </tr> |
|
68 <tr> |
|
69 <td class="paramkey"></td> |
|
70 <td></td> |
|
71 <td class="paramtype"><a class="el" href="class_c_queue.html">CQueue</a> * </td> |
|
72 <td class="paramname"> <em>aTokens</em></td><td> </td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td></td> |
|
76 <td>)</td> |
|
77 <td></td><td></td><td width="100%"><code> [static]</code></td> |
|
78 </tr> |
|
79 </table> |
|
80 </div> |
|
81 <div class="memdoc"> |
|
82 |
|
83 <p> |
|
84 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> |
|
85 <table border="0" cellspacing="2" cellpadding="0"> |
|
86 <tr><td valign="top"></td><td valign="top"><em>aConsole</em> </td><td>The console object. </td></tr> |
|
87 <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> |
|
88 </table> |
|
89 </dl> |
|
90 <dl class="return" compact><dt><b>Returns:</b></dt><dd>A <a class="el" href="class_c_consumer.html">CConsumer</a> object. </dd></dl> |
|
91 |
|
92 <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> |
|
93 |
|
94 </div> |
|
95 </div><p> |
|
96 <a class="anchor" name="e769aaadb4500557f88dfe64755a4db5"></a><!-- doxytag: member="CConsumer::ConstructL" ref="e769aaadb4500557f88dfe64755a4db5" args="(CConsoleBase *aConsole, CQueue *aTokens)" --> |
|
97 <div class="memitem"> |
|
98 <div class="memproto"> |
|
99 <table class="memname"> |
|
100 <tr> |
|
101 <td class="memname">void CConsumer::ConstructL </td> |
|
102 <td>(</td> |
|
103 <td class="paramtype">CConsoleBase * </td> |
|
104 <td class="paramname"> <em>aConsole</em>, </td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td class="paramkey"></td> |
|
108 <td></td> |
|
109 <td class="paramtype"><a class="el" href="class_c_queue.html">CQueue</a> * </td> |
|
110 <td class="paramname"> <em>aTokens</em></td><td> </td> |
|
111 </tr> |
|
112 <tr> |
|
113 <td></td> |
|
114 <td>)</td> |
|
115 <td></td><td></td><td width="100%"></td> |
|
116 </tr> |
|
117 </table> |
|
118 </div> |
|
119 <div class="memdoc"> |
|
120 |
|
121 <p> |
|
122 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> |
|
123 <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> |
|
124 <table border="0" cellspacing="2" cellpadding="0"> |
|
125 <tr><td valign="top"></td><td valign="top"><em>aConsole</em> </td><td>The console object. </td></tr> |
|
126 <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> |
|
127 </table> |
|
128 </dl> |
|
129 <dl class="see" compact><dt><b>See also:</b></dt><dd>CPeriodic::Start(). <p> |
|
130 RThread::Create(). </dd></dl> |
|
131 </li></ul> |
|
132 |
|
133 <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> |
|
134 |
|
135 </div> |
|
136 </div><p> |
|
137 <a class="anchor" name="986aa37709261200c981221e8d6c093e"></a><!-- doxytag: member="CConsumer::ConsThreadFunc" ref="986aa37709261200c981221e8d6c093e" args="(TAny *aPtr)" --> |
|
138 <div class="memitem"> |
|
139 <div class="memproto"> |
|
140 <table class="memname"> |
|
141 <tr> |
|
142 <td class="memname">TInt CConsumer::ConsThreadFunc </td> |
|
143 <td>(</td> |
|
144 <td class="paramtype">TAny * </td> |
|
145 <td class="paramname"> <em>aPtr</em> </td> |
|
146 <td> ) </td> |
|
147 <td width="100%"><code> [static]</code></td> |
|
148 </tr> |
|
149 </table> |
|
150 </div> |
|
151 <div class="memdoc"> |
|
152 |
|
153 <p> |
|
154 The consumer thread function. It removes a token from the queue. <dl compact><dt><b>Parameters:</b></dt><dd> |
|
155 <table border="0" cellspacing="2" cellpadding="0"> |
|
156 <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> |
|
157 </table> |
|
158 </dl> |
|
159 |
|
160 <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> |
|
161 |
|
162 </div> |
|
163 </div><p> |
|
164 <a class="anchor" name="7c2ffe71d0d3f918b183152bd285b417"></a><!-- doxytag: member="CConsumer::ResumeCons" ref="7c2ffe71d0d3f918b183152bd285b417" args="()" --> |
|
165 <div class="memitem"> |
|
166 <div class="memproto"> |
|
167 <table class="memname"> |
|
168 <tr> |
|
169 <td class="memname">void CConsumer::ResumeCons </td> |
|
170 <td>(</td> |
|
171 <td class="paramname"> </td> |
|
172 <td> ) </td> |
|
173 <td width="100%"></td> |
|
174 </tr> |
|
175 </table> |
|
176 </div> |
|
177 <div class="memdoc"> |
|
178 |
|
179 <p> |
|
180 Resumes the execution of the consumer thread. |
|
181 <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> |
|
182 |
|
183 </div> |
|
184 </div><p> |
|
185 <a class="anchor" name="ee1ff1fbf228d676e06aa5bd7c1d9799"></a><!-- doxytag: member="CConsumer::RemoveFunction" ref="ee1ff1fbf228d676e06aa5bd7c1d9799" args="(TAny *aPtr)" --> |
|
186 <div class="memitem"> |
|
187 <div class="memproto"> |
|
188 <table class="memname"> |
|
189 <tr> |
|
190 <td class="memname">TInt CConsumer::RemoveFunction </td> |
|
191 <td>(</td> |
|
192 <td class="paramtype">TAny * </td> |
|
193 <td class="paramname"> <em>aPtr</em> </td> |
|
194 <td> ) </td> |
|
195 <td width="100%"><code> [static]</code></td> |
|
196 </tr> |
|
197 </table> |
|
198 </div> |
|
199 <div class="memdoc"> |
|
200 |
|
201 <p> |
|
202 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> |
|
203 CPeriodic. </dd></dl> |
|
204 |
|
205 <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> |
|
206 |
|
207 </div> |
|
208 </div><p> |
|
209 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:33:03 2010 for TB10.1 Example Applications by |
|
210 <a href="http://www.doxygen.org/index.html"> |
|
211 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address> |
|
212 </body> |
|
213 </html> |