]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/StoreHashIndex.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_STOREHASHINDEX_H
10 #define SQUID_STOREHASHINDEX_H
13 #include "StoreSearch.h"
15 /* A summary store that indexs all its children
21 class StoreHashIndex
: public Store
26 StoreHashIndex(StoreHashIndex
const &); /* to cause link failures */
27 virtual ~StoreHashIndex();
28 virtual int callback();
29 virtual void create();
31 virtual StoreEntry
* get
35 (String
const, STOREGETCLIENT
, void * cbdata
);
41 virtual uint64_t maxSize() const;
43 virtual uint64_t minSize() const;
45 virtual uint64_t currentSize() const;
47 virtual uint64_t currentCount() const;
49 virtual int64_t maxObjectSize() const;
51 virtual void getStats(StoreInfoStats
&stats
) const;
52 virtual void stat(StoreEntry
&) const;
54 virtual void reference(StoreEntry
&);
56 virtual bool dereference(StoreEntry
&, bool);
58 virtual void maintain();
60 virtual StoreSearch
*search(String
const url
, HttpRequest
*);
64 StorePointer
store(int const x
) const;
65 SwapDir
&dir(int const idx
) const;
68 class StoreHashIndexEntry
: public StoreEntry
71 class StoreSearchHashIndex
: public StoreSearch
73 CBDATA_CLASS(StoreSearchHashIndex
);
76 StoreSearchHashIndex(RefCount
<StoreHashIndex
> sd
);
77 StoreSearchHashIndex(StoreSearchHashIndex
const &);
78 virtual ~StoreSearchHashIndex();
79 /* Iterator API - garh, wrong place */
80 /* callback the client when a new StoreEntry is available
83 virtual void next(void (callback
)(void *cbdata
), void *cbdata
);
84 /* return true if a new StoreEntry is immediately available */
86 virtual bool error() const;
87 virtual bool isDone() const;
88 virtual StoreEntry
*currentItem();
90 RefCount
<StoreHashIndex
> sd
;
94 void (*callback
)(void *cbdata
);
98 std::vector
<StoreEntry
*> entries
;
101 #endif /* SQUID_STOREHASHINDEX_H */