summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/lib/broker/AccumulatedAck.h4
-rw-r--r--cpp/lib/broker/BrokerChannel.cpp1
-rw-r--r--cpp/tests/AccumulatedAckTest.cpp8
-rw-r--r--cpp/tests/TxAckTest.cpp2
4 files changed, 8 insertions, 7 deletions
diff --git a/cpp/lib/broker/AccumulatedAck.h b/cpp/lib/broker/AccumulatedAck.h
index 6ab0cfbe2e..eaae652a30 100644
--- a/cpp/lib/broker/AccumulatedAck.h
+++ b/cpp/lib/broker/AccumulatedAck.h
@@ -31,7 +31,8 @@ namespace qpid {
* Keeps an accumulated record of acked messages (by delivery
* tag).
*/
- struct AccumulatedAck{
+ class AccumulatedAck {
+ public:
/**
* If not zero, then everything up to this value has been
* acked.
@@ -43,6 +44,7 @@ namespace qpid {
*/
std::list<u_int64_t> individual;
+ AccumulatedAck(u_int64_t r) : range(r) {}
void update(u_int64_t firstTag, u_int64_t lastTag);
void consolidate();
void clear();
diff --git a/cpp/lib/broker/BrokerChannel.cpp b/cpp/lib/broker/BrokerChannel.cpp
index ddf9ad0e3c..47f6686b9e 100644
--- a/cpp/lib/broker/BrokerChannel.cpp
+++ b/cpp/lib/broker/BrokerChannel.cpp
@@ -60,6 +60,7 @@ Channel::Channel(
prefetchCount(0),
framesize(_framesize),
tagGenerator("sgen"),
+ accumulatedAck(0),
store(_store),
messageBuilder(this, _store, _stagingThreshold),
opened(id == 0),//channel 0 is automatically open, other must be explicitly opened
diff --git a/cpp/tests/AccumulatedAckTest.cpp b/cpp/tests/AccumulatedAckTest.cpp
index 64c1f979c0..d00977b69e 100644
--- a/cpp/tests/AccumulatedAckTest.cpp
+++ b/cpp/tests/AccumulatedAckTest.cpp
@@ -37,7 +37,7 @@ class AccumulatedAckTest : public CppUnit::TestCase
public:
void testGeneral()
{
- AccumulatedAck ack;
+ AccumulatedAck ack(0);
ack.clear();
ack.update(3,3);
ack.update(7,7);
@@ -63,8 +63,7 @@ class AccumulatedAckTest : public CppUnit::TestCase
void testCovers()
{
- AccumulatedAck ack;
- ack.range = 5;
+ AccumulatedAck ack(5);
ack.individual.push_back(7);
ack.individual.push_back(9);
@@ -83,8 +82,7 @@ class AccumulatedAckTest : public CppUnit::TestCase
void testUpdateAndConsolidate()
{
- AccumulatedAck ack;
- ack.clear();
+ AccumulatedAck ack(0);
ack.update(1, 1);
ack.update(3, 3);
ack.update(10, 10);
diff --git a/cpp/tests/TxAckTest.cpp b/cpp/tests/TxAckTest.cpp
index e464ff78f4..c189533ea9 100644
--- a/cpp/tests/TxAckTest.cpp
+++ b/cpp/tests/TxAckTest.cpp
@@ -67,7 +67,7 @@ class TxAckTest : public CppUnit::TestCase
public:
- TxAckTest() : queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
+ TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
{
for(int i = 0; i < 10; i++){
Message::shared_ptr msg(