summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2010-02-08 21:33:54 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2010-02-08 21:33:54 +0000
commit6e3ab3d0ccc6ce42dc695e90fae5500cb9a796e9 (patch)
tree14dc7bde53fbf79cce811a9a62dcb4e0fba6e1b7
parent0dee1a643a3105ed95ed4c34f941236c48e25192 (diff)
downloadqpid-python-6e3ab3d0ccc6ce42dc695e90fae5500cb9a796e9.tar.gz
QPID-2396: add assignment operator to ObjectId class.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@907808 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/include/qmf/engine/ObjectId.h1
-rw-r--r--cpp/src/qmf/engine/ObjectIdImpl.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/cpp/include/qmf/engine/ObjectId.h b/cpp/include/qmf/engine/ObjectId.h
index 2055972c00..51eb2bc9e7 100644
--- a/cpp/include/qmf/engine/ObjectId.h
+++ b/cpp/include/qmf/engine/ObjectId.h
@@ -49,6 +49,7 @@ namespace engine {
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;
diff --git a/cpp/src/qmf/engine/ObjectIdImpl.cpp b/cpp/src/qmf/engine/ObjectIdImpl.cpp
index 76db6d91f9..670ee385a3 100644
--- a/cpp/src/qmf/engine/ObjectIdImpl.cpp
+++ b/cpp/src/qmf/engine/ObjectIdImpl.cpp
@@ -196,4 +196,14 @@ bool ObjectId::operator<(const ObjectId& other) const { return *impl < *other.im
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;
+}