summaryrefslogtreecommitdiff
path: root/qpid/cpp
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
commit242ec4e4357b58184aacbc4d6d7ffae76265689f (patch)
tree064fc1da66e0464c93684f37edf67e36c6768559 /qpid/cpp
parentf2481804db3f53cabd3cd19b79c43c48bb5665c7 (diff)
downloadqpid-python-242ec4e4357b58184aacbc4d6d7ffae76265689f.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@720972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/framing/FieldTable.cpp12
-rw-r--r--qpid/cpp/src/qpid/framing/FieldTable.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/framing/FieldTable.cpp b/qpid/cpp/src/qpid/framing/FieldTable.cpp
index 4da5394479..7ff5a07c9a 100644
--- a/qpid/cpp/src/qpid/framing/FieldTable.cpp
+++ b/qpid/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/qpid/cpp/src/qpid/framing/FieldTable.h b/qpid/cpp/src/qpid/framing/FieldTable.h
index 600ee5356d..9e1214a28c 100644
--- a/qpid/cpp/src/qpid/framing/FieldTable.h
+++ b/qpid/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);