This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f94430  Eliminate remaining hack around copy CTORs
6f94430 is described below

commit 6f94430109104fe8b43afc9d039481a97aacac25
Author: Leif Hedstrom <[email protected]>
AuthorDate: Wed Dec 12 13:12:12 2018 -0800

    Eliminate remaining hack around copy CTORs
    
    This finishes what #2081 started.
---
 plugins/experimental/fastcgi/src/Profiler.h |  10 ---
 plugins/experimental/inliner/util.h         |   9 --
 plugins/header_rewrite/condition.h          |   6 +-
 plugins/header_rewrite/conditions.h         | 132 +++++++++++++++++++---------
 plugins/header_rewrite/lulu.h               |   5 --
 plugins/header_rewrite/matcher.h            |   7 +-
 plugins/header_rewrite/operator.h           |  23 +++--
 plugins/header_rewrite/operators.h          | 127 +++++++++++++++++---------
 plugins/header_rewrite/parser.h             |  12 ++-
 plugins/header_rewrite/resources.h          |   6 +-
 plugins/header_rewrite/ruleset.h            |   6 +-
 plugins/header_rewrite/statement.h          |   6 +-
 plugins/header_rewrite/value.h              |   6 +-
 13 files changed, 225 insertions(+), 130 deletions(-)

diff --git a/plugins/experimental/fastcgi/src/Profiler.h 
b/plugins/experimental/fastcgi/src/Profiler.h
index 9a88218..620161e 100644
--- a/plugins/experimental/fastcgi/src/Profiler.h
+++ b/plugins/experimental/fastcgi/src/Profiler.h
@@ -28,12 +28,6 @@
 
 namespace ats_plugin
 {
-// A macro to disallow the copy constructor and operator= functions
-// This should be used in the private: declarations for a class
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
-  TypeName(TypeName &) = delete;           \
-  void operator=(TypeName) = delete;
-
 // A single profile, stores data of a taken profile
 class Profile
 {
@@ -195,8 +189,6 @@ private:
 
   // The mutex for safe access
   mutable std::mutex profiles_mutex_;
-
-  // DISALLOW_COPY_AND_ASSIGN(Profiler);
 };
 
 // Takes a profile during its life time
@@ -233,7 +225,5 @@ private:
 
   // The owner profiler
   Profiler *owner_;
-
-  // DISALLOW_COPY_AND_ASSIGN(ProfileTaker);
 };
 } // namespace ats_plugin
diff --git a/plugins/experimental/inliner/util.h 
b/plugins/experimental/inliner/util.h
index 68caff0..854da52 100644
--- a/plugins/experimental/inliner/util.h
+++ b/plugins/experimental/inliner/util.h
@@ -25,15 +25,6 @@
 
 #include <vector>
 
-#define DISALLOW_COPY_AND_ASSIGN(T) \
-  T(const T &) = delete;            \
-  void operator=(const T &) = delete
-
-#define DISALLOW_IMPLICIT_CONSTRUCTORS(T) \
-private:                                  \
-  T(void);                                \
-  DISALLOW_COPY_AND_ASSIGN(T)
-
 namespace util
 {
 typedef std::vector<char> Buffer;
diff --git a/plugins/header_rewrite/condition.h 
b/plugins/header_rewrite/condition.h
index 33bd19f..081d04f 100644
--- a/plugins/header_rewrite/condition.h
+++ b/plugins/header_rewrite/condition.h
@@ -55,6 +55,10 @@ public:
     delete _matcher;
   }
 
+  // noncopyable
+  Condition(const Condition &) = delete;
+  void operator=(const Condition &) = delete;
+
   // Inline this, it's critical for speed (and only used twice)
   bool
   do_eval(const Resources &res)
@@ -128,7 +132,5 @@ protected:
   Matcher *_matcher   = nullptr;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(Condition);
-
   CondModifiers _mods = COND_NONE;
 };
