summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/DeliveryRecord.h11
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp8
2 files changed, 10 insertions, 9 deletions
diff --git a/cpp/src/qpid/broker/DeliveryRecord.h b/cpp/src/qpid/broker/DeliveryRecord.h
index 26516f8a3a..dc93542092 100644
--- a/cpp/src/qpid/broker/DeliveryRecord.h
+++ b/cpp/src/qpid/broker/DeliveryRecord.h
@@ -40,10 +40,11 @@ struct AckRange;
/**
* Record of a delivery for which an ack is outstanding.
*/
-class DeliveryRecord {
+class DeliveryRecord
+{
QueuedMessage msg;
mutable Queue::shared_ptr queue;
- std::string tag;
+ const std::string tag;
DeliveryId id;
bool acquired;
bool acceptExpected;
@@ -51,7 +52,7 @@ class DeliveryRecord {
bool completed;
bool ended;
- bool windowing;
+ const bool windowing;
/**
* Record required credit on construction as the pointer to the
@@ -60,7 +61,7 @@ class DeliveryRecord {
* to reallocate credit when it is completed (which could happen
* after that).
*/
- uint32_t credit;
+ const uint32_t credit;
public:
QPID_BROKER_EXTERN DeliveryRecord(const QueuedMessage& msg,
@@ -103,7 +104,7 @@ class DeliveryRecord {
void deliver(framing::FrameHandler& h, DeliveryId deliveryId, uint16_t framesize);
void setId(DeliveryId _id) { id = _id; }
- typedef std::deque<DeliveryRecord> DeliveryRecords;
+ typedef std::list<DeliveryRecord> DeliveryRecords;
static AckRange findRange(DeliveryRecords& records, DeliveryId first, DeliveryId last);
const QueuedMessage& getMessage() const { return msg; }
framing::SequenceNumber getId() const { return id; }
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index b2df5e36a3..3c7c6d9afa 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/cpp/src/qpid/broker/SemanticState.cpp
@@ -440,7 +440,7 @@ void SemanticState::recover(bool requeue)
//unconfirmed messages re redelivered and therefore have their
//id adjusted, confirmed messages are not and so the ordering
//w.r.t id is lost
- std::sort(unacked.begin(), unacked.end());
+ unacked.sort();
}
}
@@ -642,12 +642,12 @@ void SemanticState::accepted(DeliveryId first, DeliveryId last)
//if the messages are already completed, they can be
//removed from the record
- unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end());
+ unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
}
} else {
for_each(range.start, range.end, boost::bind(&DeliveryRecord::accept, _1, (TransactionContext*) 0));
- unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end());
+ unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
}
}
@@ -655,7 +655,7 @@ void SemanticState::completed(DeliveryId first, DeliveryId last)
{
AckRange range = findRange(first, last);
for_each(range.start, range.end, boost::bind(&SemanticState::complete, this, _1));
- unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end());
+ unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
requestDispatch();
}