diff -r 826cea16efd9 -r 13a33d82ad98 videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/CIptvTestTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/CIptvTestTimer.cpp Wed Sep 01 12:20:37 2010 +0100 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: +* +*/ + + + +// INCLUDE FILES +#include "CIptvTestTimer.h" +#include "MIptvTestTimerObserver.h" +#include "VCXTestLog.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CIptvTestTimer:: +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CIptvTestTimer* CIptvTestTimer::NewL(MIptvTestTimerObserver& aObserver, TInt aId) + { + VCXLOGLO1(">>>CIptvTestTimer::NewL"); + CIptvTestTimer* self = new (ELeave) CIptvTestTimer(aObserver, aId); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + VCXLOGLO1("<<>>CIptvTestTimer::~CIptvTestTimer"); + iRestartAfterCancel = EFalse; + Cancel(); + iTimer.Close(); + + if( IsAdded() ) + { + Deque(); // calls also Cancel() + } + + VCXLOGLO1("<<>>CIptvTestTimer::CancelTimer"); + if( IsActive() ) + { + iRestartAfterCancel = EFalse; + Cancel(); + } + VCXLOGLO1("<<>>CIptvTestTimer::CIptvTestTimer"); + CActiveScheduler::Add(this); + VCXLOGLO1("<<>>CIptvTestTimer::ConstructL"); + User::LeaveIfError(iTimer.CreateLocal()); + VCXLOGLO1("<<>>CIptvTestTimer::DoCancel"); + iTimer.Cancel(); + VCXLOGLO1("<<