diff --git a/plugins/header_rewrite/conditions.h 
b/plugins/header_rewrite/conditions.h
index 6c22c7f..77ef595 100644
--- a/plugins/header_rewrite/conditions.h
+++ b/plugins/header_rewrite/conditions.h
@@ -42,6 +42,11 @@ class ConditionTrue : public Condition
 {
 public:
   ConditionTrue() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionTrue"); }
+
+  // noncopyable
+  ConditionTrue(const ConditionTrue &) = delete;
+  void operator=(const ConditionTrue &) = delete;
+
   void
   append_value(std::string &s, const Resources & /* res ATS_UNUSED */) override
   {
@@ -55,9 +60,6 @@ protected:
     TSDebug(PLUGIN_NAME, "Evaluating TRUE()");
     return true;
   }
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionTrue);
 };
 
 // Always false
@@ -65,6 +67,11 @@ class ConditionFalse : public Condition
 {
 public:
   ConditionFalse() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionFalse"); }
+
+  // noncopyable
+  ConditionFalse(const ConditionFalse &) = delete;
+  void operator=(const ConditionFalse &) = delete;
+
   void
   append_value(std::string &s, const Resources & /* res ATS_UNUSED */) override
   {
@@ -78,9 +85,6 @@ protected:
     TSDebug(PLUGIN_NAME, "Evaluating FALSE()");
     return false;
   }
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionFalse);
 };
 
 // Check the HTTP return status
@@ -90,15 +94,17 @@ class ConditionStatus : public Condition
 
 public:
   ConditionStatus() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionStatus"); }
+
+  // noncopyable
+  ConditionStatus(const ConditionStatus &) = delete;
+  void operator=(const ConditionStatus &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
   void initialize_hooks() override; // Return status only valid in certain 
hooks
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionStatus);
 };
 
 // Check the HTTP method
@@ -108,14 +114,16 @@ class ConditionMethod : public Condition
 
 public:
   ConditionMethod() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionMethod"); }
+
+  // noncopyable
+  ConditionMethod(const ConditionMethod &) = delete;
+  void operator=(const ConditionMethod &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionMethod);
 };
 
 // Random 0 to (N-1)
@@ -125,6 +133,11 @@ class ConditionRandom : public Condition
 
 public:
   ConditionRandom() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionRandom"); }
+
+  // noncopyable
+  ConditionRandom(const ConditionRandom &) = delete;
+  void operator=(const ConditionRandom &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
@@ -132,8 +145,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionRandom);
-
   unsigned int _seed = 0;
   unsigned int _max  = 0;
 };
@@ -143,6 +154,11 @@ class ConditionAccess : public Condition
 {
 public:
   ConditionAccess() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionAccess"); }
+
+  // noncopyable
+  ConditionAccess(const ConditionAccess &) = delete;
+  void operator=(const ConditionAccess &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
@@ -150,8 +166,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionAccess);
-
   time_t _next = 0;
   bool _last   = false;
 };
@@ -163,6 +177,11 @@ class ConditionCookie : public Condition
 
 public:
   ConditionCookie() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionCookie"); }
+
+  // noncopyable
+  ConditionCookie(const ConditionCookie &) = delete;
+  void operator=(const ConditionCookie &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
@@ -170,8 +189,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionCookie);
-
   // Nginx-style cookie parsing:
   //   nginx/src/http/ngx_http_parse.c:ngx_http_parse_multi_header_lines()
   inline int
@@ -235,6 +252,10 @@ public:
     TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionHeader, client %d", 
client);
   }
 
+  // noncopyable
+  ConditionHeader(const ConditionHeader &) = delete;
+  void operator=(const ConditionHeader &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
@@ -242,8 +263,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionHeader);
-
   bool _client;
 };
 
@@ -254,14 +273,16 @@ class ConditionPath : public Condition
 
 public:
   explicit ConditionPath() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionPath"); }
+
+  // noncopyable
+  ConditionPath(const ConditionPath &) = delete;
+  void operator=(const ConditionPath &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionPath);
 };
 
 // query
@@ -271,14 +292,16 @@ class ConditionQuery : public Condition
 
 public:
   explicit ConditionQuery() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionQuery"); }
