Author: tross
Date: Wed Nov 26 12:43:14 2008
New Revision: 720972
URL: http://svn.apache.org/viewvc?rev=720972&view=rev
Log:
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.
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp?rev=720972&r1=720971&r2=720972&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp Wed Nov 26
12:43:14 2008
@@ -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 {
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h?rev=720972&r1=720971&r2=720972&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h Wed Nov 26
12:43:14 2008
@@ -51,7 +51,10 @@
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);