Kids.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 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_IPC_KIDS_H
10 #define SQUID_IPC_KIDS_H
11 
12 #include "ipc/Kid.h"
13 
14 #include <vector>
15 
17 class Kids
18 {
19 public:
20  Kids ();
21 
22 private:
23  Kids (const Kids&);
24  Kids& operator= (const Kids&);
25 
26 public:
28  void init();
29 
31  Kid* find(pid_t pid);
32 
34  Kid& get(size_t i);
35 
37  bool allHopeless() const;
38 
40  void forgetAllFailures();
41 
44  time_t forgetOldFailures();
45 
47  bool allExitedHappy() const;
48 
50  bool someSignaled(const int sgnl) const;
51 
53  bool someRunning() const;
54 
56  bool shouldRestartSome() const;
57 
59  size_t count() const;
60 
61 private:
62  std::vector<Kid> storage;
63 };
64 
65 extern Kids TheKids;
66 
67 extern SBuf TheKidName;
68 
69 #endif /* SQUID_IPC_KIDS_H */
70 
std::vector< Kid > storage
Definition: Kids.h:62
Definition: Kid.h:17
bool someSignaled(const int sgnl) const
whether some kids died from a given signal
Definition: Kids.cc:116
Definition: SBuf.h:86
bool shouldRestartSome() const
whether some kids should be restarted by master
Definition: Kids.cc:136
size_t count() const
returns the number of kids
Definition: Kids.cc:146
Kid & get(size_t i)
returns the kid by index, useful for kids iteration
Definition: Kids.cc:60
static pid_t pid
Definition: IcmpSquid.cc:35
bool allHopeless() const
whether all kids are hopeless
Definition: Kids.cc:67
void forgetAllFailures()
forgets all failures in all kids
Definition: Kids.cc:77
Kids()
Definition: Kids.cc:21
bool allExitedHappy() const
whether all kids called exited happy
Definition: Kids.cc:106
time_t forgetOldFailures()
Definition: Kids.cc:84
Kids TheKids
All kids being maintained.
Definition: Kids.cc:18
Kids & operator=(const Kids &)
not implemented
a collection of kids
Definition: Kids.h:17
SBuf TheKidName
current Squid process name (e.g., "squid-coord")
Definition: Kids.cc:19
void init()
initialize all kid records based on Config
Definition: Kids.cc:26
Kid * find(pid_t pid)
returns kid by pid
Definition: Kids.cc:47
bool someRunning() const
whether some kids are running
Definition: Kids.cc:126

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors