Does anyone know any implementation of a templated cache of objects?
For example :
typedef cache<int, MyObj*> MyCache;
MyCache oCache;
oCache.SetSize(1);
oCache.Insert(make_pair(1, new MyObj());
oCache.Touch(1);
MyObj* oldObj = oCache.Delete(1);
...
It can be as simple as a LRU or MRU cache.
Any suggestions are welcomed!
Nic
An object cache is a recently used object definition stored in memory on Developer and Intelligence Server. You browse an object definition when you open the editor for that object. You can create object caches for applications.
Object Caching : Object caching is caching the objects on a page, such as data-bound controls. The cached data is stored in server memory. Class Caching : Web pages or web services are compiled into a page class in the assembly, when run for the first time. Then the assembly is cached in the server.
You can use the Boost.MultiIndex library. It is easy to implement a MRU cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With