activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r504754 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire: DataStreamMarshaller.h OpenWireFormat.cpp marshal/BaseDataStreamMarshaller.h marshal/DataStreamMarshaller.h
Date Thu, 08 Feb 2007 00:22:29 GMT
Author: tabish
Date: Wed Feb  7 16:22:29 2007
New Revision: 504754

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

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/DataStreamMarshaller.h
      - copied unchanged from r504738, activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/DataStreamMarshaller.h
Removed:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/DataStreamMarshaller.h
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp?view=diff&rev=504754&r1=504753&r2=504754
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp Wed Feb  7 16:22:29 2007
@@ -27,7 +27,7 @@
 #include <activemq/connector/openwire/commands/WireFormatInfo.h>
 #include <activemq/connector/openwire/commands/DataStructure.h>
 #include <activemq/connector/openwire/marshal/MarshalAware.h>
-#include <activemq/connector/openwire/DataStreamMarshaller.h>
+#include <activemq/connector/openwire/marshal/DataStreamMarshaller.h>
 #include <activemq/connector/openwire/marshal/v2/MarshallerFactory.h>
 
 using namespace std;
@@ -52,7 +52,7 @@
 
     // init
     this->preferedWireFormatInfo = NULL;
-    
+
     // Copy config data
     this->properties.copy( &properties );
 
@@ -64,20 +64,20 @@
     this->id = Guid::createGUIDString();
 
     // parse params out of the properties
