资 源 简 介
I suppose you know what a MRU cache is, otherwise you wouldn t been reading this.
This is an implementation of a very simple one using only STL.
To implement a cache, derive a subclass from this template class.
As an implementor, you d have to implement two methods:
HandleNonExistingKeyFetch - to handle cache misses. In this method you access the real source of data behind the cache and return the value.
HandleItemRelease - (optional) called when an item is removed from the cache.
The cache class is a template of two types, a key and value (like hash map). The value type is the type of the resource and the key type is the type of the resource address. (this is how you fetch a resource) -I suppose you know what a MRU cache is, otherwise you wouldn t been reading this.This is an implementation of a very simple one using only STL.To implement a cache, derive a subclass from this template class.As an implementor, you d have to implement two methods: HandleNonExistingKeyF