+
+  // noncopyable
+  ConditionQuery(const ConditionQuery &) = delete;
+  void operator=(const ConditionQuery &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionQuery);
 };
 
 // url
@@ -291,6 +314,10 @@ public:
 
   explicit ConditionUrl(const UrlType type) : _type(type) { 
TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionUrl"); }
 
+  // noncopyable
+  ConditionUrl(const ConditionUrl &) = delete;
+  void operator=(const ConditionUrl &) = delete;
+
   void initialize(Parser &p) override;
   void set_qualifier(const std::string &q) override;
   void append_value(std::string &s, const Resources &res) override;
@@ -299,8 +326,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionUrl);
-
   UrlQualifiers _url_qual = URL_QUAL_NONE;
   UrlType _type;
 };
@@ -327,6 +352,10 @@ public:
     // }
   }
 
+  // noncopyable
+  ConditionDBM(const ConditionDBM &) = delete;
+  void operator=(const ConditionDBM &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
@@ -334,7 +363,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionDBM);
   // MDBM* _dbm;
   std::string _file;
   Value _key;
@@ -361,6 +389,11 @@ class ConditionIp : public Condition
 
 public:
   explicit ConditionIp() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionIp"); };
+
+  // noncopyable
+  ConditionIp(const ConditionIp &) = delete;
+  void operator=(const ConditionIp &) = delete;
+
   void initialize(Parser &p) override;
   void set_qualifier(const std::string &q) override;
   void append_value(std::string &s, const Resources &res) override;
@@ -369,7 +402,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionIp);
   IpQualifiers _ip_qual = IP_QUAL_CLIENT;
 };
 
@@ -379,14 +411,16 @@ class ConditionIncomingPort : public Condition
 
 public:
   ConditionIncomingPort() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionIncomingPort"); }
+
+  // noncopyable
+  ConditionIncomingPort(const ConditionIncomingPort &) = delete;
+  void operator=(const ConditionIncomingPort &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionIncomingPort);
 };
 
 // Transact Count
@@ -396,14 +430,16 @@ class ConditionTransactCount : public Condition
 
 public:
   ConditionTransactCount() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionTransactCount"); }
+
+  // noncopyable
+  ConditionTransactCount(const ConditionTransactCount &) = delete;
+  void operator=(const ConditionTransactCount &) = delete;
+
   void initialize(Parser &p) override;
   void append_value(std::string &s, const Resources &res) override;
 
 protected:
   bool eval(const Resources &res) override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionTransactCount);
 };
 
 // now: Keeping track of current time / day / hour etc.
@@ -413,6 +449,11 @@ class ConditionNow : public Condition
 
 public:
   explicit ConditionNow() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionNow"); }
+
+  // noncopyable
+  ConditionNow(const ConditionNow &) = delete;
+  void operator=(const ConditionNow &) = delete;
+
   void initialize(Parser &p) override;
   void set_qualifier(const std::string &q) override;
   void append_value(std::string &s, const Resources &res) override;
@@ -421,8 +462,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionNow);
-
   int64_t get_now_qualified(NowQualifiers qual) const;
   NowQualifiers _now_qual = NOW_QUAL_EPOCH;
 };
@@ -433,6 +472,10 @@ class ConditionGeo : public Condition
 public:
   explicit ConditionGeo() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionGeo"); }
 
+  // noncopyable
+  ConditionGeo(const ConditionGeo &) = delete;
+  void operator=(const ConditionGeo &) = delete;
+
   void initialize(Parser &p) override;
   void set_qualifier(const std::string &q) override;
   void append_value(std::string &s, const Resources &res) override;
@@ -454,8 +497,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionGeo);
-
   int64_t get_geo_int(const sockaddr *addr) const;
   const char *get_geo_string(const sockaddr *addr) const;
   GeoQualifiers _geo_qual = GEO_QUAL_COUNTRY;
