memspy/Engine/Include/SysMemTracker/MemSpyEngineHelperSysMemTrackerEntryManager.h
changeset 0 a03f92240627
equal deleted inserted replaced
-1:000000000000 0:a03f92240627
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MEMSPYENGINEHELPERSYSMEMTRACKERENTRYMANAGER_H
       
    19 #define MEMSPYENGINEHELPERSYSMEMTRACKERENTRYMANAGER_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // User includes
       
    25 #include <memspy/engine/memspyenginehelpersysmemtrackerenums.h>
       
    26 
       
    27 // Classes referenced
       
    28 class CMemSpyEngine;
       
    29 class CMemSpyThread;
       
    30 class CMemSpyProcess;
       
    31 class TMemSpyDriverChunkInfo;
       
    32 class CMemSpyEngineChunkList;
       
    33 class CMemSpyEngineHelperSysMemTrackerImp;
       
    34 class CMemSpyEngineHelperSysMemTrackerCycle;
       
    35 class CMemSpyEngineHelperSysMemTrackerEntry;
       
    36 
       
    37 
       
    38 
       
    39 
       
    40 NONSHARABLE_CLASS( CMemSpyEngineHelperSysMemTrackerEntryManager ) : public CBase
       
    41     {
       
    42 public:
       
    43     static CMemSpyEngineHelperSysMemTrackerEntryManager* NewL( CMemSpyEngineHelperSysMemTrackerImp& aTracker );
       
    44     static CMemSpyEngineHelperSysMemTrackerEntryManager* NewL( CMemSpyEngineHelperSysMemTrackerImp& aTracker, CMemSpyEngineHelperSysMemTrackerEntryManager& aMasterList );
       
    45     ~CMemSpyEngineHelperSysMemTrackerEntryManager();
       
    46 
       
    47 protected:
       
    48     CMemSpyEngineHelperSysMemTrackerEntryManager( CMemSpyEngineHelperSysMemTrackerImp& aTracker, CMemSpyEngineHelperSysMemTrackerEntryManager* aMasterList = NULL );
       
    49     void ConstructL();
       
    50 
       
    51 public: // API
       
    52     void IdentifyChangesL( CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
       
    53     void EverythingHasChangedL( CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
       
    54 
       
    55 private: // Internal methods
       
    56     void ProcessChangesL( CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
       
    57     void AddItemAndPopL( CMemSpyEngineHelperSysMemTrackerEntry* aItem );
       
    58     void MarkEverythingDead();
       
    59     void MergeListIntoMeL( CMemSpyEngineHelperSysMemTrackerEntryManager& aOtherList );
       
    60     TInt FindByHandle( TUint aHandle, TMemSpyEngineSysMemTrackerType aType ) const;
       
    61     TInt FindByThreadId( const TThreadId& aThreadId ) const;
       
    62     CMemSpyEngineHelperSysMemTrackerEntry* EntryByKey( const TUint64& aKey );
       
    63     CMemSpyEngine& Engine();
       
    64 
       
    65 private: // Internal access
       
    66     inline TBool ActingAsSecondaryList() const { return iMasterList != NULL; }
       
    67 
       
    68 private: // Sort order
       
    69     static TInt CompareKey( const CMemSpyEngineHelperSysMemTrackerEntry& aLeft, const CMemSpyEngineHelperSysMemTrackerEntry& aRight );
       
    70     static TInt CompareKeyAndTimeStamp( const CMemSpyEngineHelperSysMemTrackerEntry& aLeft, const CMemSpyEngineHelperSysMemTrackerEntry& aRight );
       
    71 
       
    72 private: // Seed creation
       
    73     void CreateSeedItemsL();
       
    74     void CreateSeedItemsHeapUserL( CMemSpyEngineChunkList& aList );
       
    75     void CreateSeedItemsHeapUserL( CMemSpyProcess& aProcess, CMemSpyEngineChunkList* aList = NULL );
       
    76     void CreateSeedItemsHeapUserL( CMemSpyThread& aThread, CMemSpyEngineChunkList* aList = NULL );
       
    77     void CreateSeedItemsHeapKernelL( CMemSpyEngineChunkList& aList );
       
    78     void CreateSeedItemsChunkLocalL( CMemSpyEngineChunkList& aList );
       
    79     void CreateSeedItemsChunkGlobalL( CMemSpyEngineChunkList& aList );
       
    80     void CreateSeedItemsGlobalDataL( CMemSpyEngineChunkList& aList );
       
    81     void CreateSeedItemRamDriveL( CMemSpyEngineChunkList& aList );
       
    82     void CreateSeedItemsBitmapL( CMemSpyEngineChunkList& aList );
       
    83     void CreateSeedItemsStacksL( CMemSpyEngineChunkList& aList );
       
    84     void CreateSeedItemsStacksL( CMemSpyThread& aThread, const TMemSpyDriverChunkInfo& aStackChunkInfo );
       
    85     void CreateSeedItemsFileServerCacheL( CMemSpyEngineChunkList& aList );
       
    86     void CreateSeedItemsCodeL();
       
    87     void CreateSeedItemsHandlesL();
       
    88     void CreateSeedItemsOpenFilesL();
       
    89     void CreateSeedItemsDiskSpaceL();
       
    90     void CreateSeedItemsSystemMemoryL();
       
    91     void CreateSeedItemsWindowServerL();
       
    92 
       
    93 private:
       
    94     CMemSpyEngineHelperSysMemTrackerImp& iTracker;
       
    95     CMemSpyEngineHelperSysMemTrackerEntryManager* iMasterList;
       
    96     RPointerArray< CMemSpyEngineHelperSysMemTrackerEntry > iEntries;
       
    97     };
       
    98 
       
    99 
       
   100 #endif