commsprocess/commsrootserverconfig/ts_rootserver/TestAsynchHandler.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 22 Jan 2010 10:58:59 +0200
changeset 3 b6139031a239
parent 0 dfb7c4ff071f
permissions -rw-r--r--
Revision: 201003 Kit: 201003

// Copyright (c) 2003-2009 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:
// This contains CTestAsynchHandler which is an active object to
// handle the asynch calls from the RootServer during testing
// 
//

#if (!defined __TESTASYNCHHANDLER_H__)
#define __TESTASYNCHHANDLER_H__

#include <c32root.h>
#include <e32property.h>

class CTestAsynchHandler: public CActive
    {
public:
	// construct/destruct
	static CTestAsynchHandler* NewLC(RRootServ* aRootServer);
	~CTestAsynchHandler();

	// requests
    void TryLoad( const TRSStartModuleParams& aParams, const TDesC8& aIniData );
	void TryUnLoad( const TCFModuleName& aName, TRSUnLoadType aType );
	void TryBind( TRSBindingInfo& aBindInfo ); 
	void TryUnBind( TRSUnBindingInfo& aUnbindInfo );
    void TryWaitForDeath(void);
	void TryCancelDeath();
	void WaitForTimer(TInt aTimeout_ms);

	typedef enum 
		{
		EIdle,
		ELoading,
		EUnLoading,
		EBinding,
		EUnBinding,
		EListeningforDeath,
		EWaitingforTimer
	} TAsynchHandlerStates;
	TAsynchHandlerStates GetiState(void) const { return iState; }

private:
	// construct/destruct
	CTestAsynchHandler();
	void ConstructL(RRootServ* aRootServer);

	// from CActive
    void RunL();
	void DoCancel();

    RRootServ* iRootServer;
	RTimer iTimer;
    TAsynchHandlerStates iState;
	RProperty iPropertyDeath;
    };

#endif /* __TESTASYNCHHANDLER_H__ */