Kids.h
Go to the documentation of this file.
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_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 typedef char KidName[64];
68 extern KidName TheKidName;
69 
70 #endif /* SQUID_IPC_KIDS_H */
71 
std::vector< Kid > storage
Definition: Kids.h:62
char KidName[64]
Squid process name (e.g., "squid-coord")
Definition: Kids.h:67
int i
Definition: membanger.c:49
KidName TheKidName
current Squid process name
Definition: Kids.cc:19
size_t count() const
returns the number of kids
Definition: Kids.cc:155
void forgetAllFailures()
forgets all failures in all kids
Definition: Kids.cc:86
Kids & operator=(const Kids &)
not implemented
bool allHopeless() const
whether all kids are hopeless
Definition: Kids.cc:76
bool someRunning() const
whether some kids are running
Definition: Kids.cc:135
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:56
a collection of kids
Definition: Kids.h:17
Kids TheKids
All kids being maintained.
Definition: Kids.cc:18
static pid_t pid
Definition: IcmpSquid.cc:35
Definition: Kid.h:17
time_t forgetOldFailures()
Definition: Kids.cc:93
bool shouldRestartSome() const
whether some kids should be restarted by master
Definition: Kids.cc:145
bool someSignaled(const int sgnl) const
whether some kids died from a given signal
Definition: Kids.cc:125
Kids()
Definition: Kids.cc:21
bool allExitedHappy() const
whether all kids called exited happy
Definition: Kids.cc:115

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors