timeouttimer.cpp

来自「symbian s60 end to end socket程序源码 基于第二版」· C++ 代码 · 共 90 行

CPP
90
字号
/*
* ============================================================================
*  Name     : CTimeOutTimer from TimeOutTimer.cpp
*  Part of  : TaskManager
*  Created  : 15/03/2006 by Forum Nokia
*  Version  : 1.2
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#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 + =
减小字号Ctrl + -
显示快捷键?