summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/SequenceNumber.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-07-19 08:27:36 +0000
committerGordon Sim <gsim@apache.org>2007-07-19 08:27:36 +0000
commitb87a1e9d27755e2f98792567c29a0625b92c8654 (patch)
treecb1232987efbfa1cc0ef8ec5e62b07b6b6c918b6 /cpp/src/qpid/framing/SequenceNumber.cpp
parentdfe8a370b6580446cf970e27562ad0385178922f (diff)
downloadqpid-python-b87a1e9d27755e2f98792567c29a0625b92c8654.tar.gz
removed the need to pass MethodContext/RequestId through proxy and handler/adapter interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@557522 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/SequenceNumber.cpp')
-rw-r--r--cpp/src/qpid/framing/SequenceNumber.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/src/qpid/framing/SequenceNumber.cpp b/cpp/src/qpid/framing/SequenceNumber.cpp
new file mode 100644
index 0000000000..9bba67d4ae
--- /dev/null
+++ b/cpp/src/qpid/framing/SequenceNumber.cpp
@@ -0,0 +1,62 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "SequenceNumber.h"
+
+using qpid::framing::SequenceNumber;
+
+SequenceNumber::SequenceNumber() : value(0) {}
+
+SequenceNumber::SequenceNumber(uint32_t v) : value((int32_t) v) {}
+
+bool SequenceNumber::operator==(const SequenceNumber& other) const
+{
+ return value == other.value;
+}
+
+bool SequenceNumber::operator!=(const SequenceNumber& other) const
+{
+ return !(value == other.value);
+}
+
+
+SequenceNumber& SequenceNumber::operator++()
+{
+ value = value + 1;
+ return *this;
+}
+
+const SequenceNumber SequenceNumber::operator++(int)
+{
+ SequenceNumber old(value);
+ value = value + 1;
+ return old;
+}
+
+bool SequenceNumber::operator<(const SequenceNumber& other) const
+{
+ return (value - other.value) < 0;
+}
+
+bool SequenceNumber::operator>(const SequenceNumber& other) const
+{
+ return other < *this;
+}