文件名称:cpp_mru_cache
介绍说明--下载内容均来自于网络,请自行研究使用
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)
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)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 99273904cpp_mru_cache.zip 列表 code.cpp usage_example.cpp