]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DelayTagged.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / DelayTagged.h
1 /*
2 * Copyright (C) 1996-2014 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 /* DEBUG: section 77 Delay Pools */
10
11 #ifndef DELAYTAGGED_H
12 #define DELAYTAGGED_H
13
14 #if USE_DELAY_POOLS
15
16 #include "auth/Gadgets.h"
17 #include "CompositePoolNode.h"
18 #include "DelayBucket.h"
19 #include "DelayIdComposite.h"
20 #include "DelaySpec.h"
21 #include "splay.h"
22
23 /// \ingroup DelayPoolsAPI
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 *);
31
32 void stats(StoreEntry *)const;
33 DelayTaggedBucket(String &aTag);
34 ~DelayTaggedBucket();
35 DelayBucket theBucket;
36 String tag;
37 };
38
39 /// \ingroup DelayPoolsAPI
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 *);
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
58 /// \ingroup DelayPoolsInternal
59 class Id:public DelayIdComposite
60 {
61
62 public:
63 void *operator new(size_t);
64 void operator delete (void *);
65 Id (RefCount<DelayTagged>, String &);
66 ~Id();
67 virtual int bytesWanted (int min, int max) const;
68 virtual void bytesIn(int qty);
69 virtual void delayRead(DeferredRead const &);
70
71 private:
72 RefCount<DelayTagged> theTagged;
73 DelayTaggedBucket::Pointer theBucket;
74 };
75
76 friend class Id;
77
78 DelaySpec spec;
79 Splay<DelayTaggedBucket::Pointer> buckets;
80 };
81
82 #endif /* USE_DELAY_POOLS */
83 #endif /* DELAYTAGGED_H */