sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Name : loadeddlls.h sl@0: * Part of : libdl library sl@0: * Header file for loadeddlls.cpp sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #ifndef _LOADEDDLLS_H_ sl@0: #define _LOADEDDLLS_H_ sl@0: sl@0: // INCLUDE FILES sl@0: #include //class CBase sl@0: #include //E32EmulExpSymInfoHdr, E32EpocExpSymInfoHdr sl@0: sl@0: sl@0: #if defined(__WINSCW__) || defined(__WINS__) sl@0: typedef E32EmulExpSymInfoHdr TE32ExpSymInfoHdr; sl@0: #else sl@0: typedef E32EpocExpSymInfoHdr TE32ExpSymInfoHdr; sl@0: #endif sl@0: sl@0: //----------------------------------------------------------------------- sl@0: //Class name: TDllEntry sl@0: //Description: It represents the item of CLoadedDlls, contains the data item sl@0: // like library object, reference count etc sl@0: //----------------------------------------------------------------------- sl@0: class TDllEntry sl@0: { sl@0: public: sl@0: static TBool CompareByHandle(const TDllEntry& aEntry1, const TDllEntry& aEntry2); sl@0: static TBool CompareByPath(const TDllEntry& aEntry1, const TDllEntry& aEntry2); sl@0: TDllEntry() {} sl@0: TDllEntry(const TInt aHandle) { iLibrary.SetHandle(aHandle); } sl@0: TDllEntry(const RLibrary& aLibrary, const TInt aFlag = 0); sl@0: sl@0: RLibrary iLibrary; sl@0: TE32ExpSymInfoHdr* iSymbolHeader; sl@0: TInt iFlags; sl@0: TInt iRefCount; sl@0: }; sl@0: sl@0: //----------------------------------------------------------------------- sl@0: //Class name: CLoadedDlls sl@0: //Description: It represents the list of the opened dlls. It is the main sl@0: // class to manipulate the data on the opened dlls. sl@0: //----------------------------------------------------------------------- sl@0: NONSHARABLE_CLASS(CLoadedDlls) : public CBase sl@0: { sl@0: public: sl@0: CLoadedDlls(); sl@0: ~CLoadedDlls(); sl@0: TInt Find(const void* aHandle) const; sl@0: TInt Find(const RLibrary& aLibrary) const; sl@0: TInt Add(const TDllEntry& aDllItem); sl@0: void Remove(const TInt aIndex); sl@0: TDllEntry& At(const TInt aIndex); sl@0: inline TInt CreateLock(){ return iLock.CreateLocal(); } sl@0: inline void Lock() { iLock.Wait(); } sl@0: inline void UnLock() { iLock.Signal(); } sl@0: inline TInt Count() const { return iHandleList.Count();} sl@0: private: sl@0: RFastLock iLock; sl@0: RArray iHandleList; sl@0: }; sl@0: sl@0: #endif //_LOADEDDLLS_H_