memana/analyzetoolclient/storageserver/server/src/atmemoryentry.cpp
author Matti Laitinen <matti.t.laitinen@nokia.com>
Thu, 11 Feb 2010 15:51:35 +0200
changeset 0 f0f2b8682603
permissions -rw-r--r--
Add initial version of AnalyzeTool client under EPL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     1
/*
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     8
*
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    11
*
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    12
* Contributors:
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    13
*
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    14
* Description:  Definitions for the class CATMemoryEntry
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    15
*
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    16
*/
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    17
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    18
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    19
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    20
// INCLUDE FILES
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    21
#include    "atmemoryentry.h"
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    22
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    23
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    24
// ============================ MEMBER FUNCTIONS ===============================
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    25
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    26
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    27
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    28
// CATMemoryEntry::CATMemoryEntry
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    29
// C++ default constructor.
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    30
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    31
//  
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    32
CATMemoryEntry::CATMemoryEntry( TUint32 aMemAddress,
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    33
                                const CBufFlat* aCallstackBuf,
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    34
                                const TInt64& aAllocTime,
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    35
                                TInt aAllocSize ) :
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    36
    iMemAddress( aMemAddress ),
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    37
    iCallstackBuf( aCallstackBuf ),
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    38
    iAllocTime( aAllocTime ),
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    39
    iAllocSize( aAllocSize )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    40
    {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    41
    }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    42
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    43
// Destructor
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    44
CATMemoryEntry::~CATMemoryEntry()
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    45
    {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    46
    delete const_cast<CBufFlat*>( iCallstackBuf );
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    47
    }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    48
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    49
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    50
// CATMemoryEntry::Compare
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    52
//  
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    53
TInt CATMemoryEntry::Compare( const CATMemoryEntry& aFirst, const CATMemoryEntry& aSecond )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    54
    {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    55
    if ( aFirst.iAllocTime < aSecond.iAllocTime )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    56
        {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    57
        return -1;
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    58
        }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    59
    
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    60
    if ( aFirst.iAllocTime > aSecond.iAllocTime )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    61
        {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    62
        return 1;
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    63
        }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    64
   
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    65
    // else
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    66
    return 0;
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    67
    }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    68
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    69
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    70
// CATMemoryEntry::Match
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    71
// -----------------------------------------------------------------------------
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    72
//
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    73
TBool CATMemoryEntry::Match( const CATMemoryEntry& aFirst, const CATMemoryEntry& aSecond )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    74
    {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    75
    if ( aFirst.iMemAddress == aSecond.iMemAddress )
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    76
        {
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    77
        return ETrue;
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    78
        }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    79
    
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    80
    // else
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    81
    return EFalse;
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    82
    }
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    83
f0f2b8682603 Add initial version of AnalyzeTool client under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff changeset
    84