buildverification/autosmoketest/messaging/Src/TestMessTimer.cpp
changeset 15 5b5908ec640f
parent 13 3a35f7917fa6
child 17 03d9ade4748d
equal deleted inserted replaced
13:3a35f7917fa6 15:5b5908ec640f
     1 // Copyright (c) 2004-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 // TestMessTimer.h
       
    15 // This contains CTestMessTimer
       
    16 // EPOC includes
       
    17 // 
       
    18 //
       
    19 
       
    20 #include "TestMessTimer.h"
       
    21 #include "TestMessProcessor.h"
       
    22 
       
    23 //
       
    24 // Construction/Destruction
       
    25 //
       
    26 
       
    27 CTestMessTimer* CTestMessTimer::NewL(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
       
    28 	{
       
    29 	CTestMessTimer*	self=new(ELeave) CTestMessTimer(aInterval, aProcessor);
       
    30 	CleanupStack::PushL(self);
       
    31 	self->ConstructL();
       
    32 	CleanupStack::Pop();
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 CTestMessTimer::CTestMessTimer(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
       
    37 : CTimer(EPriorityStandard)
       
    38 , iInterval(aInterval)
       
    39 , iProcessor(aProcessor)
       
    40 	{
       
    41 	}
       
    42 
       
    43 void CTestMessTimer::ConstructL()
       
    44 	{
       
    45 	CTimer::ConstructL();
       
    46 	CActiveScheduler::Add(this);
       
    47 	}
       
    48 
       
    49 
       
    50 CTestMessTimer::~CTestMessTimer()
       
    51 	{
       
    52 	}
       
    53 
       
    54 void CTestMessTimer::RunL()
       
    55 	{
       
    56 	iProcessor.DisplayProgress();
       
    57 	IssueRequest();
       
    58 	};
       
    59 
       
    60 void CTestMessTimer::IssueRequest()
       
    61 	{
       
    62 	After(iInterval);
       
    63 	}