qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject svn commit: r1145644 - in /qpid/trunk/qpid/cpp: include/qmf/DataAddr.h src/qmf/DataAddr.cpp src/qmf/DataAddrImpl.h src/qpid/store/StorageProvider.h
Date Tue, 12 Jul 2011 16:11:34 GMT
Author: tross
Date: Tue Jul 12 16:11:34 2011
New Revision: 1145644

URL: http://svn.apache.org/viewvc?rev=1145644&view=rev
Log:
QPID-3344 - Comparisons of const DataAddr objects are incorrect
Applied patch from Zane Bitter

Modified:
    qpid/trunk/qpid/cpp/include/qmf/DataAddr.h
    qpid/trunk/qpid/cpp/src/qmf/DataAddr.cpp
    qpid/trunk/qpid/cpp/src/qmf/DataAddrImpl.h
    qpid/trunk/qpid/cpp/src/qpid/store/StorageProvider.h

Modified: qpid/trunk/qpid/cpp/include/qmf/DataAddr.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qmf/DataAddr.h?rev=1145644&r1=1145643&r2=1145644&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qmf/DataAddr.h (original)
+++ qpid/trunk/qpid/cpp/include/qmf/DataAddr.h Tue Jul 12 16:11:34 2011
@@ -51,6 +51,9 @@ namespace qmf {
         QMF_EXTERN uint32_t getAgentEpoch() const;
         QMF_EXTERN qpid::types::Variant::Map asMap() const;
 
+        QMF_EXTERN bool operator==(const DataAddr&) const;
+        QMF_EXTERN bool operator<(const DataAddr&) const;
+
 #ifndef SWIG
     private:
         friend class qmf::PrivateImplRef<DataAddr>;

Modified: qpid/trunk/qpid/cpp/src/qmf/DataAddr.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/DataAddr.cpp?rev=1145644&r1=1145643&r2=1145644&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/DataAddr.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qmf/DataAddr.cpp Tue Jul 12 16:11:34 2011
@@ -36,7 +36,9 @@ DataAddr::~DataAddr() { PI::dtor(*this);
 DataAddr& DataAddr::operator=(const DataAddr& s) { return PI::assign(*this, s); }
 
 bool DataAddr::operator==(const DataAddr& o) { return *impl == *o.impl; }
+bool DataAddr::operator==(const DataAddr& o) const { return *impl == *o.impl; }
 bool DataAddr::operator<(const DataAddr& o) { return *impl < *o.impl; }
+bool DataAddr::operator<(const DataAddr& o) const { return *impl < *o.impl; }
 
 DataAddr::DataAddr(const qpid::types::Variant::Map& m) { PI::ctor(*this, new DataAddrImpl(m));
}
 DataAddr::DataAddr(const string& n, const string& a, uint32_t e) { PI::ctor(*this,
new DataAddrImpl(n, a, e)); }
@@ -45,7 +47,7 @@ const string& DataAddr::getAgentName() c
 uint32_t DataAddr::getAgentEpoch() const { return impl->getAgentEpoch(); }
 Variant::Map DataAddr::asMap() const { return impl->asMap(); }
 
-bool DataAddrImpl::operator==(const DataAddrImpl& other)
+bool DataAddrImpl::operator==(const DataAddrImpl& other) const
 {
     return
         agentName == other.agentName &&
@@ -54,7 +56,7 @@ bool DataAddrImpl::operator==(const Data
 }
 
 
-bool DataAddrImpl::operator<(const DataAddrImpl& other)
+bool DataAddrImpl::operator<(const DataAddrImpl& other) const
 {
     if (agentName < other.agentName) return true;
     if (agentName > other.agentName) return false;

Modified: qpid/trunk/qpid/cpp/src/qmf/DataAddrImpl.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/DataAddrImpl.h?rev=1145644&r1=1145643&r2=1145644&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/DataAddrImpl.h (original)
+++ qpid/trunk/qpid/cpp/src/qmf/DataAddrImpl.h Tue Jul 12 16:11:34 2011
@@ -38,8 +38,8 @@ namespace qmf {
         //
         // Methods from API handle
         //
-        bool operator==(const DataAddrImpl&);
-        bool operator<(const DataAddrImpl&);
+        bool operator==(const DataAddrImpl&) const;
+        bool operator<(const DataAddrImpl&) const;
         DataAddrImpl(const qpid::types::Variant::Map&);
         DataAddrImpl(const std::string& _name, const std::string& _agentName, uint32_t
_agentEpoch=0) :
             agentName(_agentName), name(_name), agentEpoch(_agentEpoch) {}

Modified: qpid/trunk/qpid/cpp/src/qpid/store/StorageProvider.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/store/StorageProvider.h?rev=1145644&r1=1145643&r2=1145644&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/store/StorageProvider.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/store/StorageProvider.h Tue Jul 12 16:11:34 2011
@@ -54,7 +54,7 @@ struct QueueEntry {
     QueueEntry(uint64_t id, TplStatus tpl = NONE, const std::string& x = "")
         : queueId(id), tplStatus(tpl), xid(x) {}
 
-    bool operator==(const QueueEntry& rhs) {
+    bool operator==(const QueueEntry& rhs) const {
         if (queueId != rhs.queueId) return false;
         if (tplStatus == NONE && rhs.tplStatus == NONE) return true;
         return xid == rhs.xid;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message