]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DelayUser.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / DelayUser.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 /* DEBUG: section 77 Delay Pools */
10
11 #ifndef DELAYUSER_H
12 #define DELAYUSER_H
13
14 #if USE_DELAY_POOLS && USE_AUTH
15
16 #include "auth/Gadgets.h"
17 #include "auth/User.h"
18 #include "CompositePoolNode.h"
19 #include "DelayBucket.h"
20 #include "DelayIdComposite.h"
21 #include "DelaySpec.h"
22 #include "splay.h"
23
24 /// \ingroup DelayPoolsAPI
25 class DelayUserBucket : public RefCountable
26 {
27
28 public:
29 typedef RefCount<DelayUserBucket> Pointer;
30 void *operator new(size_t);
31 void operator delete (void *);
32
33 void stats(StoreEntry *)const;
34 DelayUserBucket(Auth::User::Pointer);
35 ~DelayUserBucket();
36 DelayBucket theBucket;
37 Auth::User::Pointer authUser;
38 };
39
40 /// \ingroup DelayPoolsAPI
41 class DelayUser : public CompositePoolNode
42 {
43
44 public:
45 typedef RefCount<DelayUser> Pointer;
46 void *operator new(size_t);
47 void operator delete (void *);
48 DelayUser();
49 virtual ~DelayUser();
50 virtual void stats(StoreEntry * sentry);
51 virtual void dump(StoreEntry *entry) const;
52 virtual void update(int incr);
53 virtual void parse();
54
55 virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &);
56
57 private:
58
59 /// \ingroup DelayPoolsInternal
60 class Id:public DelayIdComposite
61 {
62
63 public:
64 void *operator new(size_t);
65 void operator delete (void *);
66 Id(RefCount<DelayUser>, Auth::User::Pointer);
67 ~Id();
68 virtual int bytesWanted (int min, int max) const;
69 virtual void bytesIn(int qty);
70
71 private:
72 RefCount<DelayUser> theUser;
73 DelayUserBucket::Pointer theBucket;
74 };
75
76 friend class Id;
77
78 DelaySpec spec;
79 Splay<DelayUserBucket::Pointer> buckets;
80 };
81
82 #endif /* USE_DELAY_POOLS && USE_AUTH */
83 #endif /* DELAYUSER_H */
84