diff -r 675a964f4eb5 -r 35751d3474b7 cryptomgmtlibs/securitytestfw/test/testutil/server/testutilsession.h --- a/cryptomgmtlibs/securitytestfw/test/testutil/server/testutilsession.h Tue Jul 21 01:04:32 2009 +0100 +++ b/cryptomgmtlibs/securitytestfw/test/testutil/server/testutilsession.h Thu Sep 10 14:01:51 2009 +0300 @@ -1,91 +1,89 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "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: -* testutil - server classes -* -*/ - - - - -/** - @file - @test - @internalComponent -*/ - -#include -#include "testutilsdpfilewatcher.h" - -class CTestUtilServer; - -class MTimeoutClient - { -public: - /** Client's implementation gets called on timer expiry */ - virtual void HandleTimeout() = 0; - }; - -/** Simple timer class which calls a callback on timer expiry */ -class CGenericTimer : public CTimer - { -public: - static CGenericTimer* NewL(MTimeoutClient& aClient); -private: - CGenericTimer(MTimeoutClient& aClient); - void RunL(); -private: - MTimeoutClient& iClient; - }; - -class CTestFileDetector : public CActive, public MTimeoutClient - { -public: - static CTestFileDetector* NewL(const RMessage2& iMessage, RFs& aFs); - CTestFileDetector(const RMessage2& iMessage, RFs& aFs); - ~CTestFileDetector(); - void DetectFile(); -private: - void ConstructL(); - virtual void HandleTimeout(); - void RunL(); - void DoCancel(); - void CheckAndComplete(); -private: - RFs& iFs; - CGenericTimer* iTimer; - HBufC* iFileName; - TInt iTimeInterval; - const RMessage2& iMessage; - }; - -class CTestUtilSession : public CSession2 - { -public: - CTestUtilSession(); - void CreateL(); -private: - ~CTestUtilSession(); - inline CTestUtilServer& Server(); - void ServiceL(const RMessage2& aMessage); - void ServiceError(const RMessage2& aMessage,TInt aError); -private: - RArray iLockedFileHandles; - CFileWatcher* iFileWatcher; - CTestFileDetector* iDetector; - }; - - -inline CTestUtilServer& CTestUtilSession::Server() - {return *static_cast(const_cast(CSession2::Server()));} +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: +* testutil - server classes +* +*/ + + +/** + @file + @test + @internalComponent +*/ + +#include +#include "testutilfilewatcher.h" + +class CTestUtilServer; + +class MTimeoutClient + { +public: + /** Client's implementation gets called on timer expiry */ + virtual void HandleTimeout() = 0; + }; + +/** Simple timer class which calls a callback on timer expiry */ +class CGenericTimer : public CTimer + { +public: + static CGenericTimer* NewL(MTimeoutClient& aClient); +private: + CGenericTimer(MTimeoutClient& aClient); + void RunL(); +private: + MTimeoutClient& iClient; + }; + +class CTestFileDetector : public CActive, public MTimeoutClient + { +public: + static CTestFileDetector* NewL(const RMessage2& iMessage, RFs& aFs); + CTestFileDetector(const RMessage2& iMessage, RFs& aFs); + ~CTestFileDetector(); + void DetectFile(); +private: + void ConstructL(); + virtual void HandleTimeout(); + void RunL(); + void DoCancel(); + void CheckAndComplete(); +private: + RFs& iFs; + CGenericTimer* iTimer; + HBufC* iFileName; + TInt iTimeInterval; + const RMessage2& iMessage; + }; + +class CTestUtilSession : public CSession2 + { +public: + CTestUtilSession(); + void CreateL(); +private: + ~CTestUtilSession(); + inline CTestUtilServer& Server(); + void ServiceL(const RMessage2& aMessage); + void ServiceError(const RMessage2& aMessage,TInt aError); +private: + RArray iLockedFileHandles; + CFileWatcher* iFileWatcher; + CTestFileDetector* iDetector; + }; + + +inline CTestUtilServer& CTestUtilSession::Server() + {return *static_cast(const_cast(CSession2::Server()));}