]>
Commit | Line | Data |
---|---|---|
1e5562e3 | 1 | /* |
bde978a6 | 2 | * Copyright (C) 1996-2015 The Squid Software Foundation and contributors |
1e5562e3 | 3 | * |
bbc27441 AJ |
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. | |
1e5562e3 | 7 | */ |
bbc27441 AJ |
8 | |
9 | /* DEBUG: section 77 Delay Pools */ | |
10 | ||
eb8ed10d AJ |
11 | #ifndef DELAYTAGGED_H |
12 | #define DELAYTAGGED_H | |
1e5562e3 | 13 | |
9a0a18de | 14 | #if USE_DELAY_POOLS |
1e5562e3 | 15 | |
3ad63615 | 16 | #include "auth/Gadgets.h" |
1e5562e3 | 17 | #include "CompositePoolNode.h" |
1e5562e3 | 18 | #include "DelayBucket.h" |
602d9612 | 19 | #include "DelayIdComposite.h" |
1e5562e3 | 20 | #include "DelaySpec.h" |
1e5562e3 | 21 | #include "splay.h" |
22 | ||
63be0a78 | 23 | /// \ingroup DelayPoolsAPI |
1e5562e3 | 24 | class DelayTaggedBucket : public RefCountable |
25 | { | |
26 | ||
27 | public: | |
28 | typedef RefCount<DelayTaggedBucket> Pointer; | |
29 | void *operator new(size_t); | |
30 | void operator delete (void *); | |
1e5562e3 | 31 | |
32 | void stats(StoreEntry *)const; | |
30abd221 | 33 | DelayTaggedBucket(String &aTag); |
1e5562e3 | 34 | ~DelayTaggedBucket(); |
35 | DelayBucket theBucket; | |
30abd221 | 36 | String tag; |
1e5562e3 | 37 | }; |
38 | ||
63be0a78 | 39 | /// \ingroup DelayPoolsAPI |
1e5562e3 | 40 | class DelayTagged : public CompositePoolNode |
41 | { | |
42 | ||
43 | public: | |
44 | typedef RefCount<DelayTagged> Pointer; | |
45 | void *operator new(size_t); | |
46 | void operator delete (void *); | |
1e5562e3 | 47 | DelayTagged(); |
48 | virtual ~DelayTagged(); | |
49 | virtual void stats(StoreEntry * sentry); | |
50 | virtual void dump(StoreEntry *entry) const; | |
51 | virtual void update(int incr); | |
52 | virtual void parse(); | |
53 | ||
54 | virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &); | |
55 | ||
56 | private: | |
57 | ||
63be0a78 | 58 | /// \ingroup DelayPoolsInternal |
59 | class Id:public DelayIdComposite | |
1e5562e3 | 60 | { |
61 | ||
62 | public: | |
63 | void *operator new(size_t); | |
64 | void operator delete (void *); | |
30abd221 | 65 | Id (RefCount<DelayTagged>, String &); |
1e5562e3 | 66 | ~Id(); |
67 | virtual int bytesWanted (int min, int max) const; | |
68 | virtual void bytesIn(int qty); | |
288d8048 | 69 | virtual void delayRead(DeferredRead const &); |
1e5562e3 | 70 | |
71 | private: | |
75566ba2 | 72 | RefCount<DelayTagged> theTagged; |
1e5562e3 | 73 | DelayTaggedBucket::Pointer theBucket; |
74 | }; | |
75 | ||
76 | friend class Id; | |
77 | ||
78 | DelaySpec spec; | |
79 | Splay<DelayTaggedBucket::Pointer> buckets; | |
80 | }; | |
81 | ||
9a0a18de | 82 | #endif /* USE_DELAY_POOLS */ |
1e5562e3 | 83 | #endif /* DELAYTAGGED_H */ |
f53969cc | 84 |