os/ossrv/genericopenlibs/openenvcore/libdl/inc/loadeddlls.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
* Name        : loadeddlls.h
sl@0
    16
* Part of     : libdl library
sl@0
    17
* Header file for loadeddlls.cpp
sl@0
    18
* 
sl@0
    19
*
sl@0
    20
*/
sl@0
    21
sl@0
    22
sl@0
    23
sl@0
    24
sl@0
    25
#ifndef _LOADEDDLLS_H_
sl@0
    26
#define _LOADEDDLLS_H_
sl@0
    27
sl@0
    28
// INCLUDE FILES
sl@0
    29
#include <e32base.h>//class CBase
sl@0
    30
#include <f32image.h>//E32EmulExpSymInfoHdr, E32EpocExpSymInfoHdr
sl@0
    31
sl@0
    32
sl@0
    33
#if defined(__WINSCW__) || defined(__WINS__)
sl@0
    34
typedef E32EmulExpSymInfoHdr TE32ExpSymInfoHdr;
sl@0
    35
#else
sl@0
    36
typedef E32EpocExpSymInfoHdr TE32ExpSymInfoHdr;
sl@0
    37
#endif
sl@0
    38
sl@0
    39
//-----------------------------------------------------------------------
sl@0
    40
//Class name: TDllEntry
sl@0
    41
//Description: It represents the item of CLoadedDlls, contains the data item
sl@0
    42
//				like library object, reference count etc
sl@0
    43
//-----------------------------------------------------------------------
sl@0
    44
class TDllEntry 
sl@0
    45
	{
sl@0
    46
public:
sl@0
    47
	static	TBool CompareByHandle(const TDllEntry& aEntry1, const TDllEntry& aEntry2);
sl@0
    48
	static  TBool CompareByPath(const TDllEntry& aEntry1, const TDllEntry& aEntry2);
sl@0
    49
	TDllEntry() {}
sl@0
    50
	TDllEntry(const TInt aHandle) { iLibrary.SetHandle(aHandle); }
sl@0
    51
	TDllEntry(const RLibrary& aLibrary, const TInt aFlag = 0);
sl@0
    52
sl@0
    53
	RLibrary iLibrary;
sl@0
    54
	TE32ExpSymInfoHdr* iSymbolHeader;
sl@0
    55
	TInt iFlags;
sl@0
    56
	TInt iRefCount;
sl@0
    57
	};
sl@0
    58
	
sl@0
    59
//-----------------------------------------------------------------------
sl@0
    60
//Class name: CLoadedDlls
sl@0
    61
//Description: It represents the list of the opened dlls. It is the main 
sl@0
    62
//			 class to manipulate the data on the opened dlls.
sl@0
    63
//-----------------------------------------------------------------------
sl@0
    64
NONSHARABLE_CLASS(CLoadedDlls) : public CBase
sl@0
    65
	{
sl@0
    66
public:
sl@0
    67
	CLoadedDlls();
sl@0
    68
	~CLoadedDlls();
sl@0
    69
	TInt Find(const void* aHandle) const;
sl@0
    70
	TInt Find(const RLibrary& aLibrary) const;
sl@0
    71
 	TInt Add(const TDllEntry& aDllItem);
sl@0
    72
	void Remove(const TInt aIndex);
sl@0
    73
	TDllEntry& At(const TInt aIndex);
sl@0
    74
	inline TInt CreateLock(){	return iLock.CreateLocal();	}
sl@0
    75
	inline void Lock() { iLock.Wait();	}
sl@0
    76
	inline void UnLock() { iLock.Signal();	}
sl@0
    77
	inline TInt Count() const 	{ return iHandleList.Count();}	
sl@0
    78
private:
sl@0
    79
	RFastLock iLock;
sl@0
    80
	RArray<TDllEntry> iHandleList;
sl@0
    81
	};
sl@0
    82
sl@0
    83
#endif //_LOADEDDLLS_H_