Hi,
I have several objects.
Can I keep them in memory and access the data when I need as .NET memory cache?
cache.add("key", myclass);
cache["key"].value...
I am using vs2019, c++20.
Where should I start to achieve this?
Thanks you!
Hi,
I have several objects.
Can I keep them in memory and access the data when I need as .NET memory cache?
cache.add("key", myclass);
cache["key"].value...
I am using vs2019, c++20.
Where should I start to achieve this?
Thanks you!
You need to implement your own class because there isn't one, for example
class Cache
{
// TODO: Implement code...
};
If you enable the “Common Language Runtime Support” (C++/CLI), then you can use the WeakReference and MemoryCache classes.
In case of normal C++, I think that the automatic expiration and eviction of objects is problematic — it will require a specific redesigned allocation functions (malloc, new, etc.).
Maybe you can develop your own cache for your large objects.
Check some attempts too: https://www.bing.com/search?q=c%2B%2B+cache.
8 people are following this question.