os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/plugintimer.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 
    18 #include "plugintimer.h"
    19 #include <featmgr/featureinfoplugin.h>
    20 #include "trace.h"
    21 
    22 CPluginTimer* CPluginTimer::NewL( const TTimeIntervalMicroSeconds32& anInterval, 
    23                                   MFeatureInfoPluginCallback& aService,
    24                                   FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    25                                   TUint8 aTransId, 
    26                                   TInt aRetVal,
    27                                   MPluginTimerCallback* aCallback )
    28     {
    29     CPluginTimer* self = new( ELeave ) CPluginTimer(0, aService, aCommandId, 
    30                                                     aTransId, aRetVal, aCallback);
    31     
    32     CleanupStack::PushL( self );
    33     self->ConstructL();
    34     CleanupStack::Pop( self );
    35 
    36     CActiveScheduler::Add(self);
    37 
    38     self->After(anInterval);
    39 
    40     return self;
    41     }
    42 
    43 CPluginTimer::~CPluginTimer()    
    44     {
    45     // PCLint demands
    46     iCallback = NULL; 
    47     }
    48 
    49 CPluginTimer::CPluginTimer( TInt aPriority, 
    50                             MFeatureInfoPluginCallback& aService,
    51                             FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    52                             TUint8 aTransId,
    53                             TInt aRetVal,
    54                             MPluginTimerCallback* aCallback )
    55     : CTimer(aPriority),
    56     iService(aService),
    57     iCommandId(aCommandId),
    58     iTransId(aTransId),
    59     iRetVal(aRetVal),
    60     iCallback(aCallback)
    61     {
    62     }
    63 
    64 void CPluginTimer::ConstructL()
    65     {
    66     CTimer::ConstructL();
    67     }
    68 
    69     
    70 void CPluginTimer::RunL(  )
    71     {
    72     iCallback->GenericTimerFiredL(iService, iCommandId, iTransId, iRetVal );
    73 
    74     }