]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Service.cc
Author: Francesco Chemolli <kinkie@squid-cache.org>
[thirdparty/squid.git] / src / adaptation / Service.cc
1 /*
2 * DEBUG: section XXX
3 */
4
5 #include "squid.h"
6 #include "adaptation/Service.h"
7
8 Adaptation::Service::Service(const ServiceConfig &aConfig): theConfig(aConfig)
9 {
10 debugs(93,3, HERE << "creating adaptation service " << theConfig.key);
11 }
12
13 Adaptation::Service::~Service()
14 {}
15
16 void
17 Adaptation::Service::finalize()
18 {
19 }
20
21 bool Adaptation::Service::broken() const
22 {
23 return probed() && !up();
24 }
25
26 Adaptation::Services &
27 Adaptation::AllServices()
28 {
29 static Services TheServices;
30 return TheServices;
31 }
32
33 Adaptation::ServicePointer
34 Adaptation::FindService(const Service::Id& key)
35 {
36 typedef Services::iterator SI;
37 for (SI i = AllServices().begin(); i != AllServices().end(); ++i) {
38 if ((*i)->cfg().key == key)
39 return *i;
40 }
41 return NULL;
42 }