]> git.ipfire.org Git - thirdparty/squid.git/blob - src/StoreSearch.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / StoreSearch.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 #ifndef SQUID_STORESEARCH_H
10 #define SQUID_STORESEARCH_H
11
12 #include "base/RefCount.h"
13 #include "Store.h"
14
15 class StoreSearch : public RefCountable
16 {
17
18 public:
19 StoreSearch() {}
20
21 StoreSearch(StoreSearch const &); /* no implementation - trigger link failures */
22 virtual ~StoreSearch() {}
23
24 /* not ready yet
25 void asList(void (*) (CbDataList<StoreEntryPointer), void *cbdata);
26 */
27 /* callback the client when a new StoreEntry is available
28 * or an error occurs
29 */
30 virtual void next(void (callback)(void *cbdata), void *cbdata) = 0;
31 /* return true if a new StoreEntry is immediately available
32 * ???- not decided - if false, trigger making a new one available
33 * this would be for sync api users that will schedule their own callback
34 * to try again later. so if that next() has to allow multiple
35 * calls being made to it without error
36 */
37 virtual bool next() = 0;
38 virtual bool error() const = 0;
39 virtual bool isDone() const = 0;
40 virtual StoreEntry *currentItem() = 0;
41 };
42
43 typedef RefCount<StoreSearch> StoreSearchPointer;
44
45 #endif /* SQUID_STORESEARCH_H */
46