]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/HttpHdrScTarget.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / HttpHdrScTarget.h
index c405ad3b533ec5fcd52cd05bbcbea2c07451a4f9..bb55ccadb86bb1d54751a5eb7bccae1f4239c56d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -9,14 +9,11 @@
 #ifndef SQUID_HTTPHDRSURROGATECONTROLTARGET_H
 #define SQUID_HTTPHDRSURROGATECONTROLTARGET_H
 
-#include "defines.h"
-#include "dlink.h"
-#include "MemPool.h"
-#include "SquidString.h"
-#include "typedefs.h"
+#include "defines.h" //for bit mask operations
+#include "HttpHdrSc.h"
 
+class Packable;
 class StatHist;
-class Packer;
 class StoreEntry;
 
 /** Representation of HTTP Surogate-Control header field targeted directive
@@ -25,6 +22,8 @@ class StoreEntry;
  */
 class HttpHdrScTarget
 {
+    MEMPROXY_CLASS(HttpHdrScTarget);
+
     // parsing is done in HttpHdrSc, need to grant them access.
     friend class HttpHdrSc;
 public:
@@ -32,12 +31,12 @@ public:
     static const int MAX_STALE_UNSET=0; //max-stale is unset
 
     HttpHdrScTarget(const char *target_):
-            mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {}
+        mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {}
     HttpHdrScTarget(const String &target_):
-            mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {}
+        mask(0), max_age(MAX_AGE_UNSET), max_stale(MAX_STALE_UNSET),target(target_) {}
     HttpHdrScTarget(const HttpHdrScTarget &t):
-            mask(t.mask), max_age(t.max_age), max_stale(t.max_stale),
-            content_(t.content_), target(t.target) {}
+        mask(t.mask), max_age(t.max_age), max_stale(t.max_stale),
+        content_(t.content_), target(t.target) {}
 
     bool hasNoStore() const {return isSet(SC_NO_STORE); }
     void noStore(bool v) { setMask(SC_NO_STORE,v); }
@@ -80,10 +79,9 @@ public:
     String Target() const { return target; }
 
     void mergeWith(const HttpHdrScTarget * new_sc);
-    void packInto (Packer *p) const;
+    void packInto(Packable *p) const;
     void updateStats(StatHist *) const;
 
-    MEMPROXY_CLASS(HttpHdrScTarget);
 private:
     bool isSet(http_hdr_sc_type id) const {
         assert (id >= SC_NO_STORE && id < SC_ENUM_END);
@@ -103,8 +101,7 @@ private:
     dlink_node node;
 };
 
-MEMPROXY_CLASS_INLINE(HttpHdrScTarget);
-
 void httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
 
 #endif /* SQUID_HTTPHDRSURROGATECONTROLTARGET_H */
+