On Sat, Oct 19, 2013 at 09:35:39PM +0200, Mark wrote: > On Sat, Oct 19, 2013 at 9:20 PM, Richard Moore <[email protected]> wrote: > > On 19 October 2013 18:43, Mark <[email protected]> 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 > >> in. > > > > If you need to know when something is evicted then it's not really > > acting as just a cache. That said, you could do it by making the > > object in the cache inform you in its destructor. > > > > Rich. > > hmm, that could work. Never thought about using the destructor. > On the other hand, i would get into trouble when the object isn't only > in the cache but also in other places. Then a destruction signal might > not necessarily mean that it's removed from the cache.
You could keep a flag in the object that's only set when you want that behaviour, i.e. which is set when you insert it into your "cache". Andre' _______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
