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 )
void RemoveItemsWithFlags ( TUint32 )
Private Member Functions
CCustomResolverCache ( TUint32 )
void ConstructL ( TUint32 )
void EvictLeastRecentlyUsed ()
TInt FindResolver (const TUid )
void Remove ( TInt )
void RunL ()
void SetLastUseTime ( 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 ( TUint32 aCacheSize ) [private]

Parameters

TUint32 aCacheSize Maximum number of entries allowed to cache.

~CCustomResolverCache()

~CCustomResolverCache ( ) [virtual]

Member Functions Documentation

CacheLookup(const TUid, TProxyNewLPtr &)

TBool CacheLookup ( const TUid aResolverUid,
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 aResolverUid the resolver to lookup
TProxyNewLPtr & aNewLFuncPtr output parameter. If lookup successful it has the function pointer to instantiate the resolver.

CacheResolver(const TUid, RLibrary, TProxyNewLPtr, TUint32)

TInt CacheResolver ( const TUid aResolverUid,
RLibrary aLib,
TProxyNewLPtr aNewL,
TUint32 aFlags
)

Add a resolver library to cache

Parameters

const TUid aResolverUid Implementation UID of the resolver.
RLibrary aLib The RLibrary object which has the resolver loaded. The handle of the RLibrary is owned by the cache if call is successful.
TProxyNewLPtr aNewL value for the iNewLFuncPtr member data of RResolverCacheEntry.
TUint32 aFlags value for the iFlags member data of RResolverCacheEntry.

CachingEnabled()

TBool CachingEnabled ( ) const

Check if both queue size and cache timeout are non zero

ConstructL(TUint32)

void ConstructL ( TUint32 aCacheTimeout ) [private]
Standard two phase construction to complete construction of the CCustomResolverCache object.
leave
Any of the system wide error codes.

Parameters

TUint32 aCacheTimeout Cache timeout in microseconds.

EvictLeastRecentlyUsed()

void EvictLeastRecentlyUsed ( ) [private]

evict the least recently used entry in cache

FindResolver(const TUid)

TInt FindResolver ( const TUid aResolverUid ) const [private]

Search of a resolver UID in cache

Parameters

const TUid aResolverUid the resolver to search for.

NewL(TUint32, TUint32)

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

Parameters

TUint32 aCacheSize Maximum number of entries allowed to cache.
TUint32 aCacheTimeout Cache timeout in microseconds.

Remove(const TUid)

TBool Remove ( const TUid aResolverUid )

Remove a resolver from cache.

Parameters

const TUid aResolverUid Identify the resolver to remove.

Remove(TInt)

void Remove ( TInt aIndex ) [private]

Remove a cached entry

Parameters

TInt aIndex position of entry in the array.

RemoveItemsWithFlags(TUint32)

void RemoveItemsWithFlags ( TUint32 aMask )

Remove cached entries with flags set.

Parameters

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

RunL()

void RunL ( ) [private, virtual]

Implement the CActive RunL pure virtual

SetLastUseTime(RResolverCacheEntry &)

void SetLastUseTime ( 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 & aEntry The 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.