blob: ec4471f30c65b46fc30517306a74e70b950ebb07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
template <class T>
class QuickList
{
private:
struct Item
{
T data;
Item *prev, *next;
};
struct CacheItem
{
CacheItem() : item(0), no(0) {}
Item *item;
int no;
};
Item *head, *tail;
int cacheSize, cacheStep, cacheUsed;
CacheItem *cache;
CacheItem last;
public:
QuickList(int theCacheSize = 100, int theCacheStep = )
{
head = tail = 0;
cacheSize = theCacheSize;
cacheStep = theCacheStep;
cacheUsed = 0;
cache = new CacheItem[cacheSize];
}
~QuickList()
{
delete[] cache;
}
};
|