activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r503438 [3/3] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/connector/openwire/commands/ main/activemq/connector/openwire/marshal/v2/ main/activemq/connector/stomp/commands/ main/activemq/transport/ test/activemq/connect...
Date Sun, 04 Feb 2007 16:37:52 GMT
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/WireFormatInfoMarshaller.cpp?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/WireFormatInfoMarshaller.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/WireFormatInfoMarshaller.cpp
Sun Feb  4 08:37:46 2007
@@ -70,7 +70,7 @@
     info->beforeMarshal( wireFormat );
     int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
     bs->writeBoolean( info->getMarshalledProperties().size() != 0 );
-    rc += (int)(info->getMarshalledProperties().size() == 0 ? 0 : info->getMarshalledProperties().size()
+ 4);
+    rc += info->getMarshalledProperties().size() == 0 ? 0 : info->getMarshalledProperties().size()
+ 4;
 
     return rc + 12;
 }
@@ -82,11 +82,11 @@
 
     WireFormatInfo* info =
         dynamic_cast<WireFormatInfo*>( dataStructure );
-    dataOut->write( &info->getMagic()[0], 8 );
+    dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8 );
     dataOut->write( info->getVersion() );
     if( bs->readBoolean() ) {
         dataOut->write( (int)info->getMarshalledProperties().size() );
-        dataOut->write( &info->getMarshalledProperties()[0], info->getMarshalledProperties().size()
);
+        dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]),
(int)info->getMarshalledProperties().size() );
     }
     info->afterMarshal( wireFormat );
 }
@@ -95,7 +95,7 @@
 void WireFormatInfoMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure*
dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
     BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    WireFormatInfo* info = 
+    WireFormatInfo* info =
         dynamic_cast<WireFormatInfo*>( dataStructure );
     info->beforeUnmarshal( wireFormat );
     info->setMagic( looseUnmarshalConstByteArray( dataIn, 8 ) );
@@ -112,12 +112,12 @@
     info->beforeMarshal( wireFormat );
     BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-    dataOut->write( &info->getMagic()[0], 8 );
+    dataOut->write( (const unsigned char*)(&info->getMagic()[0]), (int)8 );
     dataOut->write( info->getVersion() );
     dataOut->write( info->getMarshalledProperties().size() != 0 );
     if( info->getMarshalledProperties().size() != 0 ) {
         dataOut->write( (int)info->getMarshalledProperties().size() );
-        dataOut->write( &info->getMarshalledProperties()[0], info->getMarshalledProperties().size()
);
+        dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]),
(int)info->getMarshalledProperties().size() );
     }
     info->afterMarshal( wireFormat );
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/XATransactionIdMarshaller.cpp?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/XATransactionIdMarshaller.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/XATransactionIdMarshaller.cpp
Sun Feb  4 08:37:46 2007
@@ -65,9 +65,9 @@
 
     int rc = TransactionIdMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
     bs->writeBoolean( info->getGlobalTransactionId().size() != 0 );
-    rc += (int)(info->getGlobalTransactionId().size() == 0 ? 0 : info->getGlobalTransactionId().size()
+ 4);
+    rc += info->getGlobalTransactionId().size() == 0 ? 0 : info->getGlobalTransactionId().size()
+ 4;
     bs->writeBoolean( info->getBranchQualifier().size() != 0 );
-    rc += (int)(info->getBranchQualifier().size() == 0 ? 0 : info->getBranchQualifier().size()
+ 4);
+    rc += info->getBranchQualifier().size() == 0 ? 0 : info->getBranchQualifier().size()
+ 4;
 
     return rc + 4;
 }
@@ -82,11 +82,11 @@
     dataOut->write( info->getFormatId() );
     if( bs->readBoolean() ) {
         dataOut->write( (int)info->getGlobalTransactionId().size() );
-        dataOut->write( &info->getGlobalTransactionId()[0], info->getGlobalTransactionId().size()
);
+        dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]),
(int)info->getGlobalTransactionId().size() );
     }
     if( bs->readBoolean() ) {
         dataOut->write( (int)info->getBranchQualifier().size() );
-        dataOut->write( &info->getBranchQualifier()[0], info->getBranchQualifier().size()
);
+        dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]),
(int)info->getBranchQualifier().size() );
     }
 }
 
@@ -94,7 +94,7 @@
 void XATransactionIdMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure*
dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
     TransactionIdMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    XATransactionId* info = 
