]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ecap/Config.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / adaptation / ecap / Config.h
1 /*
2 * Copyright (C) 1996-2021 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 /* DEBUG: section 93 eCAP Interface */
10
11 #ifndef SQUID_ECAP_CONFIG_H
12 #define SQUID_ECAP_CONFIG_H
13
14 #include "adaptation/Config.h"
15 #include "adaptation/ServiceConfig.h"
16 #include <list>
17 #include <utility>
18
19 namespace Adaptation
20 {
21 namespace Ecap
22 {
23
24 /// eCAP service configuration
25 class ServiceConfig: public Adaptation::ServiceConfig
26 {
27 public:
28 // Adaptation::ServiceConfig API
29 virtual bool grokExtension(const char *name, const char *value);
30
31 public:
32 typedef std::pair<std::string, std::string> Extension; // name=value in cfg
33 typedef std::list<Extension> Extensions;
34 Extensions extensions;
35 };
36
37 /// General eCAP configuration
38 class Config: public Adaptation::Config
39 {
40
41 public:
42 Config();
43 ~Config();
44
45 virtual bool finalize();
46
47 protected:
48 virtual Adaptation::ServiceConfig *newServiceConfig() const;
49
50 private:
51 Config(const Config &); // not implemented
52 Config &operator =(const Config &); // not implemented
53
54 virtual Adaptation::ServicePointer createService(const ServiceConfigPointer &cfg);
55 };
56
57 extern Config TheConfig;
58
59 } // namespace Ecap
60 } // namespace Adaptation
61
62 #endif /* SQUID_ECAP_CONFIG_H */
63