Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/dealer_8h-source.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: examples/Bluetooth/BTExample1/inc/dealer.h Source File</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>examples/Bluetooth/BTExample1/inc/dealer.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Description:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef DEALER_H</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define DEALER_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="preprocessor">#include <e32base.h></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include <in_sock.h></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "gameconstants.h"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "cardgamedealer.h"</span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025
<a name="l00026"></a>00026
<a name="l00027"></a>00027
<a name="l00034"></a><a class="code" href="class_c_scabby_queen_dealer.html">00034</a> <span class="keyword">class </span><a class="code" href="class_c_scabby_queen_dealer.html">CScabbyQueenDealer</a> : <span class="keyword">public</span> <a class="code" href="class_c_card_game_dealer.html">CCardGameDealer</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036 <span class="keyword">public</span>:
<a name="l00037"></a>00037 <span class="keyword">static</span> <a class="code" href="class_c_scabby_queen_dealer.html">CScabbyQueenDealer</a>* <a class="code" href="class_c_scabby_queen_dealer.html#5cd1d94de34db0f024de9731ba698940">NewL</a>(CConsoleBase& aConsole,
<a name="l00038"></a>00038 RArray<TInetAddr>& aRemoteNames,
<a name="l00039"></a>00039 RSocket& aSocket);
<a name="l00040"></a>00040 <a class="code" href="class_c_scabby_queen_dealer.html#ed3319fef36c77963d3d774fb81f7335">~CScabbyQueenDealer</a>();
<a name="l00041"></a>00041 <span class="comment">// implementations of virtual functions here</span>
<a name="l00042"></a>00042 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#01ff48386a2d56365c0722f057dbde90">SendComplete</a>(TInt aError);
<a name="l00043"></a>00043 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#31ddcbf318bec20812aa7885cecbc003">RecvComplete</a>(TInetAddr aRecvAddr,TInt aError);
<a name="l00044"></a>00044 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#275910f6a9dbaeb7ed79f907972d169b">TimerComplete</a>();
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#082666bc321d2209abb56fb5f4a3a2e1">StartTheGame</a>();
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#f6a709846dab42334309de80d8e15ffd">DealDeckL</a>();
<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#7d2def26f1acaca85f07cc66f993e35c">ShowDeckL</a>();
<a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#bd6d72d867902a1ba3341a56b4cda461">SendPlayerNumbers</a>();
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keyword">private</span>:
<a name="l00051"></a>00051 <span class="keywordtype">void</span> InformReceivingPlayer();
<a name="l00052"></a>00052 <span class="keywordtype">void</span> InformSendingPlayer();
<a name="l00053"></a>00053 <span class="keywordtype">void</span> InformStaticPlayers();
<a name="l00054"></a>00054 <span class="keywordtype">void</span> RecvOfCardComplete();
<a name="l00055"></a>00055 <span class="keywordtype">void</span> RecvOfFinishNotify();
<a name="l00056"></a>00056 <span class="keywordtype">void</span> CheckPlayerStatus();
<a name="l00057"></a>00057 <span class="keywordtype">void</span> DealWithGameStatus(TGameStatus aGameStatus);
<a name="l00058"></a>00058 <span class="keywordtype">void</span> RecvCard();
<a name="l00059"></a>00059 <span class="keywordtype">void</span> ReceivingPlayerInformed(TInt aError);
<a name="l00060"></a>00060 <span class="keywordtype">void</span> StaticPlayersInformed(TInt aError);
<a name="l00061"></a>00061 <span class="keywordtype">void</span> CardSent();
<a name="l00062"></a>00062 <span class="keywordtype">void</span> SendReadyInquiry();
<a name="l00063"></a>00063 <span class="keywordtype">void</span> SendPlayerUpdate();
<a name="l00064"></a>00064 <span class="keywordtype">void</span> PlayerUpdateSent(TInt aError);
<a name="l00065"></a>00065 <span class="keywordtype">void</span> SendOfCheckStatusComplete(TInt aError);
<a name="l00066"></a>00066 <span class="keywordtype">void</span> ReadyInquirySent(TInt aError);
<a name="l00067"></a>00067 <span class="keywordtype">void</span> DealWithStatusFromRecv();
<a name="l00068"></a>00068 <span class="keywordtype">void</span> DealWithStatusFromSender();
<a name="l00069"></a>00069 <span class="keywordtype">void</span> ReceiveCardNum();
<a name="l00070"></a>00070 <span class="keywordtype">void</span> SendHandSize();
<a name="l00071"></a>00071 <span class="keywordtype">void</span> SendCardNumber();
<a name="l00072"></a>00072 <span class="keywordtype">void</span> RecvHandSize(TInt aError);
<a name="l00073"></a>00073 <span class="keywordtype">void</span> SendCompleted(TInt aError);
<a name="l00074"></a>00074 <span class="keywordtype">void</span> RecvOfAckComplete();
<a name="l00075"></a>00075 <span class="keywordtype">void</span> TimerCompleted();
<a name="l00076"></a>00076 <span class="keywordtype">void</span> SentGameOverMessage();
<a name="l00077"></a>00077 <span class="keywordtype">void</span> InformNextGameOver();
<a name="l00078"></a>00078 <span class="keywordtype">void</span> InformStaticPlayersProcess();
<a name="l00079"></a>00079
<a name="l00080"></a>00080
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="keyword">protected</span>:
<a name="l00083"></a>00083 <a class="code" href="class_c_scabby_queen_dealer.html#e0d5a3d2cda4e83234febb9f5123ea1a">CScabbyQueenDealer</a>(CConsoleBase& aConsole, RArray<TInetAddr>& aRemoteNames, RSocket& aSocket);
<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#2df9ed4625d55297f125c09e99a3a100">ConstructL</a>();
<a name="l00085"></a>00085
<a name="l00086"></a>00086 <span class="keyword">public</span>:
<a name="l00087"></a><a class="code" href="class_c_scabby_queen_dealer.html#09bd3d6ad102d2e9a73093b1e45bb1b2">00087</a> TBool <a class="code" href="class_c_scabby_queen_dealer.html#09bd3d6ad102d2e9a73093b1e45bb1b2">iGameOver</a>;
<a name="l00088"></a><a class="code" href="class_c_scabby_queen_dealer.html#4b9b1dc995ea3e246f6ed013040069fe">00088</a> TPckgBuf<TGameStatus> <a class="code" href="class_c_scabby_queen_dealer.html#4b9b1dc995ea3e246f6ed013040069fe">iGameStatus</a>;
<a name="l00089"></a><a class="code" href="class_c_scabby_queen_dealer.html#f07a255ee12a7cacfd8bf4ffe1bdba17">00089</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#f07a255ee12a7cacfd8bf4ffe1bdba17">iPlayerNum</a>;
<a name="l00090"></a><a class="code" href="class_c_scabby_queen_dealer.html#f6a705f53acad1af90c477874ec7b4fc">00090</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#f6a705f53acad1af90c477874ec7b4fc">iCount</a>;
<a name="l00091"></a><a class="code" href="class_c_scabby_queen_dealer.html#d36b0a19783d42bd2eb4007743bac8b8">00091</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#d36b0a19783d42bd2eb4007743bac8b8">iPlayerToken</a>;
<a name="l00092"></a><a class="code" href="class_c_scabby_queen_dealer.html#ab4cab071db2acc68397fa0bb8caa93b">00092</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#ab4cab071db2acc68397fa0bb8caa93b">iSender</a>;
<a name="l00093"></a><a class="code" href="class_c_scabby_queen_dealer.html#5cb6915fc79735c3809baf7bb1f08066">00093</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#5cb6915fc79735c3809baf7bb1f08066">iPlayerCount</a>;
<a name="l00094"></a><a class="code" href="class_c_scabby_queen_dealer.html#9c32bcbffbfaf85ba7d765d97b1be24a">00094</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#9c32bcbffbfaf85ba7d765d97b1be24a">iResendCount</a>;
<a name="l00095"></a><a class="code" href="class_c_scabby_queen_dealer.html#2ced907d15f1ce37473ffcb150e64d8b">00095</a> TBuf8<20> <a class="code" href="class_c_scabby_queen_dealer.html#2ced907d15f1ce37473ffcb150e64d8b">iPlayerUpdate</a>;
<a name="l00096"></a><a class="code" href="class_c_scabby_queen_dealer.html#5904bca399ce397edfccc42657894e42">00096</a> TBuf8<20> <a class="code" href="class_c_scabby_queen_dealer.html#5904bca399ce397edfccc42657894e42">iOldPlayerUpdate</a>;
<a name="l00097"></a><a class="code" href="class_c_scabby_queen_dealer.html#885b64499cf7eb2417146c203ffe2dde">00097</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#885b64499cf7eb2417146c203ffe2dde">iUpdateSize</a>;
<a name="l00098"></a><a class="code" href="class_c_scabby_queen_dealer.html#9cfe6dd0f07eb447099d83717064b21e">00098</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#9cfe6dd0f07eb447099d83717064b21e">iSenderHandSize</a>;
<a name="l00099"></a><a class="code" href="class_c_scabby_queen_dealer.html#d2fda83bc39115599e045ada314bf3c7">00099</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#d2fda83bc39115599e045ada314bf3c7">iCardNum</a>;
<a name="l00100"></a><a class="code" href="class_c_scabby_queen_dealer.html#cdd5b112e0d93246b784fcc979e300a5">00100</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#cdd5b112e0d93246b784fcc979e300a5">iAck</a>;
<a name="l00101"></a><a class="code" href="class_c_scabby_queen_dealer.html#d5cf6b60e28be5717dbf448c811e25f8">00101</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#d5cf6b60e28be5717dbf448c811e25f8">iGameOverBuffer</a>;
<a name="l00102"></a><a class="code" href="class_c_scabby_queen_dealer.html#261bd4bcd5a2fb03c8a2bdccd7f8545d">00102</a> RArray<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#261bd4bcd5a2fb03c8a2bdccd7f8545d">iLostPlayers</a>;
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="keyword">private</span>:
<a name="l00105"></a>00105 <span class="comment">// Dealer send operation enumeration </span>
<a name="l00106"></a>00106 <span class="keyword">enum</span> TDealerSendMode
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108 ESendPlayerNum,
<a name="l00109"></a>00109 ESendRecvToken,
<a name="l00110"></a>00110 ESendSendToken,
<a name="l00111"></a>00111 ESendWaitToken,
<a name="l00112"></a>00112 ESendCard,
<a name="l00113"></a>00113 ESendCheckRecvStatus,
<a name="l00114"></a>00114 ESendCheckSenderStatus,
<a name="l00115"></a>00115 ESendReadyInquiry,
<a name="l00116"></a>00116 ESendPlayerUpdate,
<a name="l00117"></a>00117 ESendHandSize,
<a name="l00118"></a>00118 ESendPlayerCardNumber,
<a name="l00119"></a>00119 ESendGameOver
<a name="l00120"></a>00120 };
<a name="l00121"></a>00121 <span class="comment">// Dealer receive operation enumeration </span>
<a name="l00122"></a>00122 <span class="keyword">enum</span> TDealerRecvMode
<a name="l00123"></a>00123 {
<a name="l00124"></a>00124 ERecvSuccess,
<a name="l00125"></a>00125 ERecvCardNotification,
<a name="l00126"></a>00126 EDealerRecvCard,
<a name="l00127"></a>00127 ERecvStatusRecv,
<a name="l00128"></a>00128 ERecvStatusSender,
<a name="l00129"></a>00129 ERecvReadyResult,
<a name="l00130"></a>00130 ERecvUpdateResult,
<a name="l00131"></a>00131 EDealerRecvHandSize,
<a name="l00132"></a>00132 EDealerRecvCardNum,
<a name="l00133"></a>00133 EDealerRecvAck
<a name="l00134"></a>00134 };
<a name="l00135"></a>00135
<a name="l00136"></a>00136 CConsoleBase& iConsole;
<a name="l00137"></a>00137 TDealerRecvMode iRecvMode;
<a name="l00138"></a>00138 TDealerSendMode iSendMode;
<a name="l00139"></a>00139 HBufC8* iFullDeck;
<a name="l00140"></a>00140 RBuf8 iCheckSize;
<a name="l00141"></a>00141 TUint iRandom;
<a name="l00142"></a>00142 TBuf8<KDeckBufferLength> iTempBuffer;
<a name="l00143"></a>00143 TPckgBuf<TPlayerStatus> iStatusBuffer;
<a name="l00144"></a>00144 TPckgBuf<TInt> iSuccess;
<a name="l00145"></a>00145
<a name="l00146"></a>00146 TInetAddr iSenderAddr;
<a name="l00147"></a>00147 RArray<TInt> iFinishedPlayers;
<a name="l00148"></a>00148 RArray<TInt> iCurrentPlayers;
<a name="l00149"></a>00149 TInt iResponseCount;
<a name="l00150"></a>00150 TInt iWaitingPlayerCount;
<a name="l00151"></a>00151 TBuf8<KCardLength> iReceivedCard;
<a name="l00152"></a>00152 };
<a name="l00153"></a>00153
<a name="l00154"></a>00154
<a name="l00155"></a>00155 <span class="preprocessor">#endif // DEALER_H</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:57 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>