summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-11-26 20:43:14 +0000
committerTed Ross <tross@apache.org>2008-11-26 20:43:14 +0000
commitde3ee556236aaa9d46509eb78c9c3f244fc0f90b (patch)
tree4fdffe94146e16d10ee648eed3e276a23bd552ef
parentce39de6a979f727e1c1be030bf3d316c07d368fa (diff)
downloadqpid-python-de3ee556236aaa9d46509eb78c9c3f244fc0f90b.tar.gz
Added a copy constructor and assignment operator to FieldTable.
This was done to solve a library problem with the RHEL4 distribution. The compiler generated the assignment operator in an application using the C++ qpid client libraries. This generated function (referenced by a weak symbol) appeared to be causing problems in the heart of the library (handling of the ConnectionStartBody) with regard to the handling of field tables. The failure mechanism is not fully understood, but this seemingly innocuous change solves the problem. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@720972 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/framing/FieldTable.cpp12
-rw-r--r--cpp/src/qpid/framing/FieldTable.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/cpp/src/qpid/framing/FieldTable.cpp b/cpp/src/qpid/framing/FieldTable.cpp
index 4da5394479..7ff5a07c9a 100644
--- a/cpp/src/qpid/framing/FieldTable.cpp
+++ b/cpp/src/qpid/framing/FieldTable.cpp
@@ -30,6 +30,18 @@
namespace qpid {
namespace framing {
+FieldTable::FieldTable(const FieldTable& ft)
+{
+ *this = ft;
+}
+
+FieldTable& FieldTable::operator=(const FieldTable& ft)
+{
+ clear();
+ values = ft.values;
+ return *this;
+}
+
FieldTable::~FieldTable() {}
uint32_t FieldTable::encodedSize() const {
diff --git a/cpp/src/qpid/framing/FieldTable.h b/cpp/src/qpid/framing/FieldTable.h
index 600ee5356d..9e1214a28c 100644
--- a/cpp/src/qpid/framing/FieldTable.h
+++ b/cpp/src/qpid/framing/FieldTable.h
@@ -51,7 +51,10 @@ class FieldTable
typedef std::map<std::string, ValuePtr> ValueMap;
typedef ValueMap::iterator iterator;
+ FieldTable() {};
+ FieldTable(const FieldTable& ft);
~FieldTable();
+ FieldTable& operator=(const FieldTable& ft);
uint32_t encodedSize() const;
void encode(Buffer& buffer) const;
void decode(Buffer& buffer);