+    XATransactionId* info =
         dynamic_cast<XATransactionId*>( dataStructure );
     info->setFormatId( dataIn->readInt() );
     info->setGlobalTransactionId( looseUnmarshalByteArray( dataIn ) );
@@ -112,12 +112,12 @@
     dataOut->write( info->getGlobalTransactionId().size() != 0 );
     if( info->getGlobalTransactionId().size() != 0 ) {
         dataOut->write( (int)info->getGlobalTransactionId().size() );
-        dataOut->write( &info->getGlobalTransactionId()[0], info->getGlobalTransactionId().size()
);
+        dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]),
(int)info->getGlobalTransactionId().size() );
     }
     dataOut->write( info->getBranchQualifier().size() != 0 );
     if( info->getBranchQualifier().size() != 0 ) {
         dataOut->write( (int)info->getBranchQualifier().size() );
-        dataOut->write( &info->getBranchQualifier()[0], info->getBranchQualifier().size()
);
+        dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]),
(int)info->getBranchQualifier().size() );
     }
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
Sun Feb  4 08:37:46 2007
@@ -139,7 +139,7 @@
          * require it.
          * @param id Command Id
          */
-        virtual void setCommandId( const unsigned int id AMQCPP_UNUSED){
+        virtual void setCommandId( int id AMQCPP_UNUSED){
             /* do nothing */
         }
 
@@ -147,7 +147,7 @@
          * Gets the Command Id of this Message
          * @return Command Id
          */
-        virtual unsigned int getCommandId() const {
+        virtual int getCommandId() const {
             return util::Integer::parseInt(
                 getPropertyValue(
                     CommandConstants::toString( 
@@ -177,7 +177,7 @@
          * Gets the Correlation Id that is associated with this message
          * @return the Correlation Id
          */
-        virtual unsigned int getCorrelationId() const {
+        virtual int getCorrelationId() const {
             return util::Integer::parseInt(
                 getPropertyValue(
                     CommandConstants::toString( 
@@ -189,7 +189,7 @@
          * Default implementation - does nothing.
          * @param corrId Id
          */
-        virtual void setCorrelationId( const unsigned int corrId AMQCPP_UNUSED ) {
+        virtual void setCorrelationId( int corrId AMQCPP_UNUSED ) {
             /* do nothing */
         }
         

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
Sun Feb  4 08:37:46 2007
@@ -49,7 +49,7 @@
          * Sets the Correlation Id if this Command
          * @param corrId Id
          */
-        virtual void setCorrelationId( const unsigned int corrId ) {
+        virtual void setCorrelationId( int corrId ) {
             setPropertyValue(
                 CommandConstants::toString( 
                     CommandConstants::HEADER_RESPONSEID),

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
Sun Feb  4 08:37:46 2007
@@ -54,13 +54,13 @@
          * Sets the Command Id of this Message
          * @param id Command Id
          */
-        virtual void setCommandId( const unsigned int id ) = 0;
+        virtual void setCommandId( int id ) = 0;
 
         /**
          * Gets the Command Id of this Message
          * @return Command Id
          */
-        virtual unsigned int getCommandId(void) const = 0;
+        virtual int getCommandId(void) const = 0;
         
         /**
          * Set if this Message requires a Response
@@ -78,13 +78,13 @@
          * Gets the Correlation Id that is associated with this message
          * @return the Correlation Id
          */
-        virtual unsigned int getCorrelationId(void) const = 0;
+        virtual int getCorrelationId(void) const = 0;
         
         /**
          * Sets the Correlation Id if this Command
          * @param corrId Id
          */
-        virtual void setCorrelationId( const unsigned int corrId ) = 0;
+        virtual void setCorrelationId( int corrId ) = 0;
         
         /**
          * Get the Transaction Id of this Command

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Command.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Command.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Command.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Command.h Sun Feb
 4 08:37:46 2007
@@ -30,13 +30,13 @@
          * Sets the Command Id of this Message
          * @param id Command Id
          */
-        virtual void setCommandId( const unsigned int id ) = 0;
+        virtual void setCommandId( int id ) = 0;
 
         /**
          * Gets the Command Id of this Message
          * @return Command Id
          */
-        virtual unsigned int getCommandId() const = 0;
+        virtual int getCommandId() const = 0;
         
         /**
          * Set if this Message requires a Response

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Response.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Response.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Response.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Response.h Sun Feb
 4 08:37:46 2007
@@ -32,13 +32,13 @@
          * Gets the Correlation Id that is associated with this message
          * @return the Correlation Id
          */
-        virtual unsigned int getCorrelationId() const = 0;
+        virtual int getCorrelationId() const = 0;
 
         /**
          * Sets the Correlation Id if this Command
          * @param corrId
          */
-        virtual void setCorrelationId( const unsigned int corrId ) = 0;
+        virtual void setCorrelationId( int corrId ) = 0;
         
     };
     

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
Sun Feb  4 08:37:46 2007
@@ -33,5 +33,5 @@
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQBytesMessageTest::test()
 {
-    //ActiveMQBytesMessage myMessage;
+    ActiveMQBytesMessage myMessage;
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/v2/BrokerIdMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/v2/BrokerIdMarshallerTest.cpp?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/v2/BrokerIdMarshallerTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/marshal/v2/BrokerIdMarshallerTest.cpp
Sun Feb  4 08:37:46 2007
@@ -21,6 +21,7 @@
 
 #include <activemq/util/PrimitiveMap.h>
 #include <activemq/connector/openwire/marshal/v2/BrokerIdMarshaller.h>
+#include <activemq/connector/openwire/commands/BrokerId.h>
 
 using namespace std;
 using namespace activemq;
@@ -29,12 +30,16 @@
 using namespace activemq::exceptions;
 using namespace activemq::connector;
 using namespace activemq::connector::openwire;
+using namespace activemq::connector::openwire::commands;
 using namespace activemq::connector::openwire::marshal;
 using namespace activemq::connector::openwire::marshal::v2;
 
 ////////////////////////////////////////////////////////////////////////////////
 void BrokerIdMarshallerTest::test()
 {
-//    BrokerIdMarshaller myMarshaller;    
-//    unsigned char type = myMarshaller.getDataStructureType();
+    BrokerIdMarshaller myMarshaller;
+    BrokerId myCommand;    
+    unsigned char type = myMarshaller.getDataStructureType();
+    
+    CPPUNIT_ASSERT( type == myCommand.getDataStructureType() );
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h
Sun Feb  4 08:37:46 2007
@@ -55,8 +55,8 @@
             
             char c;
             
-            virtual void setCommandId( const unsigned int id AMQCPP_UNUSED){}
-            virtual unsigned int getCommandId() const{ return 0; }
+            virtual void setCommandId( int id AMQCPP_UNUSED){}
+            virtual int getCommandId() const{ return 0; }
             
             virtual void setResponseRequired( const bool required AMQCPP_UNUSED){}
             virtual bool isResponseRequired() const{ return false; }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.h?view=diff&rev=503438&r1=503437&r2=503438
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.h
Sun Feb  4 08:37:46 2007
@@ -52,10 +52,10 @@
             
         public:
         
-            virtual void setCommandId( const unsigned int id ){
+            virtual void setCommandId( int id ){
                 commandId = id;
             }
-            virtual unsigned int getCommandId() const{
+            virtual int getCommandId() const{
                 return commandId;
             }
             
@@ -76,10 +76,10 @@
             
         public:
         
-            virtual void setCommandId( const unsigned int id ){
+            virtual void setCommandId( int id ){
                 commandId = id;
             }
-            virtual unsigned int getCommandId() const{
+            virtual int getCommandId() const{
                 return commandId;
             }
             
@@ -90,10 +90,10 @@
                 return responseRequired;
             }
         
-            virtual unsigned int getCorrelationId() const{
+            virtual int getCorrelationId() const{
                 return corrId;
             }
-            virtual void setCorrelationId( const unsigned int corrId ){
+            virtual void setCorrelationId( int corrId ){
                 this->corrId = corrId;
             }
         };
@@ -108,10 +108,10 @@
             
         public:
         
-            virtual void setCommandId( const unsigned int id ){
+            virtual void setCommandId( int id ){
                 commandId = id;
             }
-            virtual unsigned int getCommandId() const{
+            virtual int getCommandId() const{
                 return commandId;
             }
             
@@ -122,10 +122,10 @@
                 return responseRequired;
             }
         
-            virtual unsigned int getCorrelationId() const{
+            virtual int getCorrelationId() const{
                 return corrId;
             }
-            virtual void setCorrelationId( const unsigned int corrId ){
+            virtual void setCorrelationId( int corrId ){
                 this->corrId = corrId;
             }
             virtual const BrokerError* getException() const{



Mime
View raw message