messagingappbase/ncnlist/src/NcnTimer.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 "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 *       This class defines functionality for small timer
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "NcnBaseTimer.h"
       
    23 #include "NcnTimer.h"
       
    24 #include "NcnModel.h"
       
    25 
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // C++ default constructor can NOT contain any code that
       
    30 // might leave.
       
    31 //
       
    32 CNcnTimer::CNcnTimer( MNcnTimer& aObserver ) 
       
    33     :
       
    34     CTimer( EPriorityStandard ),
       
    35     iObserver( aObserver )
       
    36     {
       
    37     CActiveScheduler::Add( this );    
       
    38     }
       
    39 
       
    40 
       
    41 // Symbian OS default constructor can leave.
       
    42 void CNcnTimer::ConstructL()
       
    43     {
       
    44     CTimer::ConstructL();
       
    45     }
       
    46 
       
    47 // Two-phased constructor.
       
    48 CNcnTimer* CNcnTimer::NewL( MNcnTimer& aInterface )
       
    49     {
       
    50     // Create object
       
    51     CNcnTimer* self =
       
    52         new ( ELeave ) CNcnTimer( aInterface );
       
    53 
       
    54     // Push to cleanupstack while constructing
       
    55     CleanupStack::PushL( self );
       
    56     self->ConstructL();
       
    57     CleanupStack::Pop();
       
    58 
       
    59     return self;
       
    60     }
       
    61 
       
    62 
       
    63 // Destructor
       
    64 CNcnTimer::~CNcnTimer()
       
    65     {
       
    66     Cancel();
       
    67     }
       
    68 
       
    69 // ----------------------------------------------------
       
    70 // CNcnTimer::RunL
       
    71 // ----------------------------------------------------
       
    72 void CNcnTimer::RunL()
       
    73     {
       
    74     iObserver.NcnTimerCompleted();
       
    75     }
       
    76 
       
    77 
       
    78 //  End of File