Update contrib.
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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "trequestorder.h"
24 CRequestOrder::CRequestOrder(TInt aNumberAsynchronousRequests) :
25 iNumberAsynchronousRequests(aNumberAsynchronousRequests)
29 CRequestOrder::~CRequestOrder()
35 void CRequestOrder::ConstructL()
37 User::LeaveIfError(iLock.CreateLocal());
39 iOrderArray = new (ELeave) TOrderArray[iNumberAsynchronousRequests];
40 User::LeaveIfNull(iOrderArray);
45 CRequestOrder* CRequestOrder::NewL(const TInt aNumberAsynchronousRequests)
47 CRequestOrder* requestOrder = new (ELeave) CRequestOrder(aNumberAsynchronousRequests);
48 CleanupStack::PushL(requestOrder);
49 requestOrder->ConstructL();
55 void CRequestOrder::ResetAll()
59 iOrderIndexComposition=0;
62 for(TInt i=0; i<iNumberAsynchronousRequests;i++)
64 iOrderArray[i].iType = EOrderErr;
65 iOrderArray[i].iNumber = 0;
69 TInt CRequestOrder::GetIndex()
74 void CRequestOrder::SetOrder(TOrderType aOrderType)
77 iOrderArray[iIndex].iType = aOrderType;
82 iOrderArray[iIndex].iNumber = iOrderIndexBefore++;
85 case EOrderComposition:
87 iOrderArray[iIndex].iNumber = iOrderIndexComposition++;
92 iOrderArray[iIndex].iNumber = iOrderIndexAfter++;
97 _LIT(KMsg, "GRAPHICS-SURFACEUPDATE-0003");
106 TOrderType CRequestOrder::GetOrderType(TInt aIndex)
108 return iOrderArray[aIndex].iType;
111 TInt CRequestOrder::GetOrderNumber(TInt aIndex)
113 return iOrderArray[aIndex].iNumber;