testexecmdw/tef/tef/utils/inc/testexecuteserverbase.h
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 * This contains CTestServer which is the base class for all test servers
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file TestExecuteServerBase.h
       
    23 */
       
    24 #if (!defined __TESTEXECUTE_SERVER_BASE_H__)
       
    25 #define __TESTEXECUTE_SERVER_BASE_H__
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <test/testexecutestepbase.h>
       
    29 
       
    30 class CTestServer : public CServer2
       
    31 /**
       
    32 @publishedPartner
       
    33 @test
       
    34 */
       
    35 	{
       
    36 public:
       
    37 	IMPORT_C virtual ~CTestServer();
       
    38 	IMPORT_C CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
       
    39 	IMPORT_C virtual void ConstructL(const TDesC& aName);
       
    40 	void StartLoggerL();
       
    41 
       
    42 	/**
       
    43 	 * Creates the test step.
       
    44 	 *
       
    45 	 * @param aStepName - test step name to run.
       
    46 	 *
       
    47 	 * @return - A CTestStep derived instance
       
    48 	 */
       
    49 	virtual CTestStep* CreateTestStep(const TDesC& aStepName) = 0;
       
    50 
       
    51 	void SessionClosed();
       
    52 	TInt64& RandSeed() {return iSeed;};
       
    53 	inline CTestExecuteLogger& Logger() {return iLogger;};
       
    54 	inline const TDesC& Name() const {return iServerName;};
       
    55 	inline TBool LoggerStarted() { return iLoggerStarted; };
       
    56 protected:
       
    57 	IMPORT_C CTestServer();
       
    58 	inline void IncSessionCount() {++iSessionCount;};
       
    59 protected:
       
    60 private:
       
    61 	TInt64	iSeed;
       
    62 	TInt	iSessionCount;
       
    63 	CTestExecuteLogger iLogger;
       
    64 	TBool iLoggerStarted;
       
    65 	TBuf<KMaxTestExecuteNameLength> iServerName;
       
    66 	};
       
    67 
       
    68 #endif