00001 /* 00002 * ============================================================================ 00003 * Name : CTimeOutTimer from TimeOutTimer.cpp 00004 * Part of : TaskManager 00005 * Created : 15/03/2006 by Forum Nokia 00006 * Version : 1.2 00007 * Copyright: Nokia Corporation 00008 * ============================================================================ 00009 */ 00010 00011 // INCLUDE FILES 00012 #include "TimeOutTimer.h" 00013 00014 // ================= MEMBER FUNCTIONS ======================= 00015 00016 // Constructor 00017 CTimeOutTimer::CTimeOutTimer( const TInt aPriority, 00018 MTimeoutNotifier& aNotify) 00019 : CTimer( aPriority ), iNotify( aNotify ) 00020 { 00021 00022 } 00023 00024 // Destructor 00025 CTimeOutTimer::~CTimeOutTimer() 00026 { 00027 } 00028 00029 // ---------------------------------------------------- 00030 // CTimeOutTimer::ConstructL() 00031 // Second-phase constructor 00032 // ---------------------------------------------------- 00033 // 00034 void CTimeOutTimer::ConstructL() 00035 { 00036 CTimer::ConstructL(); 00037 CActiveScheduler::Add( this ); 00038 } 00039 00040 // ---------------------------------------------------- 00041 // CTimeOutTimer::NewL() 00042 // Two-phased construction. 00043 // ---------------------------------------------------- 00044 // 00045 CTimeOutTimer* CTimeOutTimer::NewL( const TInt aPriority, 00046 MTimeoutNotifier& aNotify ) 00047 { 00048 CTimeOutTimer* self = CTimeOutTimer::NewLC( aPriority, aNotify ); 00049 CleanupStack::Pop( self ); 00050 return self; 00051 } 00052 00053 // ---------------------------------------------------- 00054 // CTimeOutTimer::NewLC() 00055 // Two-phased construction. 00056 // ---------------------------------------------------- 00057 // 00058 CTimeOutTimer* CTimeOutTimer::NewLC( const TInt aPriority, 00059 MTimeoutNotifier& aNotify ) 00060 { 00061 CTimeOutTimer* self = new (ELeave) CTimeOutTimer( aPriority, aNotify ); 00062 CleanupStack::PushL( self ); 00063 self->ConstructL(); 00064 return self; 00065 } 00066 00067 // ---------------------------------------------------- 00068 // CTimeOutTimer::RunL() 00069 // Handles an active object’s request completion event. 00070 // ---------------------------------------------------- 00071 // 00072 void CTimeOutTimer::RunL() 00073 { 00074 if( iStatus == KErrNone ) 00075 { 00076 iNotify.TimerExpired(); 00077 } 00078 else 00079 { 00080 User::Leave(iStatus.Int()); 00081 } 00082 } 00083 00084 TInt CTimeOutTimer::RunError( TInt /*aError*/ ) 00085 { 00086 return KErrNone; 00087 } 00088 00089 // End of file
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.