@@ -467,6 +508,11 @@ class ConditionId : public Condition
 {
 public:
   explicit ConditionId() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
ConditionId"); };
+
+  // noncopyable
+  ConditionId(const ConditionId &) = delete;
+  void operator=(const ConditionId &) = delete;
+
   void initialize(Parser &p) override;
   void set_qualifier(const std::string &q) override;
   void append_value(std::string &s, const Resources &res) override;
@@ -475,7 +521,6 @@ protected:
   bool eval(const Resources &res) override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(ConditionId);
   IdQualifiers _id_qual = ID_QUAL_UNIQUE;
 };
 
@@ -543,6 +588,10 @@ class ConditionStringLiteral : public Condition
 public:
   explicit ConditionStringLiteral(const std::string &v);
 
+  // noncopyable
+  ConditionStringLiteral(const ConditionStringLiteral &) = delete;
+  void operator=(const ConditionStringLiteral &) = delete;
+
   void append_value(std::string &s, const Resources & /* res ATS_UNUSED */) 
override;
 
 protected:
@@ -550,5 +599,4 @@ protected:
 
 private:
   std::string _literal;
-  DISALLOW_COPY_AND_ASSIGN(ConditionStringLiteral);
 };
diff --git a/plugins/header_rewrite/lulu.h b/plugins/header_rewrite/lulu.h
index c0c20f0..cadc902 100644
--- a/plugins/header_rewrite/lulu.h
+++ b/plugins/header_rewrite/lulu.h
@@ -35,8 +35,3 @@ uint16_t getPort(sockaddr const *s_sockaddr);
 
 extern const char PLUGIN_NAME[];
 extern const char PLUGIN_NAME_DBG[];
-
-// From google styleguide: 
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
-  TypeName(const TypeName &) = delete;     \
-  void operator=(const TypeName &) = delete
diff --git a/plugins/header_rewrite/matcher.h b/plugins/header_rewrite/matcher.h
index 3d8e71e..20e99b6 100644
--- a/plugins/header_rewrite/matcher.h
+++ b/plugins/header_rewrite/matcher.h
@@ -46,11 +46,12 @@ public:
   explicit Matcher(const MatcherOps op) : _op(op) { TSDebug(PLUGIN_NAME_DBG, 
"Calling CTOR for Matcher"); }
   virtual ~Matcher() { TSDebug(PLUGIN_NAME_DBG, "Calling DTOR for Matcher"); }
 
+  // noncopyable
+  Matcher(const Matcher &) = delete;
+  void operator=(const Matcher &) = delete;
+
 protected:
   const MatcherOps _op;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(Matcher);
 };
 
 // Template class to match on various types of data
diff --git a/plugins/header_rewrite/operator.h 
b/plugins/header_rewrite/operator.h
index b11a1de..04821fc 100644
--- a/plugins/header_rewrite/operator.h
+++ b/plugins/header_rewrite/operator.h
@@ -44,6 +44,11 @@ class Operator : public Statement
 {
 public:
   Operator() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Operator"); }
+
+  // noncopyable
+  Operator(const Operator &) = delete;
+  void operator=(const Operator &) = delete;
+
   OperModifiers get_oper_modifiers() const;
   void initialize(Parser &p) override;
 
@@ -60,8 +65,6 @@ protected:
   virtual void exec(const Resources &res) const = 0;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(Operator);
-
   OperModifiers _mods = OPER_NONE;
 };
 
