1 /* GemRB - Infinity Engine Emulator
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "Variables.h"
30 class GEM_EXPORT LRUCache
{
35 // set value, overwriting any previous entry
36 void SetAt(const char* key
, void* value
);
37 bool Lookup(const char* key
, void*& value
) const;
38 bool Touch(const char* key
);
39 bool Remove(const char* key
);
43 // return n-th LRU entry. key remains owned by LRUCache.
44 // (n = 0 is least recently used, n = 1 the next least recently used,
46 bool getLRU(unsigned int n
, const char*& key
, void*& value
) const;
54 void removeFromList(VarEntry
* e
);