]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/base/RunnersRegistry.cc
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
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.
10 #include "base/RunnersRegistry.h"
13 /// a collection of unique runners, in no particular order
14 typedef std::set
<RegisteredRunner
*> Runners
;
16 static Runners
*TheRunners
= NULL
;
18 /// safely returns registered runners, initializing structures as needed
23 TheRunners
= new Runners
;
28 RegisterRunner(RegisteredRunner
*rr
)
30 Runners
&runners
= GetRunners();
32 return runners
.size();
36 DeregisterRunner(RegisteredRunner
*rr
)
38 Runners
&runners
= GetRunners();
40 return runners
.size();
44 RunRegistered(const RegisteredRunner::Method
&m
)
46 Runners
&runners
= GetRunners();
47 typedef Runners::iterator RRI
;
48 for (RRI i
= runners
.begin(); i
!= runners
.end(); ++i
)
51 if (m
== &RegisteredRunner::finishShutdown
) {
58 UseThisStatic(const void *)