CCustomResolverCache Class Reference

class CCustomResolverCache : public CTimer

Handles caching custom resolvers

Inherits from

Public Member Functions
~CCustomResolverCache()
TBool CacheLookup(const TUid, TProxyNewLPtr &)
TInt CacheResolver(const TUid, RLibrary, TProxyNewLPtr, TUint32)
TBool CachingEnabled()
CCustomResolverCache *NewL(TUint32, TUint32)
TBool Remove(const TUid)
voidRemoveItemsWithFlags(TUint32)
Private Member Functions
CCustomResolverCache(TUint32)
voidConstructL(TUint32)
voidEvictLeastRecentlyUsed()
TInt FindResolver(const TUid)
voidRemove(TInt)
voidRunL()
voidSetLastUseTime(RResolverCacheEntry &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CTimer::After(TTimeIntervalMicroSeconds32)
CTimer::At(const TTime &)
CTimer::AtUTC(const TTime &)
CTimer::CTimer(TInt)
CTimer::ConstructL()
CTimer::DoCancel()
CTimer::HighRes(TTimeIntervalMicroSeconds32)
CTimer::Inactivity(TTimeIntervalSeconds)
CTimer::Lock(TTimerLockSpec)
CTimer::~CTimer()
Inherited Enumerations
CActive:TPriority
Private Attributes
TUint iEntryTimeToLive
TUint32 iMaxCacheSize
TUint iMostRecentTimestamp
RArray< RResolverCacheEntry >iResolvers
TInt iSystemTickPeriod
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CCustomResolverCache(TUint32)

CCustomResolverCache(TUint32aCacheSize)[private]

CCustomResolverCache constructor

Parameters

TUint32 aCacheSizeMaximum number of entries allowed to cache.

~CCustomResolverCache()

~CCustomResolverCache()[virtual]

Member Functions Documentation

CacheLookup(const TUid, TProxyNewLPtr &)

TBool CacheLookup(const TUidaResolverUid,
TProxyNewLPtr &aNewLFuncPtr
)
Search for a resolverUID. If found, return the NewL pointer and update time to live of the entry.
Post-condition
If cache hit, the timestamp of the entry is updated.

Parameters

const TUid aResolverUidthe resolver to lookup
TProxyNewLPtr & aNewLFuncPtroutput parameter. If lookup successful it has the function pointer to instantiate the resolver.

CacheResolver(const TUid, RLibrary, TProxyNewLPtr, TUint32)

TInt CacheResolver(const TUidaResolverUid,
RLibraryaLib,
TProxyNewLPtraNewL,
TUint32aFlags
)

Add a resolver library to cache

Parameters

const TUid aResolverUidImplementation UID of the resolver.
RLibrary aLibThe RLibrary object which has the resolver loaded. The handle of the RLibrary is owned by the cache if call is successful.
TProxyNewLPtr aNewLvalue for the iNewLFuncPtr member data of RResolverCacheEntry.
TUint32 aFlagsvalue for the iFlags member data of RResolverCacheEntry.

CachingEnabled()

TBool CachingEnabled()const

Check if both queue size and cache timeout are non zero

ConstructL(TUint32)

voidConstructL(TUint32aCacheTimeout)[private]
Standard two phase construction to complete construction of the CCustomResolverCache object.
leave
Any of the system wide error codes.

Parameters

TUint32 aCacheTimeoutCache timeout in microseconds.

EvictLeastRecentlyUsed()

voidEvictLeastRecentlyUsed()[private]

evict the least recently used entry in cache

FindResolver(const TUid)

TInt FindResolver(const TUidaResolverUid)const [private]

Search of a resolver UID in cache

Parameters

const TUid aResolverUidthe resolver to search for.

NewL(TUint32, TUint32)

CCustomResolverCache *NewL(TUint32aCacheSize,
TUint32aCacheTimeout
)[static]
static factory method to instantiate CCustomResolverCache
leave
Any of the system wide error codes.

Parameters

TUint32 aCacheSizeMaximum number of entries allowed to cache.
TUint32 aCacheTimeoutCache timeout in microseconds.

Remove(const TUid)

TBool Remove(const TUidaResolverUid)

Remove a resolver from cache.

Parameters

const TUid aResolverUidIdentify the resolver to remove.

Remove(TInt)

voidRemove(TIntaIndex)[private]

Remove a cached entry

Parameters

TInt aIndexposition of entry in the array.

RemoveItemsWithFlags(TUint32)

voidRemoveItemsWithFlags(TUint32aMask)

Remove cached entries with flags set.

Parameters

TUint32 aMaskIf an entry has any of the bits in aMask set, it is removed.

RunL()

voidRunL()[private, virtual]

Implement the CActive RunL pure virtual

SetLastUseTime(RResolverCacheEntry &)

voidSetLastUseTime(RResolverCacheEntry &aEntry)[private]

Set the iLastUse field and iLruRank field of the entry. The iLruRank field serves as tie breaker when two entries are added within the same tick period.

Parameters

RResolverCacheEntry & aEntryThe entry to update.

Member Data Documentation

TUint iEntryTimeToLive

TUint iEntryTimeToLive[private]

cache timeout value. Unit is number of system ticks

TUint32 iMaxCacheSize

TUint32 iMaxCacheSize[private]

max. number of entries allowed in iResolvers

TUint iMostRecentTimestamp

TUint iMostRecentTimestamp[private]

Keep track of youngest timestamp of cache entries. Use to detect if two entries have same timestamp.

RArray< RResolverCacheEntry > iResolvers

RArray< RResolverCacheEntry >iResolvers[private]

list of cached resolvers

TInt iSystemTickPeriod

TInt iSystemTickPeriod[private]

Store the system tick period as member data to avoid having to invoke HAL::Get() repeatedly.