userlibandfileserver/fileserver/sfile/sf_std.h
branchRCL_3
changeset 21 e7d2d738d3c2
parent 19 4a8fed1c0ef6
child 23 1df514389a47
equal deleted inserted replaced
20:597aaf25e343 21:e7d2d738d3c2
  1396 private:
  1396 private:
  1397 	TUint iThreadHandle;
  1397 	TUint iThreadHandle;
  1398 	TRequestStatus iStatus;
  1398 	TRequestStatus iStatus;
  1399 	TBool iIsAllocated;
  1399 	TBool iIsAllocated;
  1400 	};
  1400 	};
  1401 const TInt KMaxRequestAllocated		= 45;
  1401 
  1402 const TInt KMaxOperationAllocated	= KMaxRequestAllocated * 2;
  1402 // If the number of requests on the free queue reaches this value then completed requests 
  1403 const TInt KAllocReqBlock=15;
  1403 // are returned to the heap rather than being added to thefree queue
       
  1404 const TInt KFreeCountMax = 64;
  1404 
  1405 
  1405 class TParseCon
  1406 class TParseCon
  1406 	{
  1407 	{
  1407 public:
  1408 public:
  1408 	TParse iParse;
  1409 	TParse iParse;
  1411 
  1412 
  1412 
  1413 
  1413 class RequestAllocator
  1414 class RequestAllocator
  1414 	{
  1415 	{
  1415 public:
  1416 public:
       
  1417 	static TInt Initialise();
       
  1418 
  1416 	static TInt GetMessageRequest(const TOperation& aOperation,const RMessage2& aMessage,CFsClientMessageRequest* &aRequest);
  1419 	static TInt GetMessageRequest(const TOperation& aOperation,const RMessage2& aMessage,CFsClientMessageRequest* &aRequest);
  1417 	static void FreeRequest(CFsClientMessageRequest* aRequest); // Use the one from cache
  1420 	static void FreeRequest(CFsClientMessageRequest* aRequest);
  1418 	static void OpenSubFailed(CSessionFs* aSession); 
  1421 	static void OpenSubFailed(CSessionFs* aSession); 
  1419 	static TInt AllocRequest(TInt aNum);
  1422 
  1420 
  1423 #if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE)
  1421 	static TInt AllocOperation();
  1424 	inline static TInt RequestCount();
       
  1425 	inline static TInt RequestCountPeak();
       
  1426 	static TInt CloseCount();
       
  1427 	static TInt FreeCount();
       
  1428 #endif
       
  1429 
       
  1430 private:
       
  1431 	static CFsClientMessageRequest* GetRequest();
       
  1432 
       
  1433 private:
       
  1434 	static RFastLock iCacheLock;
       
  1435 	static CFsClientMessageRequest* iFreeHead;				
       
  1436 	static CFsClientMessageRequest* iCloseHead;
       
  1437 
       
  1438 	static TInt iRequestCount;			// current number of requests
       
  1439 	static TInt iFreeCount;				// current number of requests on free queue
       
  1440 	static TInt iRequestCountPeak;				// maximum value of requests reached
       
  1441 	};
       
  1442 
       
  1443 class OperationAllocator
       
  1444 	{
       
  1445 public:
       
  1446 	static TInt Initialise();
       
  1447 
  1422 	static TInt GetOperation(TMsgOperation* &aOperation);
  1448 	static TInt GetOperation(TMsgOperation* &aOperation);
  1423 	static void FreeOperation(TMsgOperation* aOperation);
  1449 	static void FreeOperation(TMsgOperation* aOperation);
  1424 
  1450 
  1425 
       
  1426 	static void Initialise();
       
  1427 #if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE)
  1451 #if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE)
  1428 	inline static TInt TotalCount();
  1452 	inline static TInt RequestCount();
  1429 	static TInt CloseCount();
  1453 	inline static TInt RequestCountPeak();
  1430 	static TInt FreeCount();
  1454 	inline static TInt FreeCount();
  1431 	inline static TInt AllocatedCount();
       
  1432 private:
       
  1433 	static TInt iAllocated;
       
  1434 #endif
  1455 #endif
  1435 public:
  1456 
       
  1457 private:
  1436 	static RFastLock iCacheLock;
  1458 	static RFastLock iCacheLock;
  1437 private:
  1459 	static TMsgOperation* iFreeHead;
  1438 	static TInt iAllocNum;
  1460 
  1439 	static CFsClientMessageRequest* iFreeHead;				
  1461 	static TInt iRequestCount;			// current number of requests
  1440 	static CFsClientMessageRequest* iCloseHead;
  1462 	static TInt iFreeCount;				// current number of requests on free queue
  1441 
  1463 	static TInt iRequestCountPeak;				// maximum value of requests reached
  1442 	static TInt iAllocNumOperation;
       
  1443 	static TMsgOperation* iFreeHeadSupOp;
       
  1444 	};
  1464 	};
  1445 
  1465 
  1446 
  1466 
  1447 NONSHARABLE_CLASS(CNotifyInfo) : public CBase
  1467 NONSHARABLE_CLASS(CNotifyInfo) : public CBase
  1448 	{
  1468 	{