diff -r e9b96e674847 -r 5b2a402e96ac tsrc/testtools/stubsrv/inc/stubsrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/testtools/stubsrv/inc/stubsrv.h Thu Aug 19 10:54:11 2010 +0300 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef STUBSRV_H +#define STUBSRV_H + +#include +#include +#include +#include "stubclientsrv.h" + +enum TStubfPanic + { + EStubfBadRequest = 100000, + EStubfBadDescriptor, + EStubfNotCompletedApis, + EStubfBadMessage, + EStubfNoLimitedMessage, + EStubfClassMemberVariableIsNull, + EStubfClassMemberVariableIsNotNull, + EMainSchedulerError, + EStubfApiAlreadyStarted, + EStubfApiNotStarted, + }; + +class CStubSrvSess; + +NONSHARABLE_CLASS(CStubSrv) : public CPolicyServer + { + +public: + + static CStubSrv* NewLC(); + + ~CStubSrv(); + +public: + + void StartShutdownTimerIfNoSessions(); + + TInt ClientOpened(CStubSrvSess& aSession); + + void ClientClosed(CStubSrvSess& aSession); + + void EnqueueL(const RMessage2& aMessage); + + void DeleteQueues(const RMessage2& aMessage); + + TInt Dequeue(TApiBehavior& aBeh, TInt& aExeDuration, TInt aTransactionId); + + void GetApiCompleteCodeL(const RMessage2& aMessage); + +private: + + CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; + +private: + + CStubSrv(TInt aPriority); + + void ConstructL(); + + void CancelShutdownTimer(); + + static TInt TimerFired(TAny* aThis); + +private: + class TApiQueueItem + { + public: + TApiBehavior iBeh; + TInt iExeDuration; + TInt iTransactionId; + }; + +private: + + CPeriodic* iTimer; + + RPointerArray iSessions; + + RPointerArray iBehQueue; + TInt iTransctionUnique; + }; + +#endif + +