[Interest] Qt based LRU container?
mandeepsandhu.chd at gmail.com
Sun Oct 20 13:28:23 CEST 2013
I wrote a ordered map sometime back using a QHash and QLinkedList.
In the 'examples' section, I've implemented a simple LRU cache using
the ordered map.
Once the capacity of the cache is reached and a new item is inserted,
we take the first element of the ordered map, which is the least
recently used item, and remove it.
You could easily modify this code to emit a signal when this eviction happens.
On Sat, Oct 19, 2013 at 11:13 PM, Mark <markg85 at gmail.com> wrote:
> Does anyone know of an LRU based container for Qt? I'm specifically
> looking for an implementation that notifies me when something gets
> removed due to LRU kicking in. QCache would be nearly OK for my needs,
> but it doesn't notify me when something drops out due to LRU kicking
> I prefer if the container itself is a list though a map/hash would
> work for me as well.
> Interest mailing list
> Interest at qt-project.org
More information about the Interest