examples/Bluetooth/BTExample1/src/cardgamebase.cpp

00001 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 #include "cardgamebase.h"
00017 #include "cardgamesend.h"
00018 #include "cardgamerecv.h"
00019 #include "cardgametimer.h" 
00020 
00021 
00025 CCardGameBase::~CCardGameBase()
00026         {
00027         delete iGameSender;
00028         delete iGameReceiver;
00029         delete iGameTimer;
00030         }
00034 void CCardGameBase::ConstructL(RSocket& aSocket)
00035      {
00036      iSocket = aSocket;
00037      iGameSender = CCardGameSend::NewL(*this, iSocket);
00038      iGameReceiver = CCardGameRecv::NewL(*this, iSocket);
00039      iGameTimer = CCardGameTimer::NewL(*this);
00040      }
00050 void CCardGameBase::BaseSendTo(TDesC8& aDes, TInetAddr aAddr)
00051      {
00052      iGameSender->SendTo(aDes, aAddr);
00053      }
00061 void CCardGameBase::BaseRecvFrom(TDes8& aDes)
00062      {
00063      iGameReceiver->RecvFrom(aDes);
00064      }
00065 
00069 void CCardGameBase::BaseCancelSendTo()
00070       {
00071       iGameSender->DoCancel();
00072       }
00076 void CCardGameBase::BaseCancelRecvFrom()
00077      {
00078      iGameReceiver->DoCancel();
00079      }
00083 void CCardGameBase::BaseCancelAll()
00084      {
00085      iGameSender->DoCancel();
00086      iGameReceiver->DoCancel();
00087      iGameTimer->Cancel();
00088      }
00097 void CCardGameBase::StartTimer(TInt aDuration)
00098         {
00099         iGameTimer->StartTimer(aDuration);
00100         }
00101         
00102 void CCardGameBase::StopTimer()
00103         {
00104     iGameTimer->Cancel();
00105     }
00106     

Generated on Thu Jan 21 10:32:57 2010 for TB10.1 Example Applications by  doxygen 1.5.3