template<class dictbase, class type>
TypeAsReturn FX::FXLRUCache< dictbase, type >::find ( KeyTypeAsParam  k,
bool  tofront = true 
) const [inline, inherited]

Finds the item associated with key k, returning zero if not found. Marks the item as most recently used if tofront is true.

Definition at line 226 of file FXLRUCache.h.

Referenced by FX::FXLRUCache< FX::QDict< type > >::operator[]().

00227     {
00228         CacheItem *ci=(CacheItem *) dictbase::find(k);
00229         if(!ci)
00230         {
00231             ++stats.misses;
00232             return 0;
00233         }
00234         ++stats.hits;
00235         if(tofront)
00236         {
00237             cache.splice(cache.begin(), cache, ci->myit);
00238             // ci->myit=cache.begin();
00239         }
00240         return ci->itemPtr();
00241     }


(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:39 2009 for TnFOX by doxygen v1.4.7