1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // A revised version of the CRegisteredParserDll class. This no longer uses a
15 // reference to a CParserRegistrationData object. Instead a UidType is passed in
16 // the constructor, or through a set method. The class is used to find the file
17 // which contains a parser, to load and maintain a reference count of the number of
18 // objects using the dll, so that it can be unloaded when no longer required.
19 // It will also unload the dll when a new parser is required.
25 #ifndef __REGPSDLL_H__
26 #define __REGPSDLL_H__
32 // forward declarations
38 // Real non-derivable class
40 class CRegisteredParserDll : public CTimer
41 /** Finds, loads and maintains a reference count of client processes for a BIO
44 When the reference count falls to 0, the class is also responsible for unloading
45 the DLL. The public interface for this class is used only by CBIOServerMtm.
51 IMPORT_C static CRegisteredParserDll* NewL(TDesC& aParserName);
53 IMPORT_C ~CRegisteredParserDll();
55 inline TInt DllRefCount() const;
56 inline TUidType UidType() const;
57 inline void SetUidType(const TUidType& aUidType);
59 IMPORT_C TInt GetLibrary(RFs& aFs,RLibrary& aDllLibrary); // Increments reference count if successful or returns error
60 IMPORT_C void ReleaseLibrary(); // Decrements access count
61 // Should be called from destructor of any objects created from the library
63 CRegisteredParserDll(const TDesC& aParserName);
66 void LoadLibraryL(RFs& aFs);
67 TInt FindFullName(RFs& aFs,TDes& aFullName);
72 RLibrary iParserDllLibrary;
76 enum { KReleaseLibraryTimeout = 30000000 };
79 #include <regpsdll.inl>