]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DelayUser.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / DelayUser.h
CommitLineData
88a03fda 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
88a03fda 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.
88a03fda 7 */
bbc27441
AJ
8
9/* DEBUG: section 77 Delay Pools */
10
eb8ed10d
AJ
11#ifndef DELAYUSER_H
12#define DELAYUSER_H
88a03fda 13
79fc6915 14#if USE_DELAY_POOLS && USE_AUTH
88a03fda 15
3ad63615 16#include "auth/Gadgets.h"
56a49fda 17#include "auth/User.h"
88a03fda 18#include "CompositePoolNode.h"
88a03fda 19#include "DelayBucket.h"
602d9612 20#include "DelayIdComposite.h"
88a03fda 21#include "DelaySpec.h"
29b17d63 22#include "splay.h"
88a03fda 23
63be0a78 24/// \ingroup DelayPoolsAPI
62e76326 25class DelayUserBucket : public RefCountable
26{
27
28public:
88a03fda 29 typedef RefCount<DelayUserBucket> Pointer;
30 void *operator new(size_t);
31 void operator delete (void *);
62e76326 32
88a03fda 33 void stats(StoreEntry *)const;
d87154ee 34 DelayUserBucket(Auth::User::Pointer);
88a03fda 35 ~DelayUserBucket();
36 DelayBucket theBucket;
d87154ee 37 Auth::User::Pointer authUser;
88a03fda 38};
39
63be0a78 40/// \ingroup DelayPoolsAPI
62e76326 41class DelayUser : public CompositePoolNode
42{
43
88a03fda 44public:
45 typedef RefCount<DelayUser> Pointer;
46 void *operator new(size_t);
47 void operator delete (void *);
88a03fda 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();
62e76326 54
1e5562e3 55 virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &);
88a03fda 56
57private:
62e76326 58
63be0a78 59 /// \ingroup DelayPoolsInternal
60 class Id:public DelayIdComposite
62e76326 61 {
62
63 public:
64 void *operator new(size_t);
65 void operator delete (void *);
d87154ee 66 Id(RefCount<DelayUser>, Auth::User::Pointer);
62e76326 67 ~Id();
68 virtual int bytesWanted (int min, int max) const;
69 virtual void bytesIn(int qty);
70
71 private:
75566ba2 72 RefCount<DelayUser> theUser;
62e76326 73 DelayUserBucket::Pointer theBucket;
88a03fda 74 };
62e76326 75
0353e724 76 friend class Id;
77
88a03fda 78 DelaySpec spec;
29b17d63 79 Splay<DelayUserBucket::Pointer> buckets;
88a03fda 80};
62e76326 81
79fc6915 82#endif /* USE_DELAY_POOLS && USE_AUTH */
88a03fda 83#endif /* DELAYUSER_H */
f53969cc 84