From a804510d81ade0594a75b5c9b8765cafcc233245 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Mon, 16 Jul 2012 13:54:11 +0000 Subject: QPID-3858: Refactor to tidy up several class design issues git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1362039 13f79535-47bb-0310-9956-ffa450edef68 --- .../storePerftools/asyncPerf/QueuedMessage.cpp | 37 +++++++--------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.cpp') diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.cpp b/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.cpp index 11af7c9466..a733a96171 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.cpp @@ -38,28 +38,25 @@ QueuedMessage::QueuedMessage() : QueuedMessage::QueuedMessage(SimpleQueue* q, boost::intrusive_ptr msg) : + boost::enable_shared_from_this(), m_queue(q), - m_msg(msg), - m_enqHandle(q->getStore() ? q->getStore()->createEnqueueHandle(msg->getHandle(), q->getHandle()) : qpid::broker::EnqueueHandle(0)) + m_msg(msg) {} QueuedMessage::QueuedMessage(const QueuedMessage& qm) : + boost::enable_shared_from_this(), m_queue(qm.m_queue), - m_msg(qm.m_msg), - m_enqHandle(qm.m_enqHandle) + m_msg(qm.m_msg) {} -QueuedMessage::~QueuedMessage() +QueuedMessage::QueuedMessage(QueuedMessage* const qm) : + boost::enable_shared_from_this(), + m_queue(qm->m_queue), + m_msg(qm->m_msg) {} -QueuedMessage& -QueuedMessage::operator=(const QueuedMessage& rhs) -{ - m_queue = rhs.m_queue; - m_msg = rhs.m_msg; - m_enqHandle = rhs.m_enqHandle; - return *this; -} +QueuedMessage::~QueuedMessage() +{} SimpleQueue* QueuedMessage::getQueue() const @@ -73,22 +70,10 @@ QueuedMessage::payload() const return m_msg; } -const qpid::broker::EnqueueHandle& -QueuedMessage::enqHandle() const -{ - return m_enqHandle; -} - -qpid::broker::EnqueueHandle& -QueuedMessage::enqHandle() -{ - return m_enqHandle; -} - void QueuedMessage::prepareEnqueue(qpid::broker::TxnHandle& th) { - m_queue->enqueue(th, *this); + m_queue->enqueue(th, shared_from_this()); } void -- cgit v1.2.1