serviceproviders/sapi_logging/tsrc/testing/tlogprovidertest/src/tcallback.cpp
author Pat Downey <patrick.downey@nokia.com>
Fri, 03 Jul 2009 15:51:24 +0100
changeset 5 989d2f495d90
child 23 50974a8b132e
permissions -rw-r--r--
Revision: 200923 Kit: 200925

/*
* Copyright (c) 2009 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 <e32svr.h>
#include <e32std.h>
#include <StifParser.h>
#include <Stiftestinterface.h>
#include <logcli.h>
#include <logwrap.h>
#include <LiwServiceHandler.h>
#include <LiwCommon.h>

#include "tlogprovidertest.h"

#include "tcallback.h"
#include "liwlogiter.h"
#include"tconstants.h"
// _LIT8(KLogIter , "Iterator") ;



//-------------------------------------------------------------
// Generic call back function implementation, used by logging 
// component
//--------------------------------------------------------------

static TInt count = 0 ;

//--------------------------------------------------------------
// Default constructor
//--------------------------------------------------------------

tcallback :: tcallback()
	{
	 iScheduler = new CActiveSchedulerWait() ;
	}

//----------------------------------------------------------------
// Default destructor
//----------------------------------------------------------------

tcallback :: ~tcallback()
	{
	delete iScheduler ;
	}
	
//-----------------------------------------------------------------
//Starts the async wait loop
//-----------------------------------------------------------------


void tcallback :: Start()
	{
	 iScheduler->Start() ;
	}
	
TInt tcallback :: HandleNotifyL(TInt aCmdId,TInt aEventId,
                     CLiwGenericParamList& aEventParamList,
                   const CLiwGenericParamList& aInParamList)
{
 	++count ;
    TInt pos=0;
 	const TLiwGenericParam *LogIterParam = aInParamList.FindFirst(pos , KLogIter)  ;
 	
 	if(pos != KErrNotFound)
 	    {
        CLiwIterable *liwiter = (LogIterParam->Value()).AsIterable() ;
        liwiter->Reset() ;
   	    
 	    }
    
    aEventParamList.Reset();
    //aInParamList.Reset();
    /*(const_cast<CLiwGenericParamList&>(aInParamList)).Reset() ;
    delete &aEventParamList;
    delete &aInParamList;*/
	if(count > 0)
		{
		if(iScheduler->IsStarted())
		 iScheduler->AsyncStop() ;
		}
	iRetVal = KErrNone ;
	


}