First public contribution.
1 // Copyright (c) 2003-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 // This file holds the class declarations for the ROM Address Lookup Cache
15 // feature of FBServ: CFbsRalCacheEl, CFbsRalCache.
27 This class holds the mapping between the name of a file held in ROM and
28 the logical address in the memory map that it can be found at. It is used as
29 an array element in the circular buffer in the CFbsRalCache object.
30 @internalComponent of Font Bitmap Server client library.
32 NONSHARABLE_CLASS(CFbsRalCacheEl) : public CBase
38 static CFbsRalCacheEl* New(const TDesC& aFilename, TAny* aMemAddr);
39 static void FreeOnly(CFbsRalCacheEl*& aThisRef);
41 TBool MatchKey(const TDesC& searchKey);
43 static TInt ToLower(TInt aInt);
45 /** The name of the file held in ROM */
47 /** The logical memory address to that start of the file in ROM */
49 /** Counter to track how many lookups are made for this file */
57 This class extends the fixed size circular buffer class to provide a most
58 recently used cache of filenames to memory addresses for files that are
59 held in ROM on the Z: drive. This facility is used in the client side
60 FBServ library so that ROM bitmaps are loaded as quickly as possible
61 without IPC to font bitmap server.
62 The class has been constructed so that its API does not use the Leave
63 mechanism and so instead it uses return values.
64 The caching policy used in its implementation is a Most-Recently-Used policy.
65 @internalComponent of Font Bitmap Server client library.
67 NONSHARABLE_CLASS(CFbsRalCache) : public CCirBuf<CFbsRalCacheEl>
71 static CFbsRalCache* New(TInt aCacheSize, RFs& aFs);
73 TAny* Lookup(const TDesC& aFileKey);
76 CFbsRalCache(RFs& aFs);
78 TBool AddItem(const TDesC& aFilename, TAny* aMemAddr);
86 /** Ref to a File Server session for use by the cache on lookups on
96 #endif /* __FBSRALC_H__ */