analyzetool/storageserver/server/src/atmemoryentry.cpp
branchRCL_3
changeset 59 8ad140f3dd41
parent 19 da2cedce4920
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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:  Definitions for the class CATMemoryEntry
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "atmemoryentry.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CATMemoryEntry::CATMemoryEntry
       
    29 // C++ default constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 //  
       
    32 CATMemoryEntry::CATMemoryEntry( TUint32 aMemAddress,
       
    33                                 const CBufFlat* aCallstackBuf,
       
    34                                 const TInt64& aAllocTime,
       
    35                                 TInt aAllocSize ) :
       
    36     iMemAddress( aMemAddress ),
       
    37     iCallstackBuf( aCallstackBuf ),
       
    38     iAllocTime( aAllocTime ),
       
    39     iAllocSize( aAllocSize )
       
    40     {
       
    41     }
       
    42 
       
    43 // Destructor
       
    44 CATMemoryEntry::~CATMemoryEntry()
       
    45     {
       
    46     delete const_cast<CBufFlat*>( iCallstackBuf );
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CATMemoryEntry::Compare
       
    51 // -----------------------------------------------------------------------------
       
    52 //  
       
    53 TInt CATMemoryEntry::Compare( const CATMemoryEntry& aFirst, const CATMemoryEntry& aSecond )
       
    54     {
       
    55     if ( aFirst.iAllocTime < aSecond.iAllocTime )
       
    56         {
       
    57         return -1;
       
    58         }
       
    59     
       
    60     if ( aFirst.iAllocTime > aSecond.iAllocTime )
       
    61         {
       
    62         return 1;
       
    63         }
       
    64    
       
    65     // else
       
    66     return 0;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CATMemoryEntry::Match
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 TBool CATMemoryEntry::Match( const CATMemoryEntry& aFirst, const CATMemoryEntry& aSecond )
       
    74     {
       
    75     if ( aFirst.iMemAddress == aSecond.iMemAddress )
       
    76         {
       
    77         return ETrue;
       
    78         }
       
    79     
       
    80     // else
       
    81     return EFalse;
       
    82     }
       
    83 
       
    84