resourcemgmt/hwresourcesmgr/test/utils/endstatetimer.cpp
changeset 0 4e1aa6a622a0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resourcemgmt/hwresourcesmgr/test/utils/endstatetimer.cpp	Tue Feb 02 00:53:00 2010 +0200
@@ -0,0 +1,59 @@
+// Copyright (c) 2007-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:
+//
+
+#include "endstatetimer.h"
+
+CEndStateTimer* CEndStateTimer::NewL(MTimerExpired& aObserver)
+    {
+    CEndStateTimer* self = new( ELeave )CEndStateTimer(aObserver);
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+CEndStateTimer::~CEndStateTimer()    
+    {
+    Cancel();
+    }
+    
+CEndStateTimer::CEndStateTimer(MTimerExpired& aObserver)
+    : CTimer(EPriorityStandard), iTimerObserver(aObserver)  
+    {
+    }
+
+void CEndStateTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add(this);
+    }
+    
+void CEndStateTimer::Start(TReal aTimeOutSecs)
+	{
+	After(aTimeOutSecs*1000000);
+	}
+	
+void CEndStateTimer::DoCancel()
+	{
+	CTimer::DoCancel();
+	}
+
+    
+void CEndStateTimer::RunL()
+    {
+    iTimerObserver.EndStateTimerExpired(iStatus.Int());	
+    }