bearermanagement/mpm/src/mpmexpirytimer.cpp
branchRCL_3
changeset 55 fc7b30ed2058
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/mpm/src/mpmexpirytimer.cpp	Thu Aug 19 10:18:49 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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:  Implementation of class CMPMExpiryTimer, a common timer class for MPM.
+*
+*/
+
+#include "mpmexpirytimer.h"
+#include "mpmexpirytimercallback.h"
+
+// ---------------------------------------------------------------------------
+// Constructs and returns the class object.
+// ---------------------------------------------------------------------------
+//
+CMPMExpiryTimer* CMPMExpiryTimer::NewL( MMPMExpiryTimerCallback& aCallback, TInt aTimeout )
+    {
+    CMPMExpiryTimer* self = new( ELeave ) CMPMExpiryTimer( aCallback, aTimeout );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Default C++ constructor.
+// ---------------------------------------------------------------------------
+//
+
+CMPMExpiryTimer::CMPMExpiryTimer( MMPMExpiryTimerCallback& aCallback, TInt aTimeout ):
+        CTimer( CActive::EPriorityStandard ),
+        iCallback( aCallback ),
+        iTimeout( aTimeout )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor.
+// ---------------------------------------------------------------------------
+//
+
+void CMPMExpiryTimer::ConstructL()
+    {
+    CTimer::ConstructL();        
+    }
+
+// ---------------------------------------------------------------------------
+// RunL, from CTimer, starts up the timer.
+// ---------------------------------------------------------------------------
+//
+
+void CMPMExpiryTimer::Start()
+    {
+    After( iTimeout );
+    }
+
+// ---------------------------------------------------------------------------
+// RunL, from CTimer, called when the timer expires.
+// ---------------------------------------------------------------------------
+//
+
+void CMPMExpiryTimer::RunL()
+    {
+    iCallback.HandleTimedOut();
+    }