[libsigcplusplus] slot_rep: Rename dup() to clone()



commit 1e258cf7165d77151f6ef2821dc5c28753196444
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Mon Feb 13 19:06:18 2017 +0100

    slot_rep: Rename dup() to clone()
    
    because clone() is the usual name of such a function. Bug 777618

 sigc++/functors/slot.h       |    2 +-
 sigc++/functors/slot_base.cc |   14 +++++++-------
 sigc++/functors/slot_base.h  |    4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h
index 0492616..79b39d1 100644
--- a/sigc++/functors/slot.h
+++ b/sigc++/functors/slot.h
@@ -102,7 +102,7 @@ private:
    * slot_rep object is registered in the referred trackables.
    * @return A deep copy of the slot_rep object.
    */
-  slot_rep* dup() const override { return new typed_slot_rep(*this); }
+  slot_rep* clone() const override { return new typed_slot_rep(*this); }
 };
 
 /** Abstracts functor execution.
diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc
index 1512923..2373a9a 100644
--- a/sigc++/functors/slot_base.cc
+++ b/sigc++/functors/slot_base.cc
@@ -94,10 +94,10 @@ slot_base::slot_base(const slot_base& src) : rep_(nullptr), blocked_(src.blocked
   {
     // Check call_ so we can ignore invalidated slots.
     // Otherwise, destroyed bound reference parameters (whose destruction caused the slot's
-    // invalidation) may be used during dup().
-    // Note: I'd prefer to check somewhere during dup(). murrayc.
+    // invalidation) may be used during clone().
+    // Note: I'd prefer to check somewhere during clone(). murrayc.
     if (src.rep_->call_)
-      rep_ = src.rep_->dup();
+      rep_ = src.rep_->clone();
     else
     {
       *this = slot_base(); // Return the default invalid slot.
@@ -116,9 +116,9 @@ slot_base::slot_base(slot_base&& src) : rep_(nullptr), blocked_(src.blocked_)
 
       // Check call_ so we can ignore invalidated slots.
       // Otherwise, destroyed bound reference parameters (whose destruction
-      // caused the slot's invalidation) may be used during dup().
+      // caused the slot's invalidation) may be used during clone().
       if (src.rep_->call_)
-        rep_ = src.rep_->dup();
+        rep_ = src.rep_->clone();
       else
         blocked_ = false; // Return the default invalid slot.
     }
@@ -184,7 +184,7 @@ slot_base::operator=(const slot_base& src)
     return *this;
   }
 
-  auto new_rep_ = src.rep_->dup();
+  auto new_rep_ = src.rep_->clone();
 
   if (rep_) // Silently exchange the slot_rep.
   {
@@ -219,7 +219,7 @@ slot_base::operator=(slot_base&& src)
   {
     // src is connected to a parent, e.g. a sigc::signal.
     // Copy, don't move! See https://bugzilla.gnome.org/show_bug.cgi?id=756484
-    new_rep_ = src.rep_->dup();
+    new_rep_ = src.rep_->clone();
   }
   else
   {
diff --git a/sigc++/functors/slot_base.h b/sigc++/functors/slot_base.h
index aa4d691..891c3cf 100644
--- a/sigc++/functors/slot_base.h
+++ b/sigc++/functors/slot_base.h
@@ -40,7 +40,7 @@ using hook = void* (*)(void*);
  *
  * The base class slot_rep serves the purpose to
  * - form a common pointer type (slot_rep*),
- * - offer the possibility to create duplicates (dup()),
+ * - offer the possibility to create duplicates (clone()),
  * - offer a notification callback (notify()),
  * - implement some of slot_base's interface that depends
  *   on the notification callback, i.e.
@@ -88,7 +88,7 @@ public:
   /** Makes a deep copy of the slot_rep object.
    * @return A deep copy of the slot_rep object.
    */
-  virtual slot_rep* dup() const = 0;
+  virtual slot_rep* clone() const = 0;
 
   /** Set the parent with a callback.
    * slots have one parent exclusively.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]