You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cc...@apache.org on 2008/11/06 17:00:39 UTC
svn commit: r711884 - in /incubator/qpid/trunk/qpid/cpp/src/qpid:
broker/Exchange.cpp broker/Exchange.h framing/FieldTable.cpp
framing/FieldTable.h
Author: cctrieloff
Date: Thu Nov 6 08:00:22 2008
New Revision: 711884
URL: http://svn.apache.org/viewvc?rev=711884&view=rev
Log:
Non fucntional changes
- move sequence count to args, so only store if set
- correct const-ness in fieldtable
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.h
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/broker/Exchange.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.cpp?rev=711884&r1=711883&r2=711884&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.cpp Thu Nov 6 08:00:22 2008
@@ -153,7 +153,7 @@
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 @@
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 @@
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
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.h?rev=711884&r1=711883&r2=711884&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Exchange.h Thu Nov 6 08:00:22 2008
@@ -42,7 +42,7 @@
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;
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=711884&r1=711883&r2=711884&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.cpp Thu Nov 6 08:00:22 2008
@@ -71,19 +71,19 @@
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 @@
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));
}
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=711884&r1=711883&r2=711884&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/FieldTable.h Thu Nov 6 08:00:22 2008
@@ -62,14 +62,14 @@
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;