applayerpluginsandutils/bookmarksupport/test/cenrepsrv/srvperf.cpp
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 #include "srvperf.h"
       
    17 
       
    18 #ifdef __CENTREP_SERVER_PERFTEST__
       
    19 
       
    20 #include "srvreqs.h"
       
    21 
       
    22 TUint32 TCentRepPerfTest::iEntries[KCentRepPerfTestArraySize];
       
    23 TUint   TCentRepPerfTest::iCount;
       
    24 TUint   TCentRepPerfTest::iActiveSessionCount;
       
    25 TUint   TCentRepPerfTest::iLastCompleteAccess;
       
    26 TUint   TCentRepPerfTest::iEndOfBootCount;
       
    27 
       
    28 // SessionClose
       
    29 // Decrement reference count. If no more active sessions
       
    30 // then advance iLastCompleteAccess
       
    31 void TCentRepPerfTest::SessionClose()
       
    32 	{
       
    33 	iActiveSessionCount--;
       
    34 	// There are clients who never close their sessions. Hence
       
    35 	// cannot use iActiveSessionCount == 0 as indication to copy
       
    36 	// iCount to iLastCompleteAccess.
       
    37 
       
    38 	if (!IsFinished())
       
    39 		{
       
    40 		iLastCompleteAccess = iCount;
       
    41 		}
       
    42 	}
       
    43 
       
    44 // Append
       
    45 // Add the integer if iEntries array is not full yet.
       
    46 TInt TCentRepPerfTest::Append(TUint32 aEntry)
       
    47 	{
       
    48 	if (iCount < KCentRepPerfTestArraySize)
       
    49 		{
       
    50 		iEntries[iCount++] = aEntry;
       
    51 		return KErrNone;
       
    52 		}
       
    53 	return KErrOverflow;
       
    54 	}
       
    55 
       
    56 #endif //__CENTREP_SERVER_PERFTEST__
       
    57