-    stackTraceEnabled = Boolean::parseBoolean( 
-        properties.getProperty( "wireFormat.stackTraceEnabled", 
+    stackTraceEnabled = Boolean::parseBoolean(
+        properties.getProperty( "wireFormat.stackTraceEnabled",
                                 "1" ) );
     cacheEnabled = Boolean::parseBoolean(
-        properties.getProperty( "wireFormat.cacheEnabled", 
+        properties.getProperty( "wireFormat.cacheEnabled",
                                 "1" ) );
-    tcpNoDelayEnabled = Boolean::parseBoolean( 
-        properties.getProperty( "wireFormat.tcpNoDelayEnabled", 
+    tcpNoDelayEnabled = Boolean::parseBoolean(
+        properties.getProperty( "wireFormat.tcpNoDelayEnabled",
                                 "1" ) );
-    tightEncodingEnabled = Boolean::parseBoolean( 
-        properties.getProperty( "wireFormat.tightEncodingEnabled", 
+    tightEncodingEnabled = Boolean::parseBoolean(
+        properties.getProperty( "wireFormat.tightEncodingEnabled",
                                 "1" ) );
-    sizePrefixDisabled = Boolean::parseBoolean( 
-        properties.getProperty( "wireFormat.sizePrefixDisabled", 
+    sizePrefixDisabled = Boolean::parseBoolean(
+        properties.getProperty( "wireFormat.sizePrefixDisabled",
                                 "0" ) );
 }
 
@@ -85,12 +85,12 @@
 OpenWireFormat::~OpenWireFormat()
 {
     try {
-        
+
         for( size_t i = 0; i < dataMarshallers.size(); ++i )
         {
             delete dataMarshallers[i];
         }
-        
+
         delete preferedWireFormatInfo;
     }
     AMQ_CATCH_NOTHROW( ActiveMQException )
@@ -105,9 +105,9 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::setPreferedWireFormatInfo( 
+void OpenWireFormat::setPreferedWireFormatInfo(
     commands::WireFormatInfo* info ) throw ( IllegalStateException ) {
-    
+
     this->preferedWireFormatInfo = info;
 
     try {
@@ -125,64 +125,64 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::marshal( transport::Command* command, 
-                              io::DataOutputStream* dataOut ) 
+void OpenWireFormat::marshal( transport::Command* command,
+                              io::DataOutputStream* dataOut )
     throw ( io::IOException ) {
 
     try {
 
         int size = 1;
-        
+
         if( command != NULL ) {
-            
-            DataStructure* dataStructure = 
+
+            DataStructure* dataStructure =
                 dynamic_cast< DataStructure* >( command );
-            
+
             unsigned char type = dataStructure->getDataStructureType();
-            
+
             DataStreamMarshaller* dsm = dataMarshallers[type & 0xFF];
-            
+
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( type ) ).c_str() );
             }
-    
+
             if( tightEncodingEnabled ) {
                 BooleanStream* bs = new BooleanStream();
                 size += dsm->tightMarshal1( this, dataStructure, bs );
-                size += bs->marshalledSize(); 
-    
+                size += bs->marshalledSize();
+
                 if( !sizePrefixDisabled ) {
                     dataOut->writeInt( size );
                 }
-    
+
                 dataOut->writeByte( type );
                 bs->marshal( dataOut );
                 dsm->tightMarshal2( this, dataStructure, dataOut, bs );
-    
-            } else {                
+
+            } else {
                 DataOutputStream* looseOut = dataOut;
                 ByteArrayOutputStream* baos = NULL;
-                
+
                 if( !sizePrefixDisabled ) {
                     baos = new ByteArrayOutputStream();
                     looseOut = new DataOutputStream( baos );
                 }
-                
+
                 looseOut->writeByte( type );
                 dsm->looseMarshal( this, dataStructure, looseOut );
-                
+
                 if( !sizePrefixDisabled ) {
                     looseOut->close();
                     dataOut->writeInt( (int)baos->getByteArraySize() );
-                    dataOut->write( baos->getByteArray(), 
+                    dataOut->write( baos->getByteArray(),
                                     baos->getByteArraySize() );
-                                    
+
                     // Delete allocated resource
                     delete baos;
-                    delete looseOut; 
+                    delete looseOut;
                 }
             }
         } else {
@@ -196,40 +196,40 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-transport::Command* OpenWireFormat::unmarshal( io::DataInputStream* dis ) 
+transport::Command* OpenWireFormat::unmarshal( io::DataInputStream* dis )
     throw ( io::IOException ) {
 
     try{
-        
+
         if( !sizePrefixDisabled ) {
             dis->readInt();
         }
-        
+
         // Get the unmarshalled DataStructure
         DataStructure* data = doUnmarshal( dis );
-        
+
         if( data == NULL ) {
             throw IOException(
                 __FILE__, __LINE__,
                 "OpenWireFormat::doUnmarshal - "
                 "Failed to unmarshal an Object" );
         }
-            
+
         // Now all unmarshals from this level should result in an object
         // that is a transport::Command type, if its not then we throw an
         // exception.
-        transport::Command* command = 
+        transport::Command* command =
             dynamic_cast< transport::Command* >( data );
-    
+
         if( command == NULL ) {
             delete data;
-    
+
             throw IOException(
                 __FILE__, __LINE__,
                 "OpenWireFormat::doUnmarshal - "
                 "Unmarshalled a non Command Type" );
         }
-    
+
         return command;
     }
     AMQ_CATCH_RETHROW( IOException )
@@ -238,30 +238,30 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::DataStructure* OpenWireFormat::doUnmarshal( DataInputStream* dis ) 
+commands::DataStructure* OpenWireFormat::doUnmarshal( DataInputStream* dis )
     throw ( IOException ) {
 
     try {
-        
+
         unsigned char dataType = dis->readByte();
-    
+
         if( dataType != NULL_TYPE ) {
-            
-            DataStreamMarshaller* dsm = 
-                dynamic_cast< DataStreamMarshaller* >( 
+
+            DataStreamMarshaller* dsm =
+                dynamic_cast< DataStreamMarshaller* >(
                     dataMarshallers[dataType & 0xFF] );
-                    
+
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( dataType ) ).c_str() );
             }
-    
-            // Ask the DataStreamMarshaller to create a new instance of its 
+
+            // Ask the DataStreamMarshaller to create a new instance of its
             // command so that we can fill in its data.
             DataStructure* data = dsm->createObject();
-            
+
             if( this->tightEncodingEnabled ) {
                 BooleanStream bs;
                 bs.unmarshal( dis );
@@ -269,10 +269,10 @@
             } else {
                 dsm->looseUnmarshal( this, data, dis );
             }
-            
+
             return data;
         }
-    
+
         return NULL;
     }
     AMQ_CATCH_RETHROW( IOException )
@@ -281,41 +281,41 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int OpenWireFormat::tightMarshalNestedObject1( commands::DataStructure* object, 
+int OpenWireFormat::tightMarshalNestedObject1( commands::DataStructure* object,
                                                utils::BooleanStream* bs )
     throw ( io::IOException ) {
 
     try {
-    
+
         bs->writeBoolean( object != NULL );
         if( object == NULL ) {
             return 0;
         }
-            
+
         if( object->isMarshalAware() ) {
-            
-            std::vector<unsigned char> sequence = 
+
+            std::vector<unsigned char> sequence =
                 object->getMarshaledForm(this);
             bs->writeBoolean( !sequence.empty() );
             if( !sequence.empty() ) {
                 return (int)(1 + sequence.size());
             }
         }
-        
+
         unsigned char type = object->getDataStructureType();
         if( type == 0 ) {
             throw IOException(
                 __FILE__, __LINE__,
                 "No valid data structure type for object of this type");
         }
-        
-        DataStreamMarshaller* dsm = 
+
+        DataStreamMarshaller* dsm =
             dynamic_cast< DataStreamMarshaller* >( dataMarshallers[type & 0xFF] );
-        
+
         if( dsm == NULL ) {
             throw IOException(
                 __FILE__, __LINE__,
-                ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                 Integer::toString( type ) ).c_str() );
         }
 
@@ -327,41 +327,41 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::tightMarshalNestedObject2( DataStructure* o, 
-                                                DataOutputStream* ds, 
-                                                BooleanStream* bs ) 
+void OpenWireFormat::tightMarshalNestedObject2( DataStructure* o,
+                                                DataOutputStream* ds,
+                                                BooleanStream* bs )
                                                     throw ( IOException ) {
 
     try {
-        
+
         if( !bs->readBoolean() ) {
             return;
         }
-            
+
         unsigned char type = o->getDataStructureType();
-        
+
         ds->writeByte(type);
-    
+
         if( o->isMarshalAware() && bs->readBoolean() ) {
-    
+
             MarshalAware* ma = dynamic_cast< MarshalAware* >( o );
             vector<unsigned char> sequence = ma->getMarshaledForm( this );
             ds->write( &sequence[0], sequence.size() );
-            
+
         } else {
-            
-            DataStreamMarshaller* dsm = 
+
+            DataStreamMarshaller* dsm =
                 dynamic_cast< DataStreamMarshaller* >( dataMarshallers[type & 0xFF] );
-            
+
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( type ) ).c_str() );
             }
-            
+
             dsm->tightMarshal2( this, o, ds, bs );
-            
+
         }
     }
     AMQ_CATCH_RETHROW( IOException )
@@ -370,42 +370,42 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-DataStructure* OpenWireFormat::tightUnmarshalNestedObject( DataInputStream* dis, 
-                                                           BooleanStream* bs) 
+DataStructure* OpenWireFormat::tightUnmarshalNestedObject( DataInputStream* dis,
+                                                           BooleanStream* bs)
     throw ( io::IOException ) {
 
     try {
-        
+
         if( bs->readBoolean() ) {
-            
+
             const unsigned char dataType = dis->readByte();
-            
-            DataStreamMarshaller* dsm = 
-                dynamic_cast< DataStreamMarshaller* >( 
+
+            DataStreamMarshaller* dsm =
+                dynamic_cast< DataStreamMarshaller* >(
                     dataMarshallers[dataType & 0xFF] );
-                    
+
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( dataType ) ).c_str() );
             }
-    
+
             DataStructure* data = dsm->createObject();
-    
+
             if( data->isMarshalAware() && bs->readBoolean() ) {
-                
+
                 dis->readInt();
                 dis->readByte();
-                
+
                 BooleanStream bs2;
                 bs2.unmarshal( dis );
                 dsm->tightUnmarshal( this, data, dis, &bs2 );
-    
+
             } else {
                 dsm->tightUnmarshal( this, data, dis, bs );
             }
-            
+
             return data;
         } else {
             return NULL;
@@ -418,31 +418,31 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-DataStructure* OpenWireFormat::looseUnmarshalNestedObject( io::DataInputStream* dis ) 
+DataStructure* OpenWireFormat::looseUnmarshalNestedObject( io::DataInputStream* dis )
     throw ( IOException ) {
 
     try{
-        
+
         if( dis->readBoolean() ) {
-            
+
             unsigned char dataType = dis->readByte();
-            
-            DataStreamMarshaller* dsm = 
-                dynamic_cast< DataStreamMarshaller* >( 
+
+            DataStreamMarshaller* dsm =
+                dynamic_cast< DataStreamMarshaller* >(
                     dataMarshallers[dataType & 0xFF] );
-                    
+
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( dataType ) ).c_str() );
             }
-            
+
             DataStructure* data = dsm->createObject();
             dsm->looseUnmarshal( this, data, dis );
 
             return data;
-                        
+
         } else {
             return NULL;
         }
@@ -453,30 +453,30 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::looseMarshalNestedObject( commands::DataStructure* o, 
-                                               io::DataOutputStream* dataOut ) 
+void OpenWireFormat::looseMarshalNestedObject( commands::DataStructure* o,
+                                               io::DataOutputStream* dataOut )
     throw ( io::IOException ) {
-        
+
     try{
 
         dataOut->writeBoolean( o != NULL );
         if( o != NULL ) {
-            
+
             unsigned char dataType = o->getDataStructureType();
-            
+
             dataOut->writeByte( dataType );
-            
-            DataStreamMarshaller* dsm = 
-                dynamic_cast< DataStreamMarshaller* >( 
+
+            DataStreamMarshaller* dsm =
+                dynamic_cast< DataStreamMarshaller* >(
                     dataMarshallers[dataType & 0xFF] );
 
             if( dsm == NULL ) {
                 throw IOException(
                     __FILE__, __LINE__,
-                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) + 
+                    ( string( "OpenWireFormat::marshal - Unknown data type: " ) +
                     Integer::toString( dataType ) ).c_str() );
             }
-            
+
             dsm->looseMarshal( this, o, dataOut );
         }
     }
@@ -486,9 +486,9 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::renegotiateWireFormat( WireFormatInfo* info ) 
+void OpenWireFormat::renegotiateWireFormat( WireFormatInfo* info )
     throw ( exceptions::IllegalStateException ) {
-    
+
     if( preferedWireFormatInfo == NULL ) {
         throw IllegalStateException(
             __FILE__, __LINE__,
@@ -496,17 +496,17 @@
             "Wireformat cannot not be renegotiated." );
     }
 
-    this->setVersion( Math::min( preferedWireFormatInfo->getVersion(), 
+    this->setVersion( Math::min( preferedWireFormatInfo->getVersion(),
                                  info->getVersion() ) );
-    this->stackTraceEnabled = info->isStackTraceEnabled() && 
+    this->stackTraceEnabled = info->isStackTraceEnabled() &&
                               preferedWireFormatInfo->isStackTraceEnabled();
-    this->tcpNoDelayEnabled = info->isTcpNoDelayEnabled() && 
+    this->tcpNoDelayEnabled = info->isTcpNoDelayEnabled() &&
                               preferedWireFormatInfo->isTcpNoDelayEnabled();
-    this->cacheEnabled = info->isCacheEnabled() && 
+    this->cacheEnabled = info->isCacheEnabled() &&
                          preferedWireFormatInfo->isCacheEnabled();
-    this->tightEncodingEnabled = info->isTightEncodingEnabled() && 
+    this->tightEncodingEnabled = info->isTightEncodingEnabled() &&
                                  preferedWireFormatInfo->isTightEncodingEnabled();
-    this->sizePrefixDisabled = info->isSizePrefixDisabled() && 
+    this->sizePrefixDisabled = info->isSizePrefixDisabled() &&
                                preferedWireFormatInfo->isSizePrefixDisabled();
-    
+
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h?view=diff&rev=504754&r1=504753&r2=504754
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h Wed Feb  7 16:22:29 2007
@@ -18,7 +18,7 @@
 #ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_MARSHAL_BASEDATASTREAMMARSHALLER_H_
 #define _ACTIVEMQ_CONNECTOR_OPENWIRE_MARSHAL_BASEDATASTREAMMARSHALLER_H_
 
-#include <activemq/connector/openwire/DataStreamMarshaller.h>
+#include <activemq/connector/openwire/marshal/DataStreamMarshaller.h>
 #include <activemq/connector/openwire/commands/MessageId.h>
 #include <activemq/connector/openwire/commands/ProducerId.h>
 #include <activemq/connector/openwire/commands/TransactionId.h>
@@ -32,81 +32,81 @@
 
     /**
      * Base class for all Marshallers that marshal DataStructures to and
-     * from the wire using the OpenWire protocal.  
+     * from the wire using the OpenWire protocal.
      */
     class BaseDataStreamMarshaller : public DataStreamMarshaller
     {
     private:
-    
+
         // Table for converting bytes to Hex Strings.
         static utils::HexTable hexTable;
-    
+
     public:
-    
-    	virtual ~BaseDataStreamMarshaller() {}
+
+        virtual ~BaseDataStreamMarshaller() {}
 
         /**
          * Tight Marhsal to the given stream
-         * @param format - The OpenwireFormat properties 
+         * @param format - The OpenwireFormat properties
          * @param command -  the object to Marshal
          * @param bs - boolean stream to marshal to.
          * @throws IOException if an error occurs.
          */
-        virtual int tightMarshal1( OpenWireFormat* format AMQCPP_UNUSED, 
-                                   commands::DataStructure* command AMQCPP_UNUSED, 
-                                   utils::BooleanStream* bs AMQCPP_UNUSED ) 
+        virtual int tightMarshal1( OpenWireFormat* format AMQCPP_UNUSED,
+                                   commands::DataStructure* command AMQCPP_UNUSED,
+                                   utils::BooleanStream* bs AMQCPP_UNUSED )
                                        throw ( io::IOException ) { return 0; }
 
         /**
          * Tight Marhsal to the given stream
-         * @param format - The OpenwireFormat properties 
+         * @param format - The OpenwireFormat properties
          * @param command -  the object to Marshal
          * @param ds - the DataOutputStream to Marshal to
          * @param bs - boolean stream to marshal to.
          * @throws IOException if an error occurs.
          */
-        virtual void tightMarshal2( OpenWireFormat* format AMQCPP_UNUSED, 
-                                    commands::DataStructure* command AMQCPP_UNUSED, 
-                                    io::DataOutputStream* ds AMQCPP_UNUSED, 
-                                    utils::BooleanStream* bs AMQCPP_UNUSED ) 
+        virtual void tightMarshal2( OpenWireFormat* format AMQCPP_UNUSED,
+                                    commands::DataStructure* command AMQCPP_UNUSED,
+                                    io::DataOutputStream* ds AMQCPP_UNUSED,
+                                    utils::BooleanStream* bs AMQCPP_UNUSED )
                                         throw ( io::IOException ) {}
 
         /**
          * Tight Un-marhsal to the given stream
-         * @param format - The OpenwireFormat properties 
+         * @param format - The OpenwireFormat properties
          * @param command -  the object to Un-Marshal
          * @param dis - the DataInputStream to Un-Marshal from
          * @param bs - boolean stream to unmarshal from.
          * @throws IOException if an error occurs.
          */
-        virtual void tightUnmarshal( OpenWireFormat* format AMQCPP_UNUSED, 
-                                     commands::DataStructure* command AMQCPP_UNUSED, 
-                                     io::DataInputStream* dis AMQCPP_UNUSED, 
-                                     utils::BooleanStream* bs AMQCPP_UNUSED ) 
+        virtual void tightUnmarshal( OpenWireFormat* format AMQCPP_UNUSED,
+                                     commands::DataStructure* command AMQCPP_UNUSED,
+                                     io::DataInputStream* dis AMQCPP_UNUSED,
+                                     utils::BooleanStream* bs AMQCPP_UNUSED )
                                         throw ( io::IOException ) {}
-    
+
         /**
          * Tight Marhsal to the given stream
-         * @param format - The OpenwireFormat properties 
+         * @param format - The OpenwireFormat properties
          * @param command -  the object to Marshal
          * @param ds - DataOutputStream to marshal to
          * @throws IOException if an error occurs.
          */
-        virtual void looseMarshal( OpenWireFormat* format AMQCPP_UNUSED, 
-                                   commands::DataStructure* command AMQCPP_UNUSED, 
-                                   io::DataOutputStream* ds AMQCPP_UNUSED ) 
+        virtual void looseMarshal( OpenWireFormat* format AMQCPP_UNUSED,
+                                   commands::DataStructure* command AMQCPP_UNUSED,
+                                   io::DataOutputStream* ds AMQCPP_UNUSED )
                                        throw ( io::IOException ) {}
 
         /**
          * Loose Un-marhsal to the given stream
-         * @param format - The OpenwireFormat properties 
+         * @param format - The OpenwireFormat properties
          * @param command -  the object to Un-Marshal
          * @param dis - the DataInputStream to Un-Marshal from
          * @throws IOException if an error occurs.
          */
-        virtual void looseUnmarshal( OpenWireFormat* format AMQCPP_UNUSED, 
-                                     commands::DataStructure* command AMQCPP_UNUSED, 
-                                     io::DataInputStream* dis AMQCPP_UNUSED ) 
+        virtual void looseUnmarshal( OpenWireFormat* format AMQCPP_UNUSED,
+                                     commands::DataStructure* command AMQCPP_UNUSED,
+                                     io::DataInputStream* dis AMQCPP_UNUSED )
                                         throw ( io::IOException ) {}
 
     public:      // Statics
@@ -133,26 +133,26 @@
         static std::string toString( const commands::TransactionId* txnId );
 
         /**
-         * given an array of bytes, convert that array to a Hexidecimal 
+         * given an array of bytes, convert that array to a Hexidecimal
          * coded string that represents that data.
          * @param data - unsigned char data array pointer
          * @returns a string coded in hex that represents the data
          */
-        static std::string toHexFromBytes( 
+        static std::string toHexFromBytes(
             const std::vector<unsigned char>& data );
 
     protected:
 
         /**
          * Tight Unmarshall the cached object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @param bs - boolean stream to marshal to.
          * @returns pointer to a new DataStructure Object
          * @throws IOException if an error occurs.
          */
         virtual commands::DataStructure* tightUnmarshalCachedObject(
-            OpenWireFormat* wireFormat, 
+            OpenWireFormat* wireFormat,
             io::DataInputStream* dataIn,
             utils::BooleanStream* bs ) throw ( io::IOException );
 
@@ -160,88 +160,88 @@
          * Tightly marshalls the passed DataStructure based object to the passed
          * BooleanStream returning the size of the data marshalled
          * @param wireFormat - The OpenwireFormat properties
-         * @param data - DataStructure Object Pointer to marshal 
+         * @param data - DataStructure Object Pointer to marshal
          * @param bs - boolean stream to marshal to.
          * @returns size of data written.
          * @throws IOException if an error occurs.
          */
-        virtual int tightMarshalCachedObject1( OpenWireFormat* wireFormat, 
-                                               commands::DataStructure* data, 
-                                               utils::BooleanStream* bs ) 
+        virtual int tightMarshalCachedObject1( OpenWireFormat* wireFormat,
+                                               commands::DataStructure* data,
+                                               utils::BooleanStream* bs )
                                                     throw ( io::IOException );
 
         /**
          * Tightly marshalls the passed DataStructure based object to the passed
          * streams returning nothing
          * @param wireFormat - The OpenwireFormat properties
-         * @param data - DataStructure Object Pointer to marshal 
+         * @param data - DataStructure Object Pointer to marshal
          * @param bs - boolean stream to marshal to.
          * @param dataOut - stream to write marshalled data to
          * @throws IOException if an error occurs.
          */
-        virtual void tightMarshalCachedObject2( OpenWireFormat* wireFormat, 
-                                                commands::DataStructure* data, 
-                                                io::DataOutputStream* dataOut, 
-                                                utils::BooleanStream* bs ) 
+        virtual void tightMarshalCachedObject2( OpenWireFormat* wireFormat,
+                                                commands::DataStructure* data,
+                                                io::DataOutputStream* dataOut,
+                                                utils::BooleanStream* bs )
                                                     throw ( io::IOException );
 
         /**
          * Loosely marshalls the passed DataStructure based object to the passed
          * stream returning nothing
          * @param wireFormat - The OpenwireFormat properties
-         * @param data - DataStructure Object Pointer to marshal 
+         * @param data - DataStructure Object Pointer to marshal
          * @param bs - boolean stream to marshal to.
          * @param dataOut - stream to write marshalled data to
          * @throws IOException if an error occurs.
          */
-        virtual void looseMarshalCachedObject( OpenWireFormat* wireFormat, 
-                                               commands::DataStructure* data, 
-                                               io::DataOutputStream* dataOut ) 
+        virtual void looseMarshalCachedObject( OpenWireFormat* wireFormat,
+                                               commands::DataStructure* data,
+                                               io::DataOutputStream* dataOut )
                                                     throw ( io::IOException );
-        
+
         /**
          * Loose Unmarshall the cached object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @returns pointer to a new DataStructure Object
          * @throws IOException if an error occurs.
          */
-        virtual commands::DataStructure* looseUnmarshalCachedObject( 
-            OpenWireFormat* wireFormat, 
+        virtual commands::DataStructure* looseUnmarshalCachedObject(
+            OpenWireFormat* wireFormat,
             io::DataInputStream* dataIn ) throw ( io::IOException );
 
         /**
          * Tightly marshalls the passed DataStructure based object to the passed
          * BooleanStream returning the size of the data marshalled
          * @param wireFormat - The OpenwireFormat properties
-         * @param object - DataStructure Object Pointer to marshal 
+         * @param object - DataStructure Object Pointer to marshal
          * @param bs - boolean stream to marshal to.
          * @returns size of data written.
          * @throws IOException if an error occurs.
          */
-        virtual int tightMarshalNestedObject1( OpenWireFormat* wireFormat, 
-                                               commands::DataStructure* object, 
-                                               utils::BooleanStream* bs ) 
+        virtual int tightMarshalNestedObject1( OpenWireFormat* wireFormat,
+                                               commands::DataStructure* object,
+                                               utils::BooleanStream* bs )
                                                     throw ( io::IOException );
 
         /**
          * Tightly marshalls the passed DataStructure based object to the passed
          * streams returning nothing
          * @param wireFormat - The OpenwireFormat properties
-         * @param object - DataStructure Object Pointer to marshal 
+         * @param object - DataStructure Object Pointer to marshal
          * @param bs - boolean stream to marshal to.
          * @param dataOut - stream to write marshalled data to
          * @throws IOException if an error occurs.
          */
-        virtual void tightMarshalNestedObject2( OpenWireFormat* wireFormat, 
-                                                commands::DataStructure* object, 
-                                                io::DataOutputStream* dataOut, 
-                                                utils::BooleanStream* bs ) 
+        virtual void tightMarshalNestedObject2( OpenWireFormat* wireFormat,
+                                                commands::DataStructure* object,
+                                                io::DataOutputStream* dataOut,
+                                                utils::BooleanStream* bs )
                                                     throw ( io::IOException );
 
         /**
          * Tight Unmarshall the nested object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @param bs - boolean stream to marshal to.
          * @returns pointer to a new DataStructure Object
@@ -254,25 +254,25 @@
 
         /**
          * Loose Unmarshall the nested object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @returns pointer to a new DataStructure Object
          * @throws IOException if an error occurs.
          */
-        virtual commands::DataStructure* looseUnmarshalNestedObject( 
+        virtual commands::DataStructure* looseUnmarshalNestedObject(
             OpenWireFormat* wireFormat,
             io::DataInputStream* dataIn ) throw ( io::IOException );
 
         /**
          * Loose marshall the nested object
-         * @param wireFormat - The OpenwireFormat properties 
-         * @param object - DataStructure Object Pointer to marshal 
+         * @param wireFormat - The OpenwireFormat properties
+         * @param object - DataStructure Object Pointer to marshal
          * @param dataOut - stream to write marshalled data to
          * @throws IOException if an error occurs.
          */
-        virtual void looseMarshalNestedObject( OpenWireFormat* wireFormat, 
-                                               commands::DataStructure* object, 
-                                               io::DataOutputStream* dataOut ) 
+        virtual void looseMarshalNestedObject( OpenWireFormat* wireFormat,
+                                               commands::DataStructure* object,
+                                               io::DataOutputStream* dataOut )
                                                     throw ( io::IOException );
 
         /**
@@ -282,8 +282,8 @@
          * @returns the unmarshalled string.
          * @throws IOException if an error occurs.
          */
-        virtual std::string tightUnmarshalString( io::DataInputStream* dataIn, 
-                                                  utils::BooleanStream* bs ) 
+        virtual std::string tightUnmarshalString( io::DataInputStream* dataIn,
+                                                  utils::BooleanStream* bs )
                                                     throw ( io::IOException );
 
         /**
@@ -291,11 +291,11 @@
          * the marshalled size.
          * @param value - string to marshal
          * @param bs - BooleanStream to use.
-         * @returns size of marshalled string. 
+         * @returns size of marshalled string.
          * @throws IOException if an error occurs.
          */
-        virtual int tightMarshalString1( const std::string& value, 
-                                         utils::BooleanStream* bs ) 
+        virtual int tightMarshalString1( const std::string& value,
+                                         utils::BooleanStream* bs )
                                             throw ( io::IOException );
 
         /**
@@ -304,10 +304,10 @@
          * @param dataOut - the DataOutputStream to Marshal to
          * @param bs - boolean stream to marshal to.
          * @throws IOException if an error occurs.
-         */ 
-        virtual void tightMarshalString2( const std::string& value, 
-                                          io::DataOutputStream* dataOut, 
-                                          utils::BooleanStream* bs ) 
+         */
+        virtual void tightMarshalString2( const std::string& value,
+                                          io::DataOutputStream* dataOut,
+                                          utils::BooleanStream* bs )
                                                 throw ( io::IOException );
 
         /**
@@ -316,80 +316,80 @@
          * @param dataOut - stream to write marshalled form to
          * @throws IOException if an error occurs.
          */
-        virtual void looseMarshalString( const std::string value, 
-                                         io::DataOutputStream* dataOut ) 
+        virtual void looseMarshalString( const std::string value,
+                                         io::DataOutputStream* dataOut )
                                             throw ( io::IOException );
-                                         
+
         /**
          * Loose Un-Marshal the String to the DataOuputStream passed
          * @param dataIn - stream to read marshalled form from
          * @return the unmarshalled string
          * @throws IOException if an error occurs.
          */
-        virtual std::string looseUnmarshalString( io::DataInputStream* dataIn ) 
+        virtual std::string looseUnmarshalString( io::DataInputStream* dataIn )
             throw ( io::IOException );
 
         /**
          * Tightly marshal the long long to the BooleanStream passed.
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param value - long long to marshal
          * @param bs - boolean stream to marshal to.
          * @returns size of data written.
          * @throws IOException if an error occurs.
-         */ 
-        virtual int tightMarshalLong1( OpenWireFormat* wireFormat, 
+         */
+        virtual int tightMarshalLong1( OpenWireFormat* wireFormat,
                                        long long value,
-                                       utils::BooleanStream* bs ) 
+                                       utils::BooleanStream* bs )
                                             throw ( io::IOException );
 
         /**
          * Tightly marshal the long long to the Streams passed.
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param value - long long to marshal
          * @param dataOut - stream to write marshalled form to
          * @param bs - boolean stream to marshal to.
          * @throws IOException if an error occurs.
-         */ 
-        virtual void tightMarshalLong2( OpenWireFormat* wireFormat, 
-                                        long long value, 
-                                        io::DataOutputStream* dataOut, 
-                                        utils::BooleanStream* bs ) 
+         */
+        virtual void tightMarshalLong2( OpenWireFormat* wireFormat,
+                                        long long value,
+                                        io::DataOutputStream* dataOut,
+                                        utils::BooleanStream* bs )
                                             throw ( io::IOException );
 
         /**
-         * Tight marshal the long long type.  
-         * @param wireFormat - The OpenwireFormat properties 
+         * Tight marshal the long long type.
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @param bs - boolean stream to marshal to.
-         * @returns the unmarshalled long long 
+         * @returns the unmarshalled long long
          * @throws IOException if an error occurs.
          */
-        virtual long long tightUnmarshalLong( OpenWireFormat* wireFormat, 
-                                              io::DataInputStream* dataIn, 
-                                              utils::BooleanStream* bs ) 
+        virtual long long tightUnmarshalLong( OpenWireFormat* wireFormat,
+                                              io::DataInputStream* dataIn,
+                                              utils::BooleanStream* bs )
                                                 throw ( io::IOException );
-        
+
         /**
          * Tightly marshal the long long to the BooleanStream passed.
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param value - long long to marshal
          * @param dataOut - DataOutputStream to marshal to.
          * @throws IOException if an error occurs.
-         */ 
-        virtual void looseMarshalLong( OpenWireFormat* wireFormat, 
-                                       long long value, 
-                                       io::DataOutputStream* dataOut ) 
+         */
+        virtual void looseMarshalLong( OpenWireFormat* wireFormat,
+                                       long long value,
+                                       io::DataOutputStream* dataOut )
                                             throw ( io::IOException );
-        
+
         /**
-         * Loose marshal the long long type.  
-         * @param wireFormat - The OpenwireFormat properties 
+         * Loose marshal the long long type.
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
-         * @returns the unmarshalled long long 
+         * @returns the unmarshalled long long
          * @throws IOException if an error occurs.
          */
-        virtual long long looseUnmarshalLong( OpenWireFormat* wireFormat, 
-                                              io::DataInputStream* dataIn ) 
+        virtual long long looseUnmarshalLong( OpenWireFormat* wireFormat,
+                                              io::DataInputStream* dataIn )
                                                 throw ( io::IOException );
 
         /**
@@ -399,8 +399,8 @@
          * @returns the unmarshalled vector of chars.
          * @throws IOException if an error occurs.
          */
-        virtual std::vector<unsigned char> tightUnmarshalByteArray( 
-            io::DataInputStream* dataIn, 
+        virtual std::vector<unsigned char> tightUnmarshalByteArray(
+            io::DataInputStream* dataIn,
             utils::BooleanStream* bs ) throw ( io::IOException );
 
         /**
@@ -409,7 +409,7 @@
          * @returns the unmarshalled vector of chars.
          * @throws IOException if an error occurs.
          */
-        virtual std::vector<unsigned char> looseUnmarshalByteArray( 
+        virtual std::vector<unsigned char> looseUnmarshalByteArray(
             io::DataInputStream* dataIn ) throw ( io::IOException );
 
         /**
@@ -421,9 +421,9 @@
          * @returns the unmarshalled vector of chars.
          * @throws IOException if an error occurs.
          */
-        virtual std::vector<unsigned char> tightUnmarshalConstByteArray( 
-            io::DataInputStream* dataIn, 
-            utils::BooleanStream* bs, 
+        virtual std::vector<unsigned char> tightUnmarshalConstByteArray(
+            io::DataInputStream* dataIn,
+            utils::BooleanStream* bs,
             int size ) throw ( io::IOException );
 
         /**
@@ -435,73 +435,73 @@
          * @returns the unmarshalled vector of chars.
          * @throws IOException if an error occurs.
          */
-        virtual std::vector<unsigned char> looseUnmarshalConstByteArray( 
-            io::DataInputStream* dataIn, 
+        virtual std::vector<unsigned char> looseUnmarshalConstByteArray(
+            io::DataInputStream* dataIn,
             int size ) throw ( io::IOException );
-        
+
         /**
          * Tight Unarshall the Error object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @param bs - boolean stream to marshal to.
          * @returns pointer to a new DataStructure Object
          * @throws IOException if an error occurs.
          */
-        virtual commands::DataStructure* tightUnmarshalBrokerError( 
-            OpenWireFormat* wireFormat, 
-            io::DataInputStream* dataIn, 
+        virtual commands::DataStructure* tightUnmarshalBrokerError(
+            OpenWireFormat* wireFormat,
+            io::DataInputStream* dataIn,
             utils::BooleanStream* bs ) throw ( io::IOException );
-            
+
         /**
          * Tight Marshall the Error object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param data - Error to Marshal
          * @param bs - boolean stream to marshal to.
          * @returns size of the marshalled data
          * @throws IOException if an error occurs.
          */
-        virtual int tightMarshalBrokerError1( OpenWireFormat* wireFormat, 
-                                              commands::DataStructure* data, 
-                                              utils::BooleanStream* bs ) 
+        virtual int tightMarshalBrokerError1( OpenWireFormat* wireFormat,
+                                              commands::DataStructure* data,
+                                              utils::BooleanStream* bs )
                                                     throw ( io::IOException );
-                                              
+
         /**
          * Tight Marshall the Error object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param data - Error to Marshal
          * @param dataOut - stream to write marshalled data to
          * @param bs - boolean stream to marshal to.
          * @throws IOException if an error occurs.
          */
-        virtual void tightMarshalBrokerError2( OpenWireFormat* wireFormat, 
-                                               commands::DataStructure* data, 
-                                               io::DataOutputStream* dataOut, 
+        virtual void tightMarshalBrokerError2( OpenWireFormat* wireFormat,
+                                               commands::DataStructure* data,
+                                               io::DataOutputStream* dataOut,
                                                utils::BooleanStream* bs )
                                                     throw ( io::IOException );
-                                               
+
         /**
          * Loose Unarshall the Error object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param dataIn - stream to read marshalled form from
          * @returns pointer to a new DataStructure Object
          * @throws IOException if an error occurs.
          */
-        virtual commands::DataStructure* looseUnmarshalBrokerError( 
-            OpenWireFormat* wireFormat, 
+        virtual commands::DataStructure* looseUnmarshalBrokerError(
+            OpenWireFormat* wireFormat,
             io::DataInputStream* dataIn ) throw ( io::IOException );
-            
+
         /**
          * Tight Marshall the Error object
-         * @param wireFormat - The OpenwireFormat properties 
+         * @param wireFormat - The OpenwireFormat properties
          * @param data - Error to Marshal
          * @param dataOut - stream to write marshalled data to
          * @throws IOException if an error occurs.
          */
-        virtual void looseMarshalBrokerError( OpenWireFormat* wireFormat, 
-                                              commands::DataStructure* data, 
-                                              io::DataOutputStream* dataOut ) 
+        virtual void looseMarshalBrokerError( OpenWireFormat* wireFormat,
+                                              commands::DataStructure* data,
+                                              io::DataOutputStream* dataOut )
                                                   throw ( io::IOException );
-        
+
         /**
          * Tightly Marshal an array of DataStructure objects to the provided
          * boolean stream, and return the size that the tight marshalling is
@@ -511,25 +511,25 @@
          * @param bs - boolean stream to marshal to.
          * @returns size of the marshalled data
          * @throws IOException if an error occurs.
-         */ 
+         */
         template<typename T>
-        int tightMarshalObjectArray1( OpenWireFormat* wireFormat, 
-                                      std::vector<T*> objects, 
+        int tightMarshalObjectArray1( OpenWireFormat* wireFormat,
+                                      std::vector<T*> objects,
                                       utils::BooleanStream* bs )
                                         throw ( io::IOException )
         {
-            try{ 
+            try{
                 if( !objects.empty() )
                 {
                     int rc = 0;
                     bs->writeBoolean( true );
                     rc += 2;
                     for( unsigned int i = 0; i < objects.size(); ++i ) {
-                        rc += tightMarshalNestedObject1( 
+                        rc += tightMarshalNestedObject1(
                                 wireFormat, objects[i], bs );
                     }
                     return rc;
-                    
+
                 } else {
                     bs->writeBoolean( false );
                     return 0;
@@ -539,7 +539,7 @@
             AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
             AMQ_CATCHALL_THROW( io::IOException )
         }
-        
+
         /**
          * Tightly Marshal an array of DataStructure objects to the provided
          * boolean stream and data output stream
@@ -549,18 +549,18 @@
          * @param bs - boolean stream to marshal to.
          * @returns size of the marshalled data
          * @throws IOException if an error occurs.
-         */ 
+         */
         template<typename T>
-        void tightMarshalObjectArray2( OpenWireFormat* wireFormat, 
-                                       std::vector<T*> objects, 
-                                       io::DataOutputStream* dataOut, 
-                                       utils::BooleanStream* bs ) 
+        void tightMarshalObjectArray2( OpenWireFormat* wireFormat,
+                                       std::vector<T*> objects,
+                                       io::DataOutputStream* dataOut,
+                                       utils::BooleanStream* bs )
                                         throw ( io::IOException ) {
-                                            
+
             try {
 
                 if( bs->readBoolean() ) {
-                    
+
                     dataOut->writeShort( (short)objects.size() );
                     for( unsigned int i = 0; i < objects.size(); ++i ) {
                         tightMarshalNestedObject2(
@@ -581,18 +581,18 @@
          * @param dataOut - stream to write marshalled data to
          * @returns size of the marshalled data
          * @throws IOException if an error occurs.
-         */ 
+         */
         template<typename T>
-        void looseMarshalObjectArray( OpenWireFormat* wireFormat, 
-                                      std::vector<T*> objects, 
-                                      io::DataOutputStream* dataOut ) 
+        void looseMarshalObjectArray( OpenWireFormat* wireFormat,
+                                      std::vector<T*> objects,
+                                      io::DataOutputStream* dataOut )
                                         throw ( io::IOException ) {
 
             try {
 
                 dataOut->writeBoolean( !objects.empty() );
                 if( !objects.empty() ) {
-                    
+
                     dataOut->writeShort( (short)objects.size() );
                     for( unsigned int i = 0; i < objects.size(); ++i ) {
                         looseMarshalNestedObject(
@@ -604,7 +604,7 @@
             AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
             AMQ_CATCHALL_THROW( io::IOException )
         }
-                         
+
     protected:
 
         /**
@@ -615,7 +615,7 @@
          */
         virtual std::string readAsciiString( io::DataInputStream* dataIn )
             throw ( io::IOException );
-            
+
     };
 
 }}}}



Mime
View raw message