I need a caching library in C++ that acts a bit like Guave's Loading Cache.
It should include the following:
I have looked at the STL, Boost and searched around but I am unable to find anything with this functionality.
Check out POCO. I believe its caching framework will suit your needs.
ExpireLRUCache<int, string> cache(
1024, // cacheSize
600000 // expiration (10 minutes)
);
cache.add( 1, "Cached string 1" );
cache.add( 10, "Cached string 10" );
Sleep( 601000 );
Shared_ptr<string> pVal = cache.get( 10 );
assert( pVal.isNull() ); // the element has expired
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