00001 /******************************************************************************** 00002 * * 00003 * Q C a c h e T h u n k * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2003 by Niall Douglas. All Rights Reserved. * 00007 * NOTE THAT I DO NOT PERMIT ANY OF MY CODE TO BE PROMOTED TO THE GPL * 00008 ********************************************************************************* 00009 * This code is free software; you can redistribute it and/or modify it under * 00010 * the terms of the GNU Library General Public License v2.1 as published by the * 00011 * Free Software Foundation EXCEPT that clause 3 does not apply ie; you may not * 00012 * "upgrade" this code to the GPL without my prior written permission. * 00013 * Please consult the file "License_Addendum2.txt" accompanying this file. * 00014 * * 00015 * This code is distributed in the hope that it will be useful, * 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 00018 ********************************************************************************* 00019 * $Id: * 00020 ********************************************************************************/ 00021 00022 #ifndef QCACHE_H 00023 #define QCACHE_H 00024 00025 #include "FXLRUCache.h" 00026 #include "qdict.h" 00027 00028 namespace FX { 00029 00039 template<class type> class QCache : public FXLRUCache< QDict<type> > 00040 { 00041 typedef FXLRUCache< QDict<type> > Base; 00042 public: 00044 QCache(FXuint maxCost=100, FXuint size=13, bool caseSensitive=true, bool autodel=false) 00045 : Base(maxCost, size, autodel) 00046 { 00047 setCaseSensitive(caseSensitive); 00048 } 00049 using Base::caseSensitive; 00050 using Base::setCaseSensitive; 00051 }; 00052 00057 template<class type> class QCacheIterator : public FXLRUCacheIterator< FXLRUCache< QDict<type> > > 00058 { 00059 public: 00060 QCacheIterator(const QCache<type> &d) : FXLRUCacheIterator< FXLRUCache< QDict<type> > >(d) { } 00061 }; 00062 00063 } // namespace 00064 00065 #endif