activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1050484 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core: FifoMessageDispatchChannel.cpp FifoMessageDispatchChannel.h
Date Fri, 17 Dec 2010 20:11:57 GMT
Author: tabish
Date: Fri Dec 17 20:11:57 2010
New Revision: 1050484

URL: http://svn.apache.org/viewvc?rev=1050484&view=rev
Log:
Switch to using the new LinkedList class as its faster and better tested.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.cpp?rev=1050484&r1=1050483&r2=1050484&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.cpp
Fri Dec 17 20:11:57 2010
@@ -38,7 +38,7 @@ FifoMessageDispatchChannel::~FifoMessage
 ////////////////////////////////////////////////////////////////////////////////
 void FifoMessageDispatchChannel::enqueue( const Pointer<MessageDispatch>& message
) {
     synchronized( &channel ) {
-        channel.push( message );
+        channel.addLast( message );
         channel.notify();
     }
 }
@@ -46,7 +46,7 @@ void FifoMessageDispatchChannel::enqueue
 ////////////////////////////////////////////////////////////////////////////////
 void FifoMessageDispatchChannel::enqueueFirst( const Pointer<MessageDispatch>&
message ) {
     synchronized( &channel ) {
-        channel.enqueueFront( message );
+        channel.addFirst( message );
         channel.notify();
     }
 }
@@ -54,7 +54,7 @@ void FifoMessageDispatchChannel::enqueue
 ////////////////////////////////////////////////////////////////////////////////
 bool FifoMessageDispatchChannel::isEmpty() const {
     synchronized( &channel ) {
-        return channel.empty();
+        return channel.isEmpty();
     }
 
     return false;
@@ -65,7 +65,7 @@ Pointer<MessageDispatch> FifoMessageDisp
 
     synchronized( &channel ) {
         // Wait until the channel is ready to deliver messages.
-        while( timeout != 0 && !closed && ( channel.empty() || !running )
) {
+        while( timeout != 0 && !closed && ( channel.isEmpty() || !running
) ) {
             if( timeout == -1 ) {
                 channel.wait();
             } else {
@@ -74,7 +74,7 @@ Pointer<MessageDispatch> FifoMessageDisp
             }
         }
 
-        if( closed || !running || channel.empty() ) {
+        if( closed || !running || channel.isEmpty() ) {
             return Pointer<MessageDispatch>();
         }
 
@@ -87,7 +87,7 @@ Pointer<MessageDispatch> FifoMessageDisp
 ////////////////////////////////////////////////////////////////////////////////
 Pointer<MessageDispatch> FifoMessageDispatchChannel::dequeueNoWait() {
     synchronized( &channel ) {
-        if( closed || !running || channel.empty() ) {
+        if( closed || !running || channel.isEmpty() ) {
             return Pointer<MessageDispatch>();
         }
         return channel.pop();
@@ -99,10 +99,10 @@ Pointer<MessageDispatch> FifoMessageDisp
 ////////////////////////////////////////////////////////////////////////////////
 Pointer<MessageDispatch> FifoMessageDispatchChannel::peek() const {
     synchronized( &channel ) {
-        if( closed || !running || channel.empty() ) {
+        if( closed || !running || channel.isEmpty() ) {
             return Pointer<MessageDispatch>();
         }
-        return channel.front();
+        return channel.getFirst();
     }
 
     return Pointer<MessageDispatch>();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.h?rev=1050484&r1=1050483&r2=1050484&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/FifoMessageDispatchChannel.h
Fri Dec 17 20:11:57 2010
@@ -21,6 +21,7 @@
 #include <activemq/util/Config.h>
 #include <activemq/core/MessageDispatchChannel.h>
 
+#include <decaf/util/LinkedList.h>
 #include <decaf/lang/Pointer.h>
 
 namespace activemq {
@@ -32,7 +33,7 @@ namespace core {
         bool closed;
         bool running;
 
-        mutable decaf::util::StlQueue< Pointer<MessageDispatch> > channel;
+        mutable decaf::util::LinkedList< Pointer<MessageDispatch> > channel;
 
     private:
 



Mime
View raw message