activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r926128 - /activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h
Date Mon, 22 Mar 2010 15:26:13 GMT
Author: tabish
Date: Mon Mar 22 15:26:13 2010
New Revision: 926128

URL: http://svn.apache.org/viewvc?rev=926128&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/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h?rev=926128&r1=926127&r2=926128&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/activemq/state/ConnectionState.h
Mon Mar 22 15:26:13 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>
@@ -49,9 +50,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;
@@ -96,11 +97,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
{
@@ -108,7 +110,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