summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/RangeSet.h
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-06-02 21:06:36 +0000
committerGordon Sim <gsim@apache.org>2008-06-02 21:06:36 +0000
commita4bfd13cf405805b71644959ecd0526e1aeae0f9 (patch)
tree86210153a150d6479f774731d8b49f8149d4e5ad /cpp/src/qpid/RangeSet.h
parent6c5f69a0e6e62fc220f3b4198dad1f202552e2ad (diff)
downloadqpid-python-a4bfd13cf405805b71644959ecd0526e1aeae0f9.tar.gz
Improve performance of synchronous publication by not requesting known-completed response
for every completed sent. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@662561 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/RangeSet.h')
-rw-r--r--cpp/src/qpid/RangeSet.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/qpid/RangeSet.h b/cpp/src/qpid/RangeSet.h
index af3b2223cd..2a88426f17 100644
--- a/cpp/src/qpid/RangeSet.h
+++ b/cpp/src/qpid/RangeSet.h
@@ -169,6 +169,9 @@ class RangeSet
RangeIterator rangesEnd() const { return ranges.end(); }
size_t rangesSize() const { return ranges.size(); }
+ // The difference between the start and end of this range set
+ uint32_t span() const;
+
bool empty() const { return ranges.empty(); }
void clear() { ranges.clear(); }
@@ -309,6 +312,11 @@ template <class T> Range<T> RangeSet<T>::rangeContaining(const T& t) const {
return (i != ranges.end() && i->contains(t)) ? *i : Range<T>(t,t);
}
+template <class T> uint32_t RangeSet<T>::span() const {
+ if (ranges.empty()) return 0;
+ return ranges.back().last() - ranges.front().first();
+}
+
} // namespace qpid