|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef CMDNSCACHEMANAGER_H_ |
|
18 #define CMDNSCACHEMANAGER_H_ |
|
19 |
|
20 #include <e32base.h> |
|
21 |
|
22 #include "cmdnscachemap.h" |
|
23 #include "mdnscachemgr.h" |
|
24 |
|
25 class CMDNSCacheManager : public CBase,public MDNSCacheMgr |
|
26 { |
|
27 public: |
|
28 |
|
29 IMPORT_C static CMDNSCacheManager* NewL(TUint aMaxCacheEntries); |
|
30 IMPORT_C static CMDNSCacheManager* NewLC(TUint aMaxCacheEntries); |
|
31 IMPORT_C static CMDNSCacheManager* NewL(); |
|
32 |
|
33 //From MDNSCacheMgr |
|
34 IMPORT_C void UpdateCacheL(CDnsResourceData& aEntry,TBool aAuthoritative,TUint32 aSessionId); |
|
35 IMPORT_C TInt FindServiceL(RPointerArray <CCacheEntry> & aEntries,const TDesC8& aName,TDnsType aType)const; |
|
36 IMPORT_C TInt DeleteEntryL(const TDesC8& aServiceInstanceName); |
|
37 IMPORT_C void FlushCache(); |
|
38 IMPORT_C CCacheEntry* NextStaleEntry(TBool aActiveCacheMgmtEnabled,TBool aIteratorReset); |
|
39 IMPORT_C void AuthoritativeEntriesL(RPointerArray <CCacheEntry> & aEntries); |
|
40 IMPORT_C TUint NumberOfEntries(); |
|
41 IMPORT_C void DumpCacheL(); |
|
42 |
|
43 |
|
44 IMPORT_C TUint32 CacheEntryCount(); |
|
45 |
|
46 ~CMDNSCacheManager(); |
|
47 |
|
48 private: |
|
49 |
|
50 void CacheEntryL(CCacheEntry* aTargetEntry,const CServiceInfo* aSourceEntry)const; |
|
51 void UpdateCacheEntry(CServiceInfo* aEntry,CDnsResourceData* aRecordInfo); |
|
52 CMDNSCacheManager(); |
|
53 void ConstructL(TUint aMaxCacheEntries); |
|
54 |
|
55 private: |
|
56 |
|
57 CMDNSCacheMap* iHashMap; |
|
58 |
|
59 RPointerArray <CServiceInfo> iAuthoritativeEntries; |
|
60 |
|
61 }; |
|
62 |
|
63 #endif /*CMDNSCACHEMANAGER_H_*/ |