activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r926126 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h
Date Mon, 22 Mar 2010 15:24:17 GMT
Author: tabish
Date: Mon Mar 22 15:24:16 2010
New Revision: 926126

URL: http://svn.apache.org/viewvc?rev=926126&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-292

Use LocalTransactionId as Map key instead of the base class TransactionId

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h?rev=926126&r1=926125&r2=926126&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionState.h Mon
Mar 22 15:24:16 2010
@@ -25,6 +25,7 @@
 #include <activemq/commands/ConsumerId.h>
 #include <activemq/commands/ProducerId.h>
 #include <activemq/commands/TransactionId.h>
+#include <activemq/commands/LocalTransactionId.h>
 #include <activemq/state/ConsumerState.h>
 #include <activemq/state/ProducerState.h>
 #include <activemq/state/SessionState.h>
@@ -50,9 +51,9 @@ namespace state {
     private:
 
         Pointer< ConnectionInfo > info;
-        ConcurrentStlMap< Pointer<TransactionId>,
+        ConcurrentStlMap< Pointer<LocalTransactionId>,
                           Pointer<TransactionState>,
-                          TransactionId::COMPARATOR > transactions;
+                          LocalTransactionId::COMPARATOR > transactions;
         ConcurrentStlMap< Pointer<SessionId>,
                           Pointer<SessionState>,
                           SessionId::COMPARATOR > sessions;
@@ -102,11 +103,12 @@ namespace state {
 
         void addTransactionState( const Pointer<TransactionId>& id ) {
             checkShutdown();
-            transactions.put( id, Pointer<TransactionState>( new TransactionState(
id ) ) );
+            transactions.put( id.dynamicCast<LocalTransactionId>(),
+                              Pointer<TransactionState>( new TransactionState( id )
) );
         }
 
         const Pointer<TransactionState>& getTransactionState( const Pointer<TransactionId>&
id ) const {
-            return transactions.get( id );
+            return transactions.get( id.dynamicCast<LocalTransactionId>() );
         }
 
         std::vector< Pointer<TransactionState> > getTransactionStates() const
{
@@ -114,7 +116,7 @@ namespace state {
         }
 
         Pointer<TransactionState> removeTransactionState( const Pointer<TransactionId>&
id ) {
-            return transactions.remove( id );
+            return transactions.remove( id.dynamicCast<LocalTransactionId>() );
         }
 
         void addSession( const Pointer<SessionInfo>& info ) {



Mime
View raw message