analyzetool/commandlineengine/inc/catallocs.h
branchRCL_3
changeset 13 da2cedce4920
equal deleted inserted replaced
12:d27dfa8884ad 13:da2cedce4920
       
     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: Defines CATAllocs "collection" class.
       
    15 */
       
    16 
       
    17 #ifndef __CATALLOCS_H__
       
    18 #define __CATALLOCS_H__
       
    19 
       
    20 #include "../inc/ATCommonDefines.h"
       
    21 #include "../inc/CATBase.h"
       
    22 #include "../inc/catalloc.h"
       
    23 
       
    24 /**
       
    25 * Class representing a collection of memory allocations.
       
    26 * It is used to acquire the data of memory leaks by giving all
       
    27 * data on single allocations and frees.
       
    28 */
       
    29 class CATAllocs : public CATBase
       
    30 {
       
    31 public:
       
    32 	
       
    33 	/**
       
    34 	* "old" alloc message (prior to 1.6).
       
    35 	* @param sAllocString allocation string
       
    36 	*/
       
    37 	void Alloc( const string& sAllocString );
       
    38 
       
    39 	/*
       
    40 	* Alloc header message (multimessage call stack).
       
    41 	* @param sAllocHString allocation string
       
    42 	*/
       
    43 	void AllocH( const string& sAllocHString );
       
    44 
       
    45 	/*
       
    46 	* Alloc fragment message (fragment of call stack in multimessage alloc).
       
    47 	* @param sAllocFString allocation string
       
    48 	*/
       
    49 	void AllocF( const string& sAllocFString );
       
    50 
       
    51 	/**
       
    52 	* Free message.
       
    53 	* @param sFreeString string
       
    54 	*/
       
    55 	void Free( const string& sFreeString );
       
    56 	
       
    57 	/**
       
    58 	* Free header message.
       
    59 	* (not implemented yeat.)
       
    60 	* @param sFreeHString string
       
    61 	*/
       
    62 	void FreeH( const string& sFreeHString );
       
    63 
       
    64 	/**
       
    65 	* Free fragment message.
       
    66 	* (not implemented yeat.)
       
    67 	* @param sFreeFString string
       
    68 	*/
       
    69 	void FreeF( const string& sFreeFString );
       
    70 
       
    71 	/**
       
    72 	* Get "leak" list ordered by allocation time.
       
    73 	* @param vLeakList container where leaks stored
       
    74 	*/
       
    75 	void GetLeakList( vector<string>& vLeakList);
       
    76 	
       
    77 	/**
       
    78 	* Clear leaks.
       
    79 	*/
       
    80 	void ClearAllocs();
       
    81 #ifndef MODULE_TEST
       
    82 private:
       
    83 #endif
       
    84 	map<string, CATAlloc> m_vAllocs; /** Collection of allocation(s) */
       
    85 };
       
    86 #endif
       
    87 //EOF