📄 timeouttimer.cpp
字号:
/*
* ============================================================================
* Name : CTimeOutTimer from TimeOutTimer.cpp
* Part of : TaskManager
* Created : 08/31/2005 by Forum Nokia
* Version : 1.0
* Copyright: Nokia Corporation
* ============================================================================
*/
#include "TimeOutTimer.h"
// ================= MEMBER FUNCTIONS =======================
// Constructor
CTimeOutTimer::CTimeOutTimer( const TInt aPriority,
MTimeoutNotifier& aNotify)
: CTimer( aPriority ), iNotify( aNotify )
{
}
// Destructor
CTimeOutTimer::~CTimeOutTimer()
{
}
// ----------------------------------------------------
// CTimeOutTimer::ConstructL()
// Second-phase constructor
// ----------------------------------------------------
//
void CTimeOutTimer::ConstructL()
{
CTimer::ConstructL();
CActiveScheduler::Add( this );
}
// ----------------------------------------------------
// CTimeOutTimer::NewL()
// Two-phased construction.
// ----------------------------------------------------
//
CTimeOutTimer* CTimeOutTimer::NewL( const TInt aPriority,
MTimeoutNotifier& aNotify )
{
CTimeOutTimer* self = CTimeOutTimer::NewLC( aPriority, aNotify );
CleanupStack::Pop( self );
return self;
}
// ----------------------------------------------------
// CTimeOutTimer::NewLC()
// Two-phased construction.
// ----------------------------------------------------
//
CTimeOutTimer* CTimeOutTimer::NewLC( const TInt aPriority,
MTimeoutNotifier& aNotify )
{
CTimeOutTimer* self = new (ELeave) CTimeOutTimer( aPriority, aNotify );
CleanupStack::PushL( self );
self->ConstructL();
return self;
}
// ----------------------------------------------------
// CTimeOutTimer::RunL()
// Handles an active object抯 request completion event.
// ----------------------------------------------------
//
void CTimeOutTimer::RunL()
{
if( iStatus == KErrNone )
{
iNotify.TimerExpired();
}
else
{
User::Leave(iStatus.Int());
}
}
TInt CTimeOutTimer::RunError( TInt /*aError*/ )
{
return KErrNone;
}
// End of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -