]> git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/ufs/StoreSearchUFS.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / fs / ufs / StoreSearchUFS.h
1 /*
2 * Copyright (C) 1996-2019 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_FS_UFS_STORESEARCHUFS_H
10 #define SQUID_FS_UFS_STORESEARCHUFS_H
11
12 #include "StoreSearch.h"
13 #include "UFSSwapDir.h"
14
15 namespace Fs
16 {
17 namespace Ufs
18 {
19
20 class StoreSearchUFS : public StoreSearch
21 {
22 CBDATA_CLASS(StoreSearchUFS);
23
24 public:
25 StoreSearchUFS(RefCount<UFSSwapDir> sd);
26 virtual ~StoreSearchUFS();
27
28 /** \todo Iterator API - garh, wrong place */
29 /**
30 * callback the client when a new StoreEntry is available
31 * or an error occurs
32 */
33 virtual void next(void (callback)(void *cbdata), void *cbdata);
34
35 /**
36 \retval true if a new StoreEntry is immediately available
37 \retval false if a new StoreEntry is NOT immediately available
38 */
39 virtual bool next();
40
41 virtual bool error() const;
42 virtual bool isDone() const;
43 virtual StoreEntry *currentItem();
44
45 RefCount<UFSSwapDir> sd;
46 RemovalPolicyWalker *walker;
47
48 private:
49 /// \bug (callback) should be hidden behind a proper human readable name
50 void (callback)(void *cbdata);
51 void *cbdata;
52 StoreEntry * current;
53 bool _done;
54
55 StoreSearchUFS(StoreSearchUFS const &); //disabled
56 StoreSearchUFS& operator=(StoreSearchUFS const &); //disabled
57 StoreSearchUFS(); //disabled
58 };
59
60 } //namespace Ufs
61 } //namespace Fs
62 #endif /* SQUID_FS_UFS_STORESEARCHUFS_H */
63