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