From a4bfd13cf405805b71644959ecd0526e1aeae0f9 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 2 Jun 2008 21:06:36 +0000 Subject: 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 --- cpp/src/qpid/RangeSet.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpp/src/qpid/RangeSet.h') 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 Range RangeSet::rangeContaining(const T& t) const { return (i != ranges.end() && i->contains(t)) ? *i : Range(t,t); } +template uint32_t RangeSet::span() const { + if (ranges.empty()) return 0; + return ranges.back().last() - ranges.front().first(); +} + } // namespace qpid -- cgit v1.2.1