diff options
| author | Gordon Sim <gsim@apache.org> | 2007-09-28 15:06:12 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-09-28 15:06:12 +0000 |
| commit | b46c7467a0422e16f63f6b7d7fabb8d1ca9a2cff (patch) | |
| tree | ed896b93d4ebd1c7357fee7569c37564d913f999 /cpp/src/qpid/framing | |
| parent | 816b56837d862980e9086fe8ed02b84ca764eb1f (diff) | |
| download | qpid-python-b46c7467a0422e16f63f6b7d7fabb8d1ca9a2cff.tar.gz | |
Minor refactoring of execution layer
Set sync bit when session is in sync mode
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
| -rw-r--r-- | cpp/src/qpid/framing/AMQMethodBody.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/AccumulatedAck.cpp | 9 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/AccumulatedAck.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/ModelMethod.h | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/cpp/src/qpid/framing/AMQMethodBody.h b/cpp/src/qpid/framing/AMQMethodBody.h index e195142221..09a5ea4f00 100644 --- a/cpp/src/qpid/framing/AMQMethodBody.h +++ b/cpp/src/qpid/framing/AMQMethodBody.h @@ -64,6 +64,7 @@ class AMQMethodBody : public AMQBody { virtual uint8_t type() const { return METHOD_BODY; } virtual bool isSync() const { return false; /*only ModelMethods can have the sync flag set*/ } + virtual void setSync(bool) const { /*only ModelMethods can have the sync flag set*/ } AMQMethodBody* getMethod() { return this; } const AMQMethodBody* getMethod() const { return this; } diff --git a/cpp/src/qpid/framing/AccumulatedAck.cpp b/cpp/src/qpid/framing/AccumulatedAck.cpp index 9daae5494c..219a68b96c 100644 --- a/cpp/src/qpid/framing/AccumulatedAck.cpp +++ b/cpp/src/qpid/framing/AccumulatedAck.cpp @@ -100,6 +100,15 @@ void AccumulatedAck::collectRanges(SequenceNumberSet& set) const } } +void AccumulatedAck::update(const SequenceNumber cumulative, const SequenceNumberSet& range) +{ + update(mark, cumulative); + for (SequenceNumberSet::const_iterator i = range.begin(); i != range.end(); i++) { + update(*i, *(++i)); + } +} + + bool Range::contains(SequenceNumber i) const { return i >= start && i <= end; diff --git a/cpp/src/qpid/framing/AccumulatedAck.h b/cpp/src/qpid/framing/AccumulatedAck.h index f75842968f..1f66197e2a 100644 --- a/cpp/src/qpid/framing/AccumulatedAck.h +++ b/cpp/src/qpid/framing/AccumulatedAck.h @@ -64,6 +64,7 @@ namespace qpid { void clear(); bool covers(SequenceNumber tag) const; void collectRanges(SequenceNumberSet& set) const; + void update(const SequenceNumber cumulative, const SequenceNumberSet& range); }; std::ostream& operator<<(std::ostream&, const Range&); std::ostream& operator<<(std::ostream&, const AccumulatedAck&); diff --git a/cpp/src/qpid/framing/ModelMethod.h b/cpp/src/qpid/framing/ModelMethod.h index 8e2fafb019..f3c0fa5d65 100644 --- a/cpp/src/qpid/framing/ModelMethod.h +++ b/cpp/src/qpid/framing/ModelMethod.h @@ -30,13 +30,14 @@ namespace framing { class ModelMethod : public AMQMethodBody { - ExecutionHeader header; + mutable ExecutionHeader header; public: virtual ~ModelMethod() {} virtual void encode(Buffer& buffer) const { header.encode(buffer); } virtual void decode(Buffer& buffer, uint32_t size=0) { header.decode(buffer, size); } virtual uint32_t size() const { return header.size(); } virtual bool isSync() const { return header.getSync(); } + virtual void setSync(bool on) const { header.setSync(on); } ExecutionHeader& getHeader() { return header; } const ExecutionHeader& getHeader() const { return header; } }; |
