From 3f8a466daf6eba9717c27a635f2a7307cc4d03bd Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Mon, 24 Mar 2008 17:43:55 +0000 Subject: - Refactored RefCounted class to avoid virtual inheritance - Removed extraneous includes and definitions from RefCounted.h - Fixed all the places that were relying on RefCounted.h to be including the intrusive_ptr header file and were assuming that something had imported intrusive_ptr into the qpid namespace git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@640479 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Queue.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'cpp/src/qpid/broker/Queue.cpp') diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index c4094a117b..92e87cc9d8 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -19,21 +19,25 @@ * */ -#include "qpid/log/Statement.h" -#include "qpid/framing/reply_exceptions.h" #include "Broker.h" #include "Queue.h" #include "Exchange.h" #include "DeliverableMessage.h" #include "MessageStore.h" +#include "QueueRegistry.h" + +#include "qpid/log/Statement.h" +#include "qpid/framing/reply_exceptions.h" #include "qpid/sys/Monitor.h" #include "qpid/sys/Time.h" + #include -#include -#include "QueueRegistry.h" #include #include +#include +#include + using namespace qpid::broker; using namespace qpid::sys; using namespace qpid::framing; @@ -87,7 +91,7 @@ void Queue::notifyDurableIOComplete() } -void Queue::deliver(intrusive_ptr& msg){ +void Queue::deliver(boost::intrusive_ptr& msg){ if (msg->isImmediate() && getConsumerCount() == 0) { if (alternateExchange) { DeliverableMessage deliverable(msg); @@ -124,7 +128,7 @@ void Queue::deliver(intrusive_ptr& msg){ } -void Queue::recover(intrusive_ptr& msg){ +void Queue::recover(boost::intrusive_ptr& msg){ push(msg); msg->enqueueComplete(); // mark the message as enqueued if (mgmtObject.get() != 0) { @@ -144,7 +148,7 @@ void Queue::recover(intrusive_ptr& msg){ } } -void Queue::process(intrusive_ptr& msg){ +void Queue::process(boost::intrusive_ptr& msg){ push(msg); if (mgmtObject.get() != 0) { Mutex::ScopedLock alock(mgmtObject->accessorLock); @@ -393,7 +397,7 @@ void Queue::pop(){ messages.pop_front(); } -void Queue::push(intrusive_ptr& msg){ +void Queue::push(boost::intrusive_ptr& msg){ Mutex::ScopedLock locker(messageLock); messages.push_back(QueuedMessage(this, msg, ++sequence)); if (policy.get()) { @@ -434,11 +438,11 @@ bool Queue::canAutoDelete() const{ } // return true if store exists, -bool Queue::enqueue(TransactionContext* ctxt, intrusive_ptr msg) +bool Queue::enqueue(TransactionContext* ctxt, boost::intrusive_ptr msg) { if (msg->isPersistent() && store) { msg->enqueueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue - intrusive_ptr pmsg = static_pointer_cast(msg); + boost::intrusive_ptr pmsg = boost::static_pointer_cast(msg); store->enqueue(ctxt, pmsg, *this); return true; } @@ -447,11 +451,11 @@ bool Queue::enqueue(TransactionContext* ctxt, intrusive_ptr msg) } // return true if store exists, -bool Queue::dequeue(TransactionContext* ctxt, intrusive_ptr msg) +bool Queue::dequeue(TransactionContext* ctxt, boost::intrusive_ptr msg) { if (msg->isPersistent() && store) { msg->dequeueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue - intrusive_ptr pmsg = static_pointer_cast(msg); + boost::intrusive_ptr pmsg = boost::static_pointer_cast(msg); store->dequeue(ctxt, pmsg, *this); return true; } -- cgit v1.2.1