dvrengine/CommonRecordingEngine/src/CCRTimer.cpp
branchRCL_3
changeset 23 13a33d82ad98
parent 0 822a42b6c3f1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dvrengine/CommonRecordingEngine/src/CCRTimer.cpp	Wed Sep 01 12:20:37 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2007 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:    Wrapper for CTimer*
+*/
+
+
+
+
+// INCLUDE FILES
+#include "CCRTimer.h"
+#include "MCRTimerObserver.h"
+
+// CONSTANTS
+// None
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CCRTimer::NewL()
+// -----------------------------------------------------------------------------
+//
+CCRTimer* CCRTimer::NewL( const TInt aPriority, MCRTimerObserver& aTimerObserver )
+    {
+    CCRTimer* self = CCRTimer::NewLC( aPriority, aTimerObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CCRTimer::NewLC()
+// -----------------------------------------------------------------------------
+//
+CCRTimer* CCRTimer::NewLC( const TInt aPriority, MCRTimerObserver& aTimerObserver )
+    {
+    CCRTimer* self = new (ELeave) CCRTimer( aPriority, aTimerObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CCRTimer::CCRTimer()
+// -----------------------------------------------------------------------------
+//
+CCRTimer::CCRTimer( const TInt aPriority, MCRTimerObserver& aTimerObserver )
+  : CTimer( aPriority ), iObserver( aTimerObserver )
+    {
+    // None
+    }
+
+// -----------------------------------------------------------------------------
+// CCRTimer::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CCRTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CCRTimer::~CCRTimer()
+// -----------------------------------------------------------------------------
+//
+CCRTimer::~CCRTimer()
+    {
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CCRTimer::RunL()
+// Timer request has completed, so notify the timer's owner.
+// -----------------------------------------------------------------------------
+//
+void CCRTimer::RunL()
+    {
+    if ( iStatus == KErrNone )
+        {
+        iObserver.TimerExpired( this );
+        }
+    }
+
+//  End of File