@@ -73,13 +76,15 @@ class OperatorHeaders : public Operator
 {
 public:
   OperatorHeaders() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorHeaders"); }
+
+  // noncopyable
+  OperatorHeaders(const OperatorHeaders &) = delete;
+  void operator=(const OperatorHeaders &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   std::string _header;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorHeaders);
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -90,11 +95,13 @@ class OperatorCookies : public Operator
 {
 public:
   OperatorCookies() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorCookies"); }
+
+  // noncopyable
+  OperatorCookies(const OperatorCookies &) = delete;
+  void operator=(const OperatorCookies &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   std::string _cookie;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorCookies);
 };
diff --git a/plugins/header_rewrite/operators.h 
b/plugins/header_rewrite/operators.h
index 2ff0d84..f1d24fa 100644
--- a/plugins/header_rewrite/operators.h
+++ b/plugins/header_rewrite/operators.h
@@ -36,14 +36,17 @@ class OperatorSetConfig : public Operator
 {
 public:
   OperatorSetConfig() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetConfig"); }
+
+  // noncopyable
+  OperatorSetConfig(const OperatorSetConfig &) = delete;
+  void operator=(const OperatorSetConfig &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetConfig);
-
   TSOverridableConfigKey _key = TS_CONFIG_NULL;
   TSRecordDataType _type      = TS_RECORDDATATYPE_NULL;
 
@@ -55,6 +58,11 @@ class OperatorSetStatus : public Operator
 {
 public:
   OperatorSetStatus() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetStatus"); }
+
+  // noncopyable
+  OperatorSetStatus(const OperatorSetStatus &) = delete;
+  void operator=(const OperatorSetStatus &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
@@ -62,8 +70,6 @@ protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetStatus);
-
   Value _status;
   const char *_reason = nullptr;
   int _reason_len     = 0;
@@ -73,6 +79,11 @@ class OperatorSetStatusReason : public Operator
 {
 public:
   OperatorSetStatusReason() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetStatusReason"); }
+
+  // noncopyable
+  OperatorSetStatusReason(const OperatorSetStatusReason &) = delete;
+  void operator=(const OperatorSetStatusReason &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
@@ -80,8 +91,6 @@ protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetStatusReason);
-
   Value _reason;
 };
 
@@ -89,14 +98,17 @@ class OperatorSetDestination : public Operator
 {
 public:
   OperatorSetDestination() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetDestination"); }
+
+  // noncopyable
+  OperatorSetDestination(const OperatorSetDestination &) = delete;
+  void operator=(const OperatorSetDestination &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetDestination);
-
   UrlQualifiers _url_qual = URL_QUAL_NONE;
   Value _value;
 };
@@ -105,6 +117,11 @@ class OperatorSetRedirect : public Operator
 {
 public:
   OperatorSetRedirect() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetRedirect"); }
+
+  // noncopyable
+  OperatorSetRedirect(const OperatorSetRedirect &) = delete;
+  void operator=(const OperatorSetRedirect &) = delete;
+
   void initialize(Parser &p) override;
 
   TSHttpStatus
@@ -123,8 +140,6 @@ protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetRedirect);
-
   Value _status;
   Value _location;
 };
@@ -134,25 +149,29 @@ class OperatorNoOp : public Operator
 public:
   OperatorNoOp() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorNoOp"); }
 
+  // noncopyable
+  OperatorNoOp(const OperatorNoOp &) = delete;
+  void operator=(const OperatorNoOp &) = delete;
+
 protected:
   void exec(const Resources & /* res ATS_UNUSED */) const override{};
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorNoOp);
 };
 
 class OperatorSetTimeoutOut : public Operator
 {
 public:
   OperatorSetTimeoutOut() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetTimeoutOut"); }
+
+  // noncopyable
+  OperatorSetTimeoutOut(const OperatorSetTimeoutOut &) = delete;
+  void operator=(const OperatorSetTimeoutOut &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetTimeoutOut);
-
   enum TimeoutOutType {
     TO_OUT_UNDEFINED,
     TO_OUT_ACTIVE,
@@ -169,14 +188,17 @@ class OperatorSkipRemap : public Operator
 {
 public:
   OperatorSkipRemap() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSkipRemap"); }
+
+  // noncopyable
+  OperatorSkipRemap(const OperatorSkipRemap &) = delete;
+  void operator=(const OperatorSkipRemap &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSkipRemap);
-
   bool _skip_remap = false;
 };
 
@@ -186,25 +208,29 @@ class OperatorRMHeader : public OperatorHeaders
 public:
   OperatorRMHeader() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorRMHeader"); }
 
+  // noncopyable
+  OperatorRMHeader(const OperatorRMHeader &) = delete;
+  void operator=(const OperatorRMHeader &) = delete;
+
 protected:
   void exec(const Resources &res) const override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorRMHeader);
 };
 
 class OperatorAddHeader : public OperatorHeaders
 {
 public:
   OperatorAddHeader() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorAddHeader"); }
+
+  // noncopyable
+  OperatorAddHeader(const OperatorAddHeader &) = delete;
+  void operator=(const OperatorAddHeader &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorAddHeader);
-
   Value _value;
 };
 
