From add4380ec811d23d0808b3b59dc74160e829f277 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 28 May 2012 18:24:31 +0000 Subject: QPID-3603: Failover optimization restored. A backup broker that fails over to a new primary can avoid downloading messages that it already has from the previous primary. The backup sends its position to the primary as a client-arg and the primary sends back any necessary dequeues and starts replicating after the messages on the backup. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1343350 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/include/qpid/framing/SequenceNumber.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cpp/include') diff --git a/cpp/include/qpid/framing/SequenceNumber.h b/cpp/include/qpid/framing/SequenceNumber.h index dd85d97a52..00fa2469c8 100644 --- a/cpp/include/qpid/framing/SequenceNumber.h +++ b/cpp/include/qpid/framing/SequenceNumber.h @@ -57,12 +57,18 @@ boost::equality_comparable< QPID_COMMON_EXTERN uint32_t encodedSize() const; template void serialize(S& s) { s(value); } - - friend inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b); }; inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b) { - return int32_t(a.value - b.value); + return int32_t(a.getValue() - b.getValue()); +} + +inline SequenceNumber operator+(const SequenceNumber& a, int32_t n) { + return SequenceNumber(a.getValue() + n); +} + +inline SequenceNumber operator-(const SequenceNumber& a, int32_t n) { + return SequenceNumber(a.getValue() - n); } struct Window -- cgit v1.2.1