summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-08-10 14:51:08 +0000
committerGordon Sim <gsim@apache.org>2007-08-10 14:51:08 +0000
commit6577b14632d81c15482cb0793e01166cdb28eaff (patch)
tree8b8dc5e4db5690e9c024b862a1d725764687d6fc /cpp/src/qpid/framing
parentc00a668cbf27d90edf18cc935cc982cab6581cae (diff)
downloadqpid-python-6577b14632d81c15482cb0793e01166cdb28eaff.tar.gz
Broker management of message acknowledgements now runs entirely off execution layer.
Flow control support. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564611 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/SequenceNumber.cpp15
-rw-r--r--cpp/src/qpid/framing/SequenceNumber.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/cpp/src/qpid/framing/SequenceNumber.cpp b/cpp/src/qpid/framing/SequenceNumber.cpp
index ea1a34b1cf..24867130a2 100644
--- a/cpp/src/qpid/framing/SequenceNumber.cpp
+++ b/cpp/src/qpid/framing/SequenceNumber.cpp
@@ -51,6 +51,11 @@ const SequenceNumber SequenceNumber::operator++(int)
return old;
}
+SequenceNumber SequenceNumber::operator+(uint32_t i) const
+{
+ return SequenceNumber(value + i);
+}
+
bool SequenceNumber::operator<(const SequenceNumber& other) const
{
return (value - other.value) < 0;
@@ -61,6 +66,16 @@ bool SequenceNumber::operator>(const SequenceNumber& other) const
return other < *this;
}
+bool SequenceNumber::operator<=(const SequenceNumber& other) const
+{
+ return *this == other || *this < other;
+}
+
+bool SequenceNumber::operator>=(const SequenceNumber& other) const
+{
+ return *this == other || *this > other;
+}
+
namespace qpid {
namespace framing {
diff --git a/cpp/src/qpid/framing/SequenceNumber.h b/cpp/src/qpid/framing/SequenceNumber.h
index 3e0dfea2af..9b8f0659b2 100644
--- a/cpp/src/qpid/framing/SequenceNumber.h
+++ b/cpp/src/qpid/framing/SequenceNumber.h
@@ -39,10 +39,13 @@ class SequenceNumber
SequenceNumber& operator++();//prefix ++
const SequenceNumber operator++(int);//postfix ++
+ SequenceNumber operator+(uint32_t) const;
bool operator==(const SequenceNumber& other) const;
bool operator!=(const SequenceNumber& other) const;
bool operator<(const SequenceNumber& other) const;
bool operator>(const SequenceNumber& other) const;
+ bool operator<=(const SequenceNumber& other) const;
+ bool operator>=(const SequenceNumber& other) const;
uint32_t getValue() const { return (uint32_t) value; }
friend int32_t operator-(const SequenceNumber& a, const SequenceNumber& b);