You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2010/02/08 22:33:54 UTC

svn commit: r907808 - in /qpid/trunk/qpid/cpp: include/qmf/engine/ObjectId.h src/qmf/engine/ObjectIdImpl.cpp

Author: kgiusti
Date: Mon Feb  8 21:33:54 2010
New Revision: 907808

URL: http://svn.apache.org/viewvc?rev=907808&view=rev
Log:
QPID-2396: add assignment operator to ObjectId class.

Modified:
    qpid/trunk/qpid/cpp/include/qmf/engine/ObjectId.h
    qpid/trunk/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp

Modified: qpid/trunk/qpid/cpp/include/qmf/engine/ObjectId.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qmf/engine/ObjectId.h?rev=907808&r1=907807&r2=907808&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qmf/engine/ObjectId.h (original)
+++ qpid/trunk/qpid/cpp/include/qmf/engine/ObjectId.h Mon Feb  8 21:33:54 2010
@@ -49,6 +49,7 @@
         bool operator>(const ObjectId& other) const;
         bool operator<=(const ObjectId& other) const;
         bool operator>=(const ObjectId& other) const;
+        ObjectId& operator=(const ObjectId &other);
 
     private:
         friend struct ObjectIdImpl;

Modified: qpid/trunk/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp?rev=907808&r1=907807&r2=907808&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp Mon Feb  8 21:33:54 2010
@@ -196,4 +196,14 @@
 bool ObjectId::operator>(const ObjectId& other) const { return *impl > *other.impl; }
 bool ObjectId::operator<=(const ObjectId& other) const { return !(*impl > *other.impl); }
 bool ObjectId::operator>=(const ObjectId& other) const { return !(*impl < *other.impl); }
+ObjectId&  ObjectId::operator=(const ObjectId& other) {
+    ObjectIdImpl *old;
+    if (this != &other) {
+        old = impl;
+        impl = new ObjectIdImpl(*(other.impl));
+        if (old)
+            delete old;
+    }
+    return *this;
+}
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org