kerneltest/f32test/bench/t_notify_perf.inl
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 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 the License "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 // f32test\bench\t_notify_perf.inl
       
    15 // 
       
    16 //
       
    17 
       
    18 // start timing
       
    19 inline TInt CTimerLogger::MeasureStart()
       
    20 	{
       
    21 	if (iTiming)
       
    22 		return KErrGeneral;
       
    23 	iTickNumber = User::NTickCount();
       
    24 	iTiming = ETrue;
       
    25 	
       
    26 	return KErrNone;
       
    27 	}
       
    28 
       
    29 // stop timing
       
    30 inline TInt CTimerLogger::MeasureEnd()
       
    31 	{
       
    32 	if(!iTiming)
       
    33 		return KErrGeneral;
       
    34 	TUint32 tick =  User::NTickCount();
       
    35 	iTickNumber = tick - iTickNumber;
       
    36 	iTiming = EFalse;
       
    37 	
       
    38 	return KErrNone;
       
    39 	}
       
    40 
       
    41 inline TBool CTimerLogger::Timing()
       
    42 	{
       
    43 	return iTiming;
       
    44 	}
       
    45 
       
    46 //---------------------------------------------------------------------------
       
    47 
       
    48 inline void TTestSetting::Reset()
       
    49 	{
       
    50 	iNumFiles = 0;
       
    51 	iOption = 0;
       
    52 	iOperationList = NULL;
       
    53 	}
       
    54 
       
    55 //---------------------------------------------------------------------------
       
    56 
       
    57 inline void CTestExecutor::SetTestSetting(TTestSetting& aSetting)
       
    58 	{
       
    59 	iTestSetting = aSetting;
       
    60 	}
       
    61 
       
    62 //---------------------------------------------------------------------------
       
    63 
       
    64 // enable the plugin
       
    65 inline TInt CMdsPluginControl::Enable()
       
    66 	{
       
    67 	return DoControl( EMdsFSPOpEnable );
       
    68 	}
       
    69 
       
    70 // disable the plugin
       
    71 inline TInt CMdsPluginControl::Disable()
       
    72 	{
       
    73 	return DoControl( EMdsFSPOpDisable );
       
    74 	}
       
    75 
       
    76 // request notification from plugin
       
    77 inline void CMdsPluginControl::RegisterNotification(TMdsFSPStatusPckg& aMdsFSPStatus, TRequestStatus& aStat )
       
    78 	{
       
    79 	DoRequest( EMdsFSPOpRegisterNotification, aStat, aMdsFSPStatus );
       
    80 	}
       
    81 
       
    82 // add monitoring path
       
    83 inline void CMdsPluginControl::AddNotificationPath( const TDesC& aPath )
       
    84 	{
       
    85 	TMdsFSPStatusPckg pckg;
       
    86 	TRequestStatus rs;
       
    87 	TMdsFSPStatus& status = pckg();
       
    88 	
       
    89 	status.iFileName.Zero();
       
    90 	status.iFileName.Copy( aPath );
       
    91 	
       
    92 	DoRequest( EMdsFSPOpAddNotificationPath, rs, pckg );
       
    93 	User::WaitForRequest( rs );
       
    94 	}
       
    95 
       
    96 // remove the monitoring path
       
    97 inline void CMdsPluginControl::RemoveNotificationPath( const TDesC& aPath )
       
    98 	{
       
    99 	TMdsFSPStatusPckg pckg;
       
   100 	TRequestStatus rs;
       
   101 	TMdsFSPStatus& status = pckg();
       
   102 	
       
   103 	status.iFileName.Zero();
       
   104 	status.iFileName.Copy( aPath );
       
   105 	
       
   106 	DoRequest( EMdsFSPOpRemoveNotificationPath, rs, pckg );
       
   107 	User::WaitForRequest( rs );
       
   108 	}
       
   109 
       
   110 // cancel notification
       
   111 inline void CMdsPluginControl::NotificationCancel()
       
   112 	{
       
   113 	DoCancel( EMdsFSPOpNotificationCancel );
       
   114 	}
       
   115