analyzetool/analyzetoolcleaner/src/analyzetoolcleaner.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 14:26:55 +0300
changeset 22 a009639409f5
permissions -rw-r--r--
Revision: 201021 Kit: 2010121

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  THookCleaner implementation
*
*/

// INCLUDES
#include "analyzetoolcleaner.h"
#include <e32debug.h>
#include "atlog.h"

// Global cleaner object
static THookCleaner cleaner;

// ordinal 1
EXPORT_C ATCLEANERTABLE* GetCallBackAddress()
    {
    LOGSTR1( "ATC GetCallBackAddress()" );
    
    return &( cleaner.iTable );
    }

// -----------------------------------------------------------------------------
// THookCleaner::THookCleaner()
// C++ default constructor can NOT contain any code, that
// might leave.
// -----------------------------------------------------------------------------
//
THookCleaner::THookCleaner()
    {
    LOGSTR1( "ATC THookCleaner::THookCleaner()" );
    
    iTable.Reset();
    }

// -----------------------------------------------------------------------------
// THookCleaner::~THookCleaner()
// Destructor.
// -----------------------------------------------------------------------------
//
THookCleaner::~THookCleaner()
    {
    LOGSTR1( "ATC THookCleaner::~THookCleaner()" );
    
    for ( TUint i = 0; i < ATCLEANERTABLESIZE; i++ )
        {
        if ( iTable.At( i ) )
            {
            TAnalyzeToolCleanerBase* obj =
                    ( TAnalyzeToolCleanerBase* ) iTable.At( i );
            obj->Cleanup();
            }
        }
    }

// End of File