]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DelayUser.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / DelayUser.h
CommitLineData
88a03fda 1/*
f70aedc4 2 * Copyright (C) 1996-2021 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{
b58d2a22 27 MEMPROXY_CLASS(DelayUserBucket);
62e76326 28
29public:
88a03fda 30 typedef RefCount<DelayUserBucket> Pointer;
62e76326 31
88a03fda 32 void stats(StoreEntry *)const;
d87154ee 33 DelayUserBucket(Auth::User::Pointer);
88a03fda 34 ~DelayUserBucket();
35 DelayBucket theBucket;
d87154ee 36 Auth::User::Pointer authUser;
88a03fda 37};
38
63be0a78 39/// \ingroup DelayPoolsAPI
62e76326 40class DelayUser : public CompositePoolNode
41{
b58d2a22 42 MEMPROXY_CLASS(DelayUser);
62e76326 43
88a03fda 44public:
45 typedef RefCount<DelayUser> Pointer;
88a03fda 46 DelayUser();
47 virtual ~DelayUser();
48 virtual void stats(StoreEntry * sentry);
49 virtual void dump(StoreEntry *entry) const;
50 virtual void update(int incr);
51 virtual void parse();
62e76326 52
1e5562e3 53 virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &);
88a03fda 54
55private:
62e76326 56
63be0a78 57 /// \ingroup DelayPoolsInternal
58 class Id:public DelayIdComposite
62e76326 59 {
b58d2a22 60 MEMPROXY_CLASS(DelayUser::Id);
62e76326 61
62 public:
d87154ee 63 Id(RefCount<DelayUser>, Auth::User::Pointer);
62e76326 64 ~Id();
65 virtual int bytesWanted (int min, int max) const;
66 virtual void bytesIn(int qty);
67
68 private:
75566ba2 69 RefCount<DelayUser> theUser;
62e76326 70 DelayUserBucket::Pointer theBucket;
88a03fda 71 };
62e76326 72
0353e724 73 friend class Id;
74
88a03fda 75 DelaySpec spec;
29b17d63 76 Splay<DelayUserBucket::Pointer> buckets;
88a03fda 77};
62e76326 78
79fc6915 79#endif /* USE_DELAY_POOLS && USE_AUTH */
88a03fda 80#endif /* DELAYUSER_H */
f53969cc 81