From 6e3ab3d0ccc6ce42dc695e90fae5500cb9a796e9 Mon Sep 17 00:00:00 2001 From: Kenneth Anthony Giusti Date: Mon, 8 Feb 2010 21:33:54 +0000 Subject: 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 --- cpp/src/qmf/engine/ObjectIdImpl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cpp/src') 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; +} -- cgit v1.2.1