diff -r 6a20128ce557 -r ebfee66fde93 mmsengine/mmswatcher/src/mmspollingtimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsengine/mmswatcher/src/mmspollingtimer.cpp Fri Jun 04 10:25:39 2010 +0100 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This creates an event at regular intervals. +* +*/ + + + +// INCLUDE FILES +#include +#include +#include + +#include "mmspollingtimer.h" +#include "mmswatcherdebuglogging.h" +#include "mmsconst.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KMmsFirstPollingInterval = 5000000; // 5 seconds + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// ==================== LOCAL FUNCTIONS ==================== + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMmsPollingTimer::CMmsPollingTimer +// --------------------------------------------------------- +// +CMmsPollingTimer::CMmsPollingTimer() + :CTimer ( EPriorityStandard ) + { + } + +// --------------------------------------------------------- +// CMmsPollingTimer::ConstructL +// --------------------------------------------------------- +// +void CMmsPollingTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CMmsPollingTimer::NewL +// --------------------------------------------------------- +// +CMmsPollingTimer* CMmsPollingTimer::NewL() + { + CMmsPollingTimer* self = new ( ELeave ) CMmsPollingTimer; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CMmsPollingTimer::~CMmsPollingTimer +// --------------------------------------------------------- +// +CMmsPollingTimer::~CMmsPollingTimer() + { + Cancel(); + } + +// --------------------------------------------------------- +// CMmsPollingTimer::Start +// --------------------------------------------------------- +// +void CMmsPollingTimer::Start( MMsvSessionObserver* aRequester, const TInt aTimerValue ) + { + // Store reference to object that will be called back + iRequester = (MMsvSessionObserver*) aRequester; + // Store timeout value that will be used regularly + iTimeout = aTimerValue; + // First timeout however will occur after fixed 5 seconds in order to give time for + // emulator statup + After( KMmsFirstPollingInterval ); + } + +// --------------------------------------------------------- +// CMmsPollingTimer::RunL() +// --------------------------------------------------------- +// +void CMmsPollingTimer::RunL() + { + LOG( _L("CMmsPollingTimer::RunL") ); + TMsvId tid = KMsvSentEntryId; + iRequester->HandleSessionEventL( + MMsvSessionObserver::EMsvEntriesCreated, + NULL, + &tid, + NULL ); + + After( iTimeout ); + } + +// --------------------------------------------------------- +// CMmsPollingTimer::DoCancel() +// --------------------------------------------------------- +// +void CMmsPollingTimer::DoCancel() + { + LOG( _L("CMmsPollingTimer::DoCancel") ); + CTimer::DoCancel(); + } + +// ================= OTHER EXPORTED FUNCTIONS ============== + +// End of File +