@@ -212,14 +238,17 @@ class OperatorSetHeader : public OperatorHeaders
 {
 public:
   OperatorSetHeader() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetHeader"); }
+
+  // noncopyable
+  OperatorSetHeader(const OperatorSetHeader &) = delete;
+  void operator=(const OperatorSetHeader &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetHeader);
-
   Value _value;
 };
 
@@ -227,14 +256,17 @@ class OperatorCounter : public Operator
 {
 public:
   OperatorCounter() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorCounter"); }
+
+  // noncopyable
+  OperatorCounter(const OperatorCounter &) = delete;
+  void operator=(const OperatorCounter &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorCounter);
-
   std::string _counter_name;
   int _counter = TS_ERROR;
 };
@@ -244,25 +276,29 @@ class OperatorRMCookie : public OperatorCookies
 public:
   OperatorRMCookie() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorRMCookie"); }
 
+  // noncopyable
+  OperatorRMCookie(const OperatorRMCookie &) = delete;
+  void operator=(const OperatorRMCookie &) = delete;
+
 protected:
   void exec(const Resources &res) const override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorRMCookie);
 };
 
 class OperatorAddCookie : public OperatorCookies
 {
 public:
   OperatorAddCookie() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorAddCookie"); }
+
+  // noncopyable
+  OperatorAddCookie(const OperatorAddCookie &) = delete;
+  void operator=(const OperatorAddCookie &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorAddCookie);
-
   Value _value;
 };
 
@@ -270,14 +306,17 @@ class OperatorSetCookie : public OperatorCookies
 {
 public:
   OperatorSetCookie() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetCookie"); }
+
+  // noncopyable
+  OperatorSetCookie(const OperatorSetCookie &) = delete;
+  void operator=(const OperatorSetCookie &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetCookie);
-
   Value _value;
 };
 
@@ -297,6 +336,11 @@ class OperatorSetConnDSCP : public Operator
 {
 public:
   OperatorSetConnDSCP() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetConnDSCP"); }
+
+  // noncopyable
+  OperatorSetConnDSCP(const OperatorSetConnDSCP &) = delete;
+  void operator=(const OperatorSetConnDSCP &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
@@ -304,8 +348,6 @@ protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetConnDSCP);
-
   Value _ds_value;
 };
 
@@ -313,6 +355,11 @@ class OperatorSetConnMark : public Operator
 {
 public:
   OperatorSetConnMark() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetConnMark"); }
+
+  // noncopyable
+  OperatorSetConnMark(const OperatorSetConnMark &) = delete;
+  void operator=(const OperatorSetConnMark &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
@@ -320,8 +367,6 @@ protected:
   void exec(const Resources &res) const override;
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetConnMark);
-
   Value _ds_value;
 };
 
