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 { |