]>
Commit | Line | Data |
---|---|---|
4e0938ef | 1 | /* |
f70aedc4 | 2 | * Copyright (C) 1996-2021 The Squid Software Foundation and contributors |
4e0938ef AJ |
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 | ||
c8f4eac4 | 9 | #ifndef TEST_TESTSWAPDIR |
10 | #define TEST_TESTSWAPDIR | |
11 | ||
2745fea5 | 12 | #include "store/Disk.h" |
c8f4eac4 | 13 | |
14 | class TestSwapDir : public SwapDir | |
15 | { | |
16 | ||
17 | public: | |
18 | TestSwapDir() : SwapDir("test"), statsCalled (false) {} | |
19 | ||
20 | bool statsCalled; | |
21 | ||
fd9cca25 AR |
22 | /* Store::Disk API */ |
23 | virtual uint64_t maxSize() const override; | |
24 | virtual uint64_t currentSize() const override; | |
25 | virtual uint64_t currentCount() const override; | |
26 | virtual void stat(StoreEntry &) const override; | |
4310f8b0 EB |
27 | virtual void finalizeSwapoutSuccess(const StoreEntry &) override {} |
28 | virtual void finalizeSwapoutFailure(StoreEntry &) override {} | |
fd9cca25 AR |
29 | virtual void reconfigure() override; |
30 | virtual void init() override; | |
31 | virtual bool unlinkdUseful() const override; | |
32 | virtual bool canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const override; | |
33 | virtual StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override; | |
34 | virtual StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override; | |
35 | virtual void parse(int, char*) override; | |
4310f8b0 EB |
36 | virtual void evictCached(StoreEntry &) override {} |
37 | virtual void evictIfFound(const cache_key *) override {} | |
38 | virtual bool hasReadableEntry(const StoreEntry &) const override { return false; } | |
daed75a9 | 39 | virtual bool smpAware() const override { return false; } |
c8f4eac4 | 40 | }; |
41 | ||
42 | typedef RefCount<TestSwapDir> TestSwapDirPointer; | |
43 | ||
44 | #endif /* TEST_TESTSWAPDIR */ | |
f53969cc | 45 |