os/kernelhwsrv/kerneltest/f32test/bench/t_notify_perf.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/bench/t_notify_perf.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,115 @@
     1.4 +// Copyright (c) 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 the License "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 +// f32test\bench\t_notify_perf.inl
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +// start timing
    1.22 +inline TInt CTimerLogger::MeasureStart()
    1.23 +	{
    1.24 +	if (iTiming)
    1.25 +		return KErrGeneral;
    1.26 +	iTickNumber = User::NTickCount();
    1.27 +	iTiming = ETrue;
    1.28 +	
    1.29 +	return KErrNone;
    1.30 +	}
    1.31 +
    1.32 +// stop timing
    1.33 +inline TInt CTimerLogger::MeasureEnd()
    1.34 +	{
    1.35 +	if(!iTiming)
    1.36 +		return KErrGeneral;
    1.37 +	TUint32 tick =  User::NTickCount();
    1.38 +	iTickNumber = tick - iTickNumber;
    1.39 +	iTiming = EFalse;
    1.40 +	
    1.41 +	return KErrNone;
    1.42 +	}
    1.43 +
    1.44 +inline TBool CTimerLogger::Timing()
    1.45 +	{
    1.46 +	return iTiming;
    1.47 +	}
    1.48 +
    1.49 +//---------------------------------------------------------------------------
    1.50 +
    1.51 +inline void TTestSetting::Reset()
    1.52 +	{
    1.53 +	iNumFiles = 0;
    1.54 +	iOption = 0;
    1.55 +	iOperationList = NULL;
    1.56 +	}
    1.57 +
    1.58 +//---------------------------------------------------------------------------
    1.59 +
    1.60 +inline void CTestExecutor::SetTestSetting(TTestSetting& aSetting)
    1.61 +	{
    1.62 +	iTestSetting = aSetting;
    1.63 +	}
    1.64 +
    1.65 +//---------------------------------------------------------------------------
    1.66 +
    1.67 +// enable the plugin
    1.68 +inline TInt CMdsPluginControl::Enable()
    1.69 +	{
    1.70 +	return DoControl( EMdsFSPOpEnable );
    1.71 +	}
    1.72 +
    1.73 +// disable the plugin
    1.74 +inline TInt CMdsPluginControl::Disable()
    1.75 +	{
    1.76 +	return DoControl( EMdsFSPOpDisable );
    1.77 +	}
    1.78 +
    1.79 +// request notification from plugin
    1.80 +inline void CMdsPluginControl::RegisterNotification(TMdsFSPStatusPckg& aMdsFSPStatus, TRequestStatus& aStat )
    1.81 +	{
    1.82 +	DoRequest( EMdsFSPOpRegisterNotification, aStat, aMdsFSPStatus );
    1.83 +	}
    1.84 +
    1.85 +// add monitoring path
    1.86 +inline void CMdsPluginControl::AddNotificationPath( const TDesC& aPath )
    1.87 +	{
    1.88 +	TMdsFSPStatusPckg pckg;
    1.89 +	TRequestStatus rs;
    1.90 +	TMdsFSPStatus& status = pckg();
    1.91 +	
    1.92 +	status.iFileName.Zero();
    1.93 +	status.iFileName.Copy( aPath );
    1.94 +	
    1.95 +	DoRequest( EMdsFSPOpAddNotificationPath, rs, pckg );
    1.96 +	User::WaitForRequest( rs );
    1.97 +	}
    1.98 +
    1.99 +// remove the monitoring path
   1.100 +inline void CMdsPluginControl::RemoveNotificationPath( const TDesC& aPath )
   1.101 +	{
   1.102 +	TMdsFSPStatusPckg pckg;
   1.103 +	TRequestStatus rs;
   1.104 +	TMdsFSPStatus& status = pckg();
   1.105 +	
   1.106 +	status.iFileName.Zero();
   1.107 +	status.iFileName.Copy( aPath );
   1.108 +	
   1.109 +	DoRequest( EMdsFSPOpRemoveNotificationPath, rs, pckg );
   1.110 +	User::WaitForRequest( rs );
   1.111 +	}
   1.112 +
   1.113 +// cancel notification
   1.114 +inline void CMdsPluginControl::NotificationCancel()
   1.115 +	{
   1.116 +	DoCancel( EMdsFSPOpNotificationCancel );
   1.117 +	}
   1.118 +