os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/plugintimer.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/plugintimer.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +#include "plugintimer.h"
1.22 +#include <featmgr/featureinfoplugin.h>
1.23 +#include "trace.h"
1.24 +
1.25 +CPluginTimer* CPluginTimer::NewL( const TTimeIntervalMicroSeconds32& anInterval,
1.26 + MFeatureInfoPluginCallback& aService,
1.27 + FeatureInfoCommand::TFeatureInfoCmd aCommandId,
1.28 + TUint8 aTransId,
1.29 + TInt aRetVal,
1.30 + MPluginTimerCallback* aCallback )
1.31 + {
1.32 + CPluginTimer* self = new( ELeave ) CPluginTimer(0, aService, aCommandId,
1.33 + aTransId, aRetVal, aCallback);
1.34 +
1.35 + CleanupStack::PushL( self );
1.36 + self->ConstructL();
1.37 + CleanupStack::Pop( self );
1.38 +
1.39 + CActiveScheduler::Add(self);
1.40 +
1.41 + self->After(anInterval);
1.42 +
1.43 + return self;
1.44 + }
1.45 +
1.46 +CPluginTimer::~CPluginTimer()
1.47 + {
1.48 + // PCLint demands
1.49 + iCallback = NULL;
1.50 + }
1.51 +
1.52 +CPluginTimer::CPluginTimer( TInt aPriority,
1.53 + MFeatureInfoPluginCallback& aService,
1.54 + FeatureInfoCommand::TFeatureInfoCmd aCommandId,
1.55 + TUint8 aTransId,
1.56 + TInt aRetVal,
1.57 + MPluginTimerCallback* aCallback )
1.58 + : CTimer(aPriority),
1.59 + iService(aService),
1.60 + iCommandId(aCommandId),
1.61 + iTransId(aTransId),
1.62 + iRetVal(aRetVal),
1.63 + iCallback(aCallback)
1.64 + {
1.65 + }
1.66 +
1.67 +void CPluginTimer::ConstructL()
1.68 + {
1.69 + CTimer::ConstructL();
1.70 + }
1.71 +
1.72 +
1.73 +void CPluginTimer::RunL( )
1.74 + {
1.75 + iCallback->GenericTimerFiredL(iService, iCommandId, iTransId, iRetVal );
1.76 +
1.77 + }