summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-11-06 16:00:22 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-11-06 16:00:22 +0000
commite210a6d2d45f260fe9a711fc5266b749e6d045a5 (patch)
tree741a692a9969594fc3f339a7102bd7563207fc78 /cpp
parent2e987bf2b0c3f9318b28c79186a35f338c90ee6c (diff)
downloadqpid-python-e210a6d2d45f260fe9a711fc5266b749e6d045a5.tar.gz
Non fucntional changes
- move sequence count to args, so only store if set - correct const-ness in fieldtable git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711884 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/Exchange.cpp7
-rw-r--r--cpp/src/qpid/broker/Exchange.h2
-rw-r--r--cpp/src/qpid/framing/FieldTable.cpp10
-rw-r--r--cpp/src/qpid/framing/FieldTable.h12
4 files changed, 15 insertions, 16 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp
index 243d089ccb..6a3fa88ff0 100644
--- a/cpp/src/qpid/broker/Exchange.cpp
+++ b/cpp/src/qpid/broker/Exchange.cpp
@@ -153,7 +153,7 @@ Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffe
buffer.get(args);
Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first;
- exch->sequenceNo = buffer.getInt64();
+ exch->sequenceNo = args.getAsInt64("qpid.sequence_counter");
return exch;
}
@@ -162,8 +162,8 @@ void Exchange::encode(Buffer& buffer) const
buffer.putShortString(name);
buffer.putOctet(durable);
buffer.putShortString(getType());
+ if (sequenceNo) args.setInt64(std::string("qpid.sequence_counter"),sequenceNo);
buffer.put(args);
- buffer.putInt64(sequenceNo);
}
uint32_t Exchange::encodedSize() const
@@ -171,8 +171,7 @@ uint32_t Exchange::encodedSize() const
return name.size() + 1/*short string size*/
+ 1 /*durable*/
+ getType().size() + 1/*short string size*/
- + args.encodedSize()
- + 8; /*int64 */
+ + args.encodedSize();
}
ManagementObject* Exchange::GetManagementObject (void) const
diff --git a/cpp/src/qpid/broker/Exchange.h b/cpp/src/qpid/broker/Exchange.h
index 05b465d9df..5de3e98bc0 100644
--- a/cpp/src/qpid/broker/Exchange.h
+++ b/cpp/src/qpid/broker/Exchange.h
@@ -42,7 +42,7 @@ class Exchange : public PersistableExchange, public management::Manageable {
private:
const std::string name;
const bool durable;
- qpid::framing::FieldTable args;
+ mutable qpid::framing::FieldTable args;
boost::shared_ptr<Exchange> alternate;
uint32_t alternateUsers;
mutable uint64_t persistenceId;
diff --git a/cpp/src/qpid/framing/FieldTable.cpp b/cpp/src/qpid/framing/FieldTable.cpp
index 90acbaf6bc..4da5394479 100644
--- a/cpp/src/qpid/framing/FieldTable.cpp
+++ b/cpp/src/qpid/framing/FieldTable.cpp
@@ -71,19 +71,19 @@ void FieldTable::setString(const std::string& name, const std::string& value){
values[name] = ValuePtr(new Str16Value(value));
}
-void FieldTable::setInt(const std::string& name, int value){
+void FieldTable::setInt(const std::string& name, const int value){
values[name] = ValuePtr(new IntegerValue(value));
}
-void FieldTable::setInt64(const std::string& name, int64_t value){
+void FieldTable::setInt64(const std::string& name, const int64_t value){
values[name] = ValuePtr(new Integer64Value(value));
}
-void FieldTable::setTimestamp(const std::string& name, uint64_t value){
+void FieldTable::setTimestamp(const std::string& name, const uint64_t value){
values[name] = ValuePtr(new TimeValue(value));
}
-void FieldTable::setUInt64(const std::string& name, uint64_t value){
+void FieldTable::setUInt64(const std::string& name, const uint64_t value){
values[name] = ValuePtr(new Unsigned64Value(value));
}
@@ -96,7 +96,7 @@ void FieldTable::setArray(const std::string& name, const Array& value)
values[name] = ValuePtr(new ArrayValue(value));
}
-void FieldTable::setFloat(const std::string& name, float value){
+void FieldTable::setFloat(const std::string& name, const float value){
values[name] = ValuePtr(new FloatValue(value));
}
diff --git a/cpp/src/qpid/framing/FieldTable.h b/cpp/src/qpid/framing/FieldTable.h
index 66103448a7..600ee5356d 100644
--- a/cpp/src/qpid/framing/FieldTable.h
+++ b/cpp/src/qpid/framing/FieldTable.h
@@ -62,14 +62,14 @@ class FieldTable
bool isSet(const std::string& name) const { return get(name).get() != 0; }
void setString(const std::string& name, const std::string& value);
- void setInt(const std::string& name, int value);
- void setInt64(const std::string& name, int64_t value);
- void setTimestamp(const std::string& name, uint64_t value);
- void setUInt64(const std::string& name, uint64_t value);
+ void setInt(const std::string& name, const int value);
+ void setInt64(const std::string& name, const int64_t value);
+ void setTimestamp(const std::string& name, const uint64_t value);
+ void setUInt64(const std::string& name, const uint64_t value);
void setTable(const std::string& name, const FieldTable& value);
void setArray(const std::string& name, const Array& value);
- void setFloat(const std::string& name, float value);
- void setDouble(const std::string& name, double value);
+ void setFloat(const std::string& name, const float value);
+ void setDouble(const std::string& name, const double value);
//void setDecimal(string& name, xxx& value);
int getAsInt(const std::string& name) const;