@@ -329,12 +374,14 @@ class OperatorSetDebug : public Operator
 {
 public:
   OperatorSetDebug() { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for 
OperatorSetDebug"); }
+
+  // noncopyable
+  OperatorSetDebug(const OperatorSetDebug &) = delete;
+  void operator=(const OperatorSetDebug &) = delete;
+
   void initialize(Parser &p) override;
 
 protected:
   void initialize_hooks() override;
   void exec(const Resources &res) const override;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(OperatorSetDebug);
 };
diff --git a/plugins/header_rewrite/parser.h b/plugins/header_rewrite/parser.h
index d6f4db0..385c824 100644
--- a/plugins/header_rewrite/parser.h
+++ b/plugins/header_rewrite/parser.h
@@ -35,6 +35,10 @@ class Parser
 public:
   explicit Parser(const std::string &line);
 
+  // noncopyable
+  Parser(const Parser &) = delete;
+  void operator=(const Parser &) = delete;
+
   bool
   empty() const
   {
@@ -76,7 +80,6 @@ public:
 
 private:
   void preprocess(std::vector<std::string> tokens);
-  DISALLOW_COPY_AND_ASSIGN(Parser);
 
   bool _cond;
   bool _empty;
@@ -94,10 +97,11 @@ class SimpleTokenizer
 public:
   explicit SimpleTokenizer(const std::string &line);
 
-  const std::vector<std::string> &get_tokens() const;
+  // noncopyable
+  SimpleTokenizer(const SimpleTokenizer &) = delete;
+  void operator=(const SimpleTokenizer &) = delete;
 
-private:
-  DISALLOW_COPY_AND_ASSIGN(SimpleTokenizer);
+  const std::vector<std::string> &get_tokens() const;
 
 protected:
   std::vector<std::string> _tokens;
diff --git a/plugins/header_rewrite/resources.h 
b/plugins/header_rewrite/resources.h
index d9d735a..ee5e0f0 100644
--- a/plugins/header_rewrite/resources.h
+++ b/plugins/header_rewrite/resources.h
@@ -59,6 +59,11 @@ public:
   }
 
   ~Resources() { destroy(); }
+
+  // noncopyable
+  Resources(const Resources &) = delete;
+  void operator=(const Resources &) = delete;
+
   void gather(const ResourceIDs ids, TSHttpHookID hook);
   bool
   ready() const
@@ -78,7 +83,6 @@ public:
 
 private:
   void destroy();
-  DISALLOW_COPY_AND_ASSIGN(Resources);
 
   bool _ready = false;
 };
diff --git a/plugins/header_rewrite/ruleset.h b/plugins/header_rewrite/ruleset.h
index c963495..b7d2bd2 100644
--- a/plugins/header_rewrite/ruleset.h
+++ b/plugins/header_rewrite/ruleset.h
@@ -45,6 +45,10 @@ public:
     delete _oper;
   }
 
+  // noncopyable
+  RuleSet(const RuleSet &) = delete;
+  void operator=(const RuleSet &) = delete;
+
   // No reason to inline these
   void append(RuleSet *rule);
   bool add_condition(Parser &p, const char *filename, int lineno);
@@ -107,8 +111,6 @@ public:
   RuleSet *next = nullptr; // Linked list
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(RuleSet);
-
   Condition *_cond   = nullptr;                        // First pre-condition 
(linked list)
   Operator *_oper    = nullptr;                        // First operator 
(linked list)
   TSHttpHookID _hook = TS_HTTP_READ_RESPONSE_HDR_HOOK; // Which hook is this 
rule for
diff --git a/plugins/header_rewrite/statement.h 
b/plugins/header_rewrite/statement.h
index e5aa291..7a006ba 100644
--- a/plugins/header_rewrite/statement.h
+++ b/plugins/header_rewrite/statement.h
@@ -104,6 +104,10 @@ public:
     delete _next;
   }
 
+  // noncopyable
+  Statement(const Statement &) = delete;
+  void operator=(const Statement &) = delete;
+
   // Which hook are we adding this statement to?
   bool set_hook(TSHttpHookID hook);
   TSHttpHookID
@@ -152,8 +156,6 @@ protected:
   Statement *_next = nullptr; // Linked list
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(Statement);
-
   ResourceIDs _rsrc  = RSRC_NONE;
   bool _initialized  = false;
   TSHttpHookID _hook = TS_HTTP_READ_RESPONSE_HDR_HOOK;
diff --git a/plugins/header_rewrite/value.h b/plugins/header_rewrite/value.h
index e15e67a..13821cd 100644
--- a/plugins/header_rewrite/value.h
+++ b/plugins/header_rewrite/value.h
@@ -43,6 +43,10 @@ public:
 
   virtual ~Value();
 
+  // noncopyable
+  Value(const Value &) = delete;
+  void operator=(const Value &) = delete;
+
   void set_value(const std::string &val);
 
   void
@@ -88,8 +92,6 @@ public:
   }
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(Value);
-
   int _int_value      = 0;
   double _float_value = 0.0;
   std::string _value;

Reply via email to