]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/adaptation/ecap/Config.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / adaptation / ecap / Config.h
index 9e2f69f0e70c3c16b15001554cbedeb41f81b0ca..b5bec2c9e7929738ecf2233aa71fb28358b82988 100644 (file)
@@ -1,17 +1,40 @@
-
 /*
- * $Id$
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
  *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
+/* DEBUG: section 93    eCAP Interface */
+
 #ifndef SQUID_ECAP_CONFIG_H
 #define SQUID_ECAP_CONFIG_H
 
 #include "adaptation/Config.h"
+#include "adaptation/ServiceConfig.h"
+#include <list>
+#include <utility>
+
+namespace Adaptation
+{
+namespace Ecap
+{
+
+/// eCAP service configuration
+class ServiceConfig: public Adaptation::ServiceConfig
+{
+public:
+    // Adaptation::ServiceConfig API
+    virtual bool grokExtension(const char *name, const char *value);
 
-namespace Adaptation {
-namespace Ecap {
+public:
+    typedef std::pair<std::string, std::string> Extension; // name=value in cfg
+    typedef std::list<Extension> Extensions;
+    Extensions extensions;
+};
 
+/// General eCAP configuration
 class Config: public Adaptation::Config
 {
 
@@ -19,13 +42,16 @@ public:
     Config();
     ~Config();
 
-    virtual void finalize();
+    virtual bool finalize();
+
+protected:
+    virtual Adaptation::ServiceConfig *newServiceConfig() const;
 
 private:
     Config(const Config &); // not implemented
     Config &operator =(const Config &); // not implemented
 
-    virtual Adaptation::ServicePointer createService(const Adaptation::ServiceConfig &cfg);
+    virtual Adaptation::ServicePointer createService(const ServiceConfigPointer &cfg);
 };
 
 extern Config TheConfig;
@@ -34,3 +60,4 @@ extern Config TheConfig;
 } // namespace Adaptation
 
 #endif /* SQUID_ECAP_CONFIG_H */
+