]>
Commit | Line | Data |
---|---|---|
40daaeb8 | 1 | /* |
bbc27441 AJ |
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. | |
40daaeb8 AR |
7 | */ |
8 | ||
9 | #ifndef SQUID_IPC_KIDS_H | |
10 | #define SQUID_IPC_KIDS_H | |
11 | ||
40daaeb8 AR |
12 | #include "ipc/Kid.h" |
13 | ||
c8ea3cc0 FC |
14 | #include <vector> |
15 | ||
40daaeb8 AR |
16 | /// a collection of kids |
17 | class Kids | |
18 | { | |
19 | public: | |
20 | Kids (); | |
21 | ||
22 | private: | |
23 | Kids (const Kids&); ///< not implemented | |
24 | Kids& operator= (const Kids&); ///< not implemented | |
25 | ||
26 | public: | |
095ec2b1 AR |
27 | /// initialize all kid records based on Config |
28 | void init(); | |
40daaeb8 AR |
29 | |
30 | /// returns kid by pid | |
31 | Kid* find(pid_t pid); | |
32 | ||
33 | /// returns the kid by index, useful for kids iteration | |
34 | Kid& get(size_t i); | |
35 | ||
36 | /// whether all kids are hopeless | |
37 | bool allHopeless() const; | |
38 | ||
39 | /// whether all kids called exited happy | |
40 | bool allExitedHappy() const; | |
41 | ||
ca4b9ee6 DK |
42 | /// whether some kids died from a given signal |
43 | bool someSignaled(const int sgnl) const; | |
44 | ||
45 | /// whether some kids are running | |
46 | bool someRunning() const; | |
47 | ||
48 | /// whether some kids should be restarted by master | |
49 | bool shouldRestartSome() const; | |
40daaeb8 AR |
50 | |
51 | /// returns the number of kids | |
52 | size_t count() const; | |
53 | ||
54 | private: | |
c8ea3cc0 | 55 | std::vector<Kid> storage; |
40daaeb8 AR |
56 | }; |
57 | ||
58 | extern Kids TheKids; ///< All kids being maintained | |
59 | ||
0519193a | 60 | typedef char KidName[64]; ///< Squid process name (e.g., "squid-coord") |
9de6c973 | 61 | extern KidName TheKidName; ///< current Squid process name |
40daaeb8 | 62 | |
40daaeb8 | 63 | #endif /* SQUID_IPC_KIDS_H */ |
f53969cc | 64 |