browserutilities/favouritesengine/ClientServer/srvsrc/Timeout.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *      Implementation of class CTimeout
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include "Timeout.h"
       
    24 #include "FavouritesLogger.h"
       
    25 #include "FavouritesPanic.h"
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // CTimeout::NewL()
       
    31 // ---------------------------------------------------------
       
    32 //
       
    33 CTimeout* CTimeout::NewL( TInt aPriority, TCallBack aCallBack )
       
    34     {
       
    35     CTimeout* timeout = new (ELeave) CTimeout( aPriority, aCallBack );
       
    36     CleanupStack::PushL( timeout );
       
    37     timeout->ConstructL();
       
    38     CleanupStack::Pop( timeout );
       
    39     return timeout;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------
       
    43 // CTimeout::~CTimeout()
       
    44 // ---------------------------------------------------------
       
    45 //
       
    46 CTimeout::~CTimeout()
       
    47     {
       
    48     Cancel();
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CTimeout::RunL()
       
    53 // ---------------------------------------------------------
       
    54 //
       
    55 void CTimeout::RunL()
       
    56     {
       
    57     FLOG(( _L("CTimeout::RunL iStatus(%d)"), iStatus.Int() ));
       
    58 #ifdef _DEBUG
       
    59     TBool again =
       
    60 #endif /* def _DEBUG */
       
    61     iCallBack.CallBack();
       
    62     // Assert that this is a "once-only" callback.
       
    63     __ASSERT_DEBUG( !again, FavouritesPanic( EFavouritesInternal ) );
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CTimeout::CTimeout()
       
    68 // ---------------------------------------------------------
       
    69 //
       
    70 CTimeout::CTimeout( TInt aPriority, TCallBack aCallBack )
       
    71 : CTimer( aPriority ), iCallBack( aCallBack )
       
    72     {
       
    73     CActiveScheduler::Add( this );
       
    74     }
       
    75 
       
    76 //  End of File