00001 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 00002 <html> 00003 00004 <head> 00005 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 00006 <title>timeserver.h Source File</title> 00007 <link href="style.css" rel="stylesheet" type="text/css"> 00008 </head> 00009 00010 <table border="0" width="100%" height="8" bgcolor="#eeeeee"> 00011 <tr> <td width="100%" height="1"><b><font size="2" color="#000000" face="Arial, Helvetica, sans-serif"><strong><a name=Top></a> 00012 S60 5th Edition SDK </strong></font></b><br><i>Example Applications Guide</i></td></tr> </table> 00013 <!-- Generated by Doxygen 1.4.5 --> 00014 <div class="tabs"> 00015 <ul> 00016 <li><a href="index.html"><span>Main Page</span></a></li> 00017 <li><a href="annotated.html"><span>Classes</span></a></li> 00018 <li id="current"><a href="files.html"><span>Files</span></a></li> 00019 </ul></div> 00020 <h1>timeserver.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> 00021 <a name="l00002"></a>00002 <span class="comment">* ==============================================================================</span> 00022 <a name="l00003"></a>00003 <span class="comment">* Name : timeserver.h</span> 00023 <a name="l00004"></a>00004 <span class="comment">* Part of : CSAsync</span> 00024 <a name="l00005"></a>00005 <span class="comment">* Interface :</span> 00025 <a name="l00006"></a>00006 <span class="comment">* Description :</span> 00026 <a name="l00007"></a>00007 <span class="comment">* Version :</span> 00027 <a name="l00008"></a>00008 <span class="comment">*</span> 00028 <a name="l00009"></a>00009 <span class="comment">* Copyright (c) 2004-2006 Nokia Corporation.</span> 00029 <a name="l00010"></a>00010 <span class="comment">* This material, including documentation and any related</span> 00030 <a name="l00011"></a>00011 <span class="comment">* computer programs, is protected by copyright controlled by</span> 00031 <a name="l00012"></a>00012 <span class="comment">* Nokia Corporation.</span> 00032 <a name="l00013"></a>00013 <span class="comment">* ==============================================================================</span> 00033 <a name="l00014"></a>00014 <span class="comment">*/</span> 00034 <a name="l00015"></a>00015 00035 <a name="l00016"></a>00016 00036 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef __CTIMESERVER_H__</span> 00037 <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __CTIMESERVER_H__</span> 00038 <a name="l00019"></a>00019 <span class="preprocessor"></span> 00039 <a name="l00020"></a>00020 <span class="comment">// INCLUDE FILES</span> 00040 <a name="l00021"></a>00021 <span class="preprocessor">#include <e32base.h></span> 00041 <a name="l00022"></a>00022 <span class="preprocessor">#include "AsyncServer.pan"</span> 00042 <a name="l00023"></a>00023 00043 <a name="l00024"></a>00024 <span class="comment">// CLASS DECLARATION</span><span class="comment"></span> 00044 <a name="l00025"></a>00025 <span class="comment"></span> 00049 <a name="l00030"></a><a class="code" href="class_c_time_server.html">00030</a> <span class="keyword">class </span><a class="code" href="class_c_time_server.html">CTimeServer</a> : <span class="keyword">public</span> CServer2, <span class="keyword">public</span> MBeating 00050 <a name="l00031"></a>00031 { 00051 <a name="l00032"></a>00032 <span class="keyword">public</span> : <span class="comment">// Constructors and destructors</span> 00052 <a name="l00033"></a>00033 <span class="comment"></span> 00053 <a name="l00034"></a>00034 <span class="comment"> </span> 00058 <a name="l00039"></a>00039 <span class="keyword">static</span> <a class="code" href="class_c_time_server.html">CTimeServer</a>* <a class="code" href="class_c_time_server.html#990716240ccf3341f7fdbf289ec927ad">NewL</a>(); 00059 <a name="l00040"></a>00040 <span class="comment"></span> 00060 <a name="l00041"></a>00041 <span class="comment"> </span> 00065 <a name="l00046"></a>00046 <span class="keyword">static</span> <a class="code" href="class_c_time_server.html">CTimeServer</a>* <a class="code" href="class_c_time_server.html#94389c6729b439332fc74a54ac683740">NewLC</a>(); 00066 <a name="l00047"></a>00047 <span class="comment"></span> 00067 <a name="l00048"></a>00048 <span class="comment"> </span> 00071 <a name="l00052"></a>00052 <span class="keyword">virtual</span> <a class="code" href="class_c_time_server.html#ab523c20e96ddd5e1413d525bad59fdd">~CTimeServer</a>(); 00072 <a name="l00053"></a>00053 00073 <a name="l00054"></a>00054 <span class="keyword">public</span>: <span class="comment">// New functions</span> 00074 <a name="l00055"></a>00055 <span class="comment"></span> 00075 <a name="l00056"></a>00056 <span class="comment"> </span> 00082 <a name="l00063"></a>00063 <span class="keyword">static</span> TInt <a class="code" href="class_c_time_server.html#61b4b595801bf9fedbb0df14ed44332c">ThreadFunction</a>( TAny* aStarted ); 00083 <a name="l00064"></a>00064 <span class="comment"></span> 00084 <a name="l00065"></a>00065 <span class="comment"> </span> 00088 <a name="l00069"></a>00069 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#a3afdfcfbf3d8aa45b7f96b5a1c7119e">IncrementSessions</a>(); 00089 <a name="l00070"></a>00070 <span class="comment"></span> 00090 <a name="l00071"></a>00071 <span class="comment"> </span> 00095 <a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#982e65810ad50ce20759fd26fad488dc">DecrementSessions</a>(); 00096 <a name="l00077"></a>00077 <span class="comment"></span> 00097 <a name="l00078"></a>00078 <span class="comment"> </span> 00101 <a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#a8205372b5d379fa4b803e98b0726473">WaitForTickL</a>(); 00102 <a name="l00083"></a>00083 00103 <a name="l00084"></a>00084 <span class="keyword">public</span>: <span class="comment">// Functions from base classes</span> 00104 <a name="l00085"></a>00085 <span class="comment"></span> 00105 <a name="l00086"></a>00086 <span class="comment"> </span> 00109 <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#8bc39d8613772fe04fa5d6a845ede8cd">Beat</a>(); 00110 <a name="l00091"></a>00091 <span class="comment"></span> 00111 <a name="l00092"></a>00092 <span class="comment"> </span> 00115 <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#a6043d9cad7048bb64b0d0d125ddc875">Synchronize</a>(); 00116 <a name="l00097"></a>00097 00117 <a name="l00098"></a>00098 <span class="keyword">protected</span>: <span class="comment">// Functions from base classes</span> 00118 <a name="l00099"></a>00099 <span class="comment"></span> 00119 <a name="l00100"></a>00100 <span class="comment"> </span> 00125 <a name="l00106"></a>00106 TInt <a class="code" href="class_c_time_server.html#0f788de08f5d216c674e6eaeaea1c67a">RunError</a>( TInt aError ); 00126 <a name="l00107"></a>00107 00127 <a name="l00108"></a>00108 <span class="keyword">private</span>: <span class="comment">// Constructors and destructors</span> 00128 <a name="l00109"></a>00109 <span class="comment"></span> 00129 <a name="l00110"></a>00110 <span class="comment"> </span> 00134 <a name="l00115"></a>00115 <a class="code" href="class_c_time_server.html#95423dd47aaf3240e1e4b42baa280c39">CTimeServer</a>( TInt aPriority ); 00135 <a name="l00116"></a>00116 <span class="comment"></span> 00136 <a name="l00117"></a>00117 <span class="comment"> </span> 00140 <a name="l00121"></a>00121 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#9ce34ba0b947863222da3c63d0481044">ConstructL</a>(); 00141 <a name="l00122"></a>00122 00142 <a name="l00123"></a>00123 <span class="keyword">private</span>: <span class="comment">// New methods</span> 00143 <a name="l00124"></a>00124 <span class="comment"></span> 00144 <a name="l00125"></a>00125 <span class="comment"> </span> 00150 <a name="l00131"></a>00131 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#5486029c4d68e3db4b0cbbbd2c4c711e">PanicClient</a>( <span class="keyword">const</span> RMessage2& aMessage, 00151 <a name="l00132"></a>00132 TTimeServPanic aReason ); 00152 <a name="l00133"></a>00133 <span class="comment"></span> 00153 <a name="l00134"></a>00134 <span class="comment"> </span> 00158 <a name="l00139"></a>00139 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#57317bfd7bbf407064d8f0b845a16d46">PanicServer</a>( TTimeServPanic aPanic ); 00159 <a name="l00140"></a>00140 <span class="comment"></span> 00160 <a name="l00141"></a>00141 <span class="comment"> </span> 00164 <a name="l00145"></a>00145 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#be5e4a4628587739b7c76951f9577e8e">ThreadFunctionL</a>(); 00165 <a name="l00146"></a>00146 <span class="comment"></span> 00166 <a name="l00147"></a>00147 <span class="comment"> </span> 00170 <a name="l00151"></a>00151 <span class="keywordtype">void</span> <a class="code" href="class_c_time_server.html#993249bd000d59f1d0437eea0ab25fc3">SendTimeToSessions</a>(); 00171 <a name="l00152"></a>00152 00172 <a name="l00153"></a>00153 <span class="keyword">private</span>: <span class="comment">// Functions from base classes</span> 00173 <a name="l00154"></a>00154 <span class="comment"></span> 00174 <a name="l00155"></a>00155 <span class="comment"> </span> 00181 <a name="l00162"></a>00162 CSession2* <a class="code" href="class_c_time_server.html#e8cc7a175c8a6ec0a2b0ee8bf27badb9">NewSessionL</a>( <span class="keyword">const</span> TVersion& aVersion, 00182 <a name="l00163"></a>00163 <span class="keyword">const</span> RMessage2& aMessage ) <span class="keyword">const</span>; 00183 <a name="l00164"></a>00164 00184 <a name="l00165"></a>00165 <span class="keyword">private</span>: <span class="comment">// Data</span> 00185 <a name="l00166"></a>00166 <span class="comment"></span> 00186 <a name="l00167"></a>00167 <span class="comment"> </span> 00189 <a name="l00170"></a><a class="code" href="class_c_time_server.html#40ac9219e4400c125719d767d564fc3e">00170</a> TInt <a class="code" href="class_c_time_server.html#40ac9219e4400c125719d767d564fc3e">iSessionCount</a>; 00190 <a name="l00171"></a>00171 <span class="comment"></span> 00191 <a name="l00172"></a>00172 <span class="comment"> </span> 00195 <a name="l00176"></a><a class="code" href="class_c_time_server.html#bd20aae428bf045cb28f7958102a14e1">00176</a> CHeartbeat* <a class="code" href="class_c_time_server.html#bd20aae428bf045cb28f7958102a14e1">iHeartbeat</a>; 00196 <a name="l00177"></a>00177 }; 00197 <a name="l00178"></a>00178 00198 <a name="l00179"></a>00179 <span class="preprocessor">#endif // __CTIMESERVER_H__</span> 00199 <a name="l00180"></a>00180 <span class="preprocessor"></span> 00200 <a name="l00181"></a>00181 <span class="comment">// End of File</span> 00201 </pre></div><hr> 00202 00203 <table x-use-null-cells 00204 style="x-cell-content-align: top; 00205 width: 100%; 00206 border-spacing: 0px; 00207 border-spacing: 0px;" 00208 cellspacing=0 00209 width=100%> 00210 <col style="width: 50%;"> 00211 <col style="width: 50%;"> 00212 00213 <tr style="x-cell-content-align: top;" 00214 valign=top> 00215 <td style="width: 50%; 00216 padding-right: 10px; 00217 padding-left: 10px; 00218 border-right-style: None; 00219 border-left-style: None; 00220 border-top-style: None; 00221 border-bottom-style: None;" 00222 width=50%> 00223 <p style="font-family: Arial;"><small style="font-size: smaller;">© Nokia 2009</small></td> 00224 <td style="width: 50%; 00225 padding-right: 10px; 00226 padding-left: 10px; 00227 border-top-style: None; 00228 border-bottom-style: None; 00229 border-right-style: None;" 00230 width=50%> 00231 <p style="text-align: right; margin-right: -4px;" 00232 align=right><span style="font-weight: bold;"><a href="#Top" 00233 title="Back to top"><img 00234 src="top.gif" 00235 x-maintain-ratio=TRUE 00236 alt="Back to top" 00237 style="border: none; 00238 width: 18px; 00239 height: 15px; 00240 float: none; 00241 border-style: none; 00242 border-style: none;" 00243 width=18 00244 height=15 00245 border=0></a></span></td></tr> 00246 </table> 00247 </body> 00248 </html> 00249
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.