]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DelayPools.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / DelayPools.h
1 /*
2 * Copyright (C) 1996-2017 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 #ifndef SQUID_DELAYPOOLS_H
10 #define SQUID_DELAYPOOLS_H
11
12 #include <vector>
13
14 class DelayPool;
15 class Updateable;
16 class StoreEntry;
17
18 /**
19 \defgroup DelayPoolsAPI Delay Pools API
20 \ingroup Components
21 */
22
23 /// \ingroup DelayPoolsAPI
24 class Updateable
25 {
26
27 public:
28 virtual ~Updateable() {}
29
30 virtual void update(int) = 0;
31 };
32
33 /// \ingroup DelayPoolsAPI
34 class DelayPools
35 {
36
37 public:
38 static void Init();
39 static void Update(void *);
40 static unsigned short pools();
41 static void pools(unsigned short pools);
42 static void FreePools();
43 static unsigned char *DelayClasses();
44 static void registerForUpdates(Updateable *);
45 static void deregisterForUpdates (Updateable *);
46 static long MemoryUsed;
47 static DelayPool *delay_data;
48
49 private:
50 static void Stats(StoreEntry *);
51 static void InitDelayData();
52 static time_t LastUpdate;
53 static unsigned short pools_;
54 static void FreeDelayData ();
55 static std::vector<Updateable *> toUpdate;
56 static void RegisterWithCacheManager(void);
57 };
58
59 #endif /* SQUID_DELAYPOOLS_H */
60