diff options
| author | Ted Ross <tross@apache.org> | 2011-07-12 16:11:34 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2011-07-12 16:11:34 +0000 |
| commit | 3db85f26920af450a5626c1c663ae0f835b725cd (patch) | |
| tree | 705abdabb9e917e788992de5c6eaf450f5c92491 /cpp/src/qmf | |
| parent | 9e1c8d1ab0d3f014d2ac3800e59390c2f958232f (diff) | |
| download | qpid-python-3db85f26920af450a5626c1c663ae0f835b725cd.tar.gz | |
QPID-3344 - Comparisons of const DataAddr objects are incorrect
Applied patch from Zane Bitter
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1145644 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf')
| -rw-r--r-- | cpp/src/qmf/DataAddr.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qmf/DataAddrImpl.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qmf/DataAddr.cpp b/cpp/src/qmf/DataAddr.cpp index fb51d5787f..d16e12062e 100644 --- a/cpp/src/qmf/DataAddr.cpp +++ b/cpp/src/qmf/DataAddr.cpp @@ -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() const { return impl->getAgentName(); } 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 DataAddrImpl& other) } -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; diff --git a/cpp/src/qmf/DataAddrImpl.h b/cpp/src/qmf/DataAddrImpl.h index 3f9cae9453..11d512f0c4 100644 --- a/cpp/src/qmf/DataAddrImpl.h +++ b/cpp/src/qmf/DataAddrImpl.h @@ -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) {} |
