activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r507189 [1/2] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/connector/openwire/commands/ main/activemq/util/ test/activemq/network/
Date Tue, 13 Feb 2007 20:07:11 GMT
Author: tabish
Date: Tue Feb 13 12:07:10 2007
New Revision: 507189

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseDataStructure.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BooleanExpression.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Properties.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/SimpleProperties.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/network/SocketFactoryTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h Tue Feb 13 12:07:10 2007
@@ -37,7 +37,7 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQBytesMessage : 
+    class ActiveMQBytesMessage :
         public ActiveMQMessageBase< cms::BytesMessage >
     {
     public:
@@ -56,7 +56,7 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQBytesMessage* message = new ActiveMQBytesMessage();
             message->copyDataStructure( this );
             return message;
@@ -70,16 +70,41 @@
         virtual void copyDataStructure( const DataStructure* src ) {
             ActiveMQMessageBase<cms::BytesMessage>::copyDataStructure( src );
         }
-        
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::BytesMessage>::toString();
+            stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::BytesMessage>::equals( value );
+        }
+
     public:   // CMS Message
-    
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */
         virtual cms::BytesMessage* clone(void) const {
-            return dynamic_cast<cms::BytesMessage*>( 
+            return dynamic_cast<cms::BytesMessage*>(
                 this->cloneDataStructure() );
         }
 
@@ -88,61 +113,61 @@
          * headers or properties.
          */
         virtual void clearBody(){
-            
+
             // Invoke base class's version.
             ActiveMQMessageBase<cms::BytesMessage>::clearBody();
-            
+
             // Set the stream in write only mode.
             readOnly = false;
-            
+
             outputStream.setBuffer( getContent() );
         }
 
     public:   // CMS BytesMessage
-    
+
         /**
-         * sets the bytes given to the message body.  
+         * sets the bytes given to the message body.
          * @param Byte Buffer to copy
          * @param Number of bytes in Buffer to copy
          * @throws CMSException
          */
-        virtual void setBodyBytes( 
-            const unsigned char* buffer, 
-            std::size_t numBytes ) 
+        virtual void setBodyBytes(
+            const unsigned char* buffer,
+            std::size_t numBytes )
                 throw( cms::CMSException );
-            
+
         /**
          * Gets the bytes that are contained in this message, user should
-         * copy this data into a user allocated buffer.  Call 
+         * copy this data into a user allocated buffer.  Call
          * <code>getBodyLength</code> to determine the number of bytes
          * to expect.
          * @return const pointer to a byte buffer
          */
         virtual const unsigned char* getBodyBytes(void) const;
-      
+
         /**
          * Returns the number of bytes contained in the body of this message.
          * @return number of bytes.
          */
         virtual std::size_t getBodyLength(void) const;
-        
+
         /**
-         * Puts the message body in read-only mode and repositions the stream 
+         * Puts the message body in read-only mode and repositions the stream
          * of bytes to the beginning.
          * @throws CMSException
          */
         virtual void reset() throw ( cms::CMSException );
-        
+
         /**
          * Reads a Boolean from the Bytes message stream
          * @returns boolean value from stream
          * @throws CMSException
          */
         virtual bool readBoolean() throw ( cms::CMSException );
-        
+
         /**
-         * Writes a boolean to the bytes message stream as a 1-byte value. 
-         * The value true is written as the value (byte)1; the value false 
+         * Writes a boolean to the bytes message stream as a 1-byte value.
+         * The value true is written as the value (byte)1; the value false
          * is written as the value (byte)0.
          * @param value - boolean to write to the stream
          * @throws CMSException
@@ -168,22 +193,22 @@
          * Reads a byte array from the bytes message stream.
          *
          * If the length of vector value is less than the number of bytes
-         * remaining to be read from the stream, the vector should be filled. A 
+         * remaining to be read from the stream, the vector should be filled. A
          * subsequent call reads the next increment, and so on.
          *
-         * If the number of bytes remaining in the stream is less than the 
-         * length of vector value, the bytes should be read into the vector. The 
+         * If the number of bytes remaining in the stream is less than the
+         * length of vector value, the bytes should be read into the vector. The
          * return value of the total number of bytes read will be less than the
-         * length of the vector, indicating that there are no more bytes left to 
+         * length of the vector, indicating that there are no more bytes left to
          * be read from the stream. The next read of the stream returns -1.
-         * 
+         *
          * @param value - buffer to place data in
-         * @returns the total number of bytes read into the buffer, or -1 if 
-         *          there is no more data because the end of the stream has 
+         * @returns the total number of bytes read into the buffer, or -1 if
+         *          there is no more data because the end of the stream has
          *          been reached
          * @throws CMSException if an error occurs.
          */
-        virtual std::size_t readBytes( std::vector<unsigned char>& value ) 
+        virtual std::size_t readBytes( std::vector<unsigned char>& value )
             throw ( cms::CMSException );
 
         /**
@@ -196,30 +221,30 @@
 
         /**
          * Reads a portion of the bytes message stream.
-         * 
-         * If the length of array value is less than the number of bytes 
-         * remaining to be read from the stream, the array should be filled. A 
+         *
+         * If the length of array value is less than the number of bytes
+         * remaining to be read from the stream, the array should be filled. A
          * subsequent call reads the next increment, and so on.
-         * 
-         * If the number of bytes remaining in the stream is less than the 
-         * length of array value, the bytes should be read into the array. The 
-         * return value of the total number of bytes read will be less than the 
-         * length of the array, indicating that there are no more bytes left to 
+         *
+         * If the number of bytes remaining in the stream is less than the
+         * length of array value, the bytes should be read into the array. The
+         * return value of the total number of bytes read will be less than the
+         * length of the array, indicating that there are no more bytes left to
          * be read from the stream. The next read of the stream returns -1.
-         * 
-         * If length is negative, or length is greater than the length of the 
-         * array value, then an IndexOutOfBoundsException is thrown. No bytes 
+         *
+         * If length is negative, or length is greater than the length of the
+         * array value, then an IndexOutOfBoundsException is thrown. No bytes
          * will be read from the stream for this exception case.
-         * 
+         *
          * @param value - the buffer into which the data is read
-         * @param length - the number of bytes to read; must be less than or 
+         * @param length - the number of bytes to read; must be less than or
          *                 equal to value.length
-         * @returns the total number of bytes read into the buffer, or -1 if 
-         *          there is no more data because the end of the stream has 
+         * @returns the total number of bytes read into the buffer, or -1 if
+         *          there is no more data because the end of the stream has
          *          been reached
          * @throws CMSException
          */
-        virtual std::size_t readBytes( unsigned char*& buffer, std::size_t length ) 
+        virtual std::size_t readBytes( unsigned char*& buffer, std::size_t length )
             throw ( cms::CMSException );
 
         /**
@@ -361,29 +386,29 @@
         virtual void writeUTF( const std::string& value ) throw ( cms::CMSException );
 
     protected:
-    
+
         /**
          * Throws an exception if not in write-only mode.
          * @throws CMSException.
          */
         void checkWriteOnly() throw (cms::CMSException){
             if( readOnly ){
-                throw exceptions::IllegalStateException( __FILE__, __LINE__, 
+                throw exceptions::IllegalStateException( __FILE__, __LINE__,
                     "message is in read-only mode and cannot be written to" );
             }
         }
-        
+
         /**
          * Throws an exception if not in read-only mode.
          * @throws CMSException
          */
         void checkReadOnly() throw (cms::CMSException){
             if( !readOnly ){
-                throw exceptions::IllegalStateException( __FILE__, __LINE__, 
+                throw exceptions::IllegalStateException( __FILE__, __LINE__,
                     "message is in write-only mode and cannot be read from" );
             }
         }
-        
+
     private:
 
         /**
@@ -392,24 +417,24 @@
          * written to.
          */
         bool readOnly;
-        
+
         /**
-         * InputStream that wraps around the command's content when in 
+         * InputStream that wraps around the command's content when in
          * read-only mode.
          */
         io::ByteArrayInputStream inputStream;
-        
+
         /**
-         * OutputStream that wraps around the command's content when in 
+         * OutputStream that wraps around the command's content when in
          * write-only mode.
          */
         io::ByteArrayOutputStream outputStream;
-        
+
         /**
          * DataInputStream wrapper around the input stream.
          */
         io::DataInputStream dataInputStream;
-        
+
         /**
          * DataOutputStream wrapper around the output stream.
          */

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h Tue Feb 13 12:07:10 2007
@@ -35,7 +35,7 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQMapMessage : 
+    class ActiveMQMapMessage :
         public ActiveMQMessageBase<cms::MapMessage>
     {
     public:
@@ -63,9 +63,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQMapMessage* message = new ActiveMQMapMessage();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -77,31 +77,56 @@
         virtual void copyDataStructure( const DataStructure* src ) {
             ActiveMQMessageBase<cms::MapMessage>::copyDataStructure( src );
         }
-        
+
         /**
          * Perform any processing needed before an marshal
          * @param wireformat - the OpenWireFormat object in use.
          */
         virtual void beforeMarshal( OpenWireFormat* wireFormat AMQCPP_UNUSED );
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMapMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::MapMessage>::toString();
+            stream << "Begin Class = ActiveMQMapMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::MapMessage>::equals( value );
+        }
+
     public:   // CMS Message
-    
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */
         virtual cms::MapMessage* clone(void) const {
-            return dynamic_cast<cms::MapMessage*>( 
+            return dynamic_cast<cms::MapMessage*>(
                 this->cloneDataStructure() );
         }
-        
+
     public:   // CMS MapMessage
-    
+
         /**
-         * Returns an Enumeration of all the names in the MapMessage 
+         * Returns an Enumeration of all the names in the MapMessage
          * object.
-         * @return STL Vector of String values, each of which is the 
+         * @return STL Vector of String values, each of which is the
          *         name of an item in the MapMessage
          * @throws CMSException
          */
@@ -113,16 +138,16 @@
          * @return boolean value indicating if the name is in the map
          */
         virtual bool itemExists( const std::string& name ) const;
-        
+
         /**
          * Returns the Boolean value of the Specified name
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual bool getBoolean( const std::string& name ) const 
+        virtual bool getBoolean( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a boolean value with the specified name into the Map.
          * @param name - the name of the boolean
          * @param value - the boolean value to set in the Map
@@ -136,10 +161,10 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual unsigned char getByte( const std::string& name ) const 
+        virtual unsigned char getByte( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Byte value with the specified name into the Map.
          * @param name - the name of the Byte
          * @param value - the Byte value to set in the Map
@@ -154,17 +179,17 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual std::vector<unsigned char> getBytes( const std::string& name ) const 
+        virtual std::vector<unsigned char> getBytes( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Bytes value with the specified name into the Map.
          * @param name - the name of the Bytes
          * @param value - the Bytes value to set in the Map
          * @throws CMSException
          */
         virtual void setBytes( const std::string& name,
-                               const std::vector<unsigned char>& value ) 
+                               const std::vector<unsigned char>& value )
                                 throw( cms::CMSException );
 
         /**
@@ -172,16 +197,16 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual char getChar( const std::string& name ) const 
+        virtual char getChar( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Char value with the specified name into the Map.
          * @param name - the name of the Char
          * @param value - the Char value to set in the Map
          * @throws CMSException
          */
-        virtual void setChar( const std::string& name, char value ) 
+        virtual void setChar( const std::string& name, char value )
             throw( cms::CMSException );
 
         /**
@@ -189,10 +214,10 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual double getDouble( const std::string& name ) const 
+        virtual double getDouble( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Double value with the specified name into the Map.
          * @param name - the name of the Double
          * @param value - the Double value to set in the Map
@@ -206,10 +231,10 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual float getFloat( const std::string& name ) const 
+        virtual float getFloat( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Float value with the specified name into the Map.
          * @param name - the name of the Float
          * @param value - the Float value to set in the Map
@@ -223,10 +248,10 @@
          * @param name of the value to fetch from the map
          * @throws CMSException
          */
-        virtual int getInt( const std::string& name ) const 
+        virtual int getInt( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Int value with the specified name into the Map.
          * @param name - the name of the Int
          * @param value - the Int value to set in the Map
@@ -242,8 +267,8 @@
          */
         virtual long long getLong( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Long value with the specified name into the Map.
          * @param name - the name of the Long
          * @param value - the Long value to set in the Map
@@ -259,8 +284,8 @@
          */
         virtual short getShort( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a Short value with the specified name into the Map.
          * @param name - the name of the Short
          * @param value - the Short value to set in the Map
@@ -276,19 +301,19 @@
          */
         virtual std::string getString( const std::string& name ) const
             throw( cms::CMSException );
-        
-        /** 
+
+        /**
          * Sets a String value with the specified name into the Map.
          * @param name - the name of the String
          * @param value - the String value to set in the Map
          * @throws CMSException
          */
-        virtual void setString( const std::string& name, 
+        virtual void setString( const std::string& name,
                                 const std::string& value )
                                     throw( cms::CMSException );
 
     protected:
-    
+
         /**
          * Fetches a reference to this objects PrimitiveMap, if one needs
          * to be created or unmarshalled, this will perform the correct steps.
@@ -300,14 +325,14 @@
         /**
          * Performs the unmarshal on the Map if needed, otherwise just returns
          */
-        virtual void checkMapIsUnmarshalled() const 
+        virtual void checkMapIsUnmarshalled() const
             throw ( exceptions::NullPointerException );
 
     private:
-    
+
         // Map Structure to hold unmarshalled Map Data
         mutable util::PrimitiveMap* map;
-        
+
     };
 
 }}}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h Tue Feb 13 12:07:10 2007
@@ -25,12 +25,12 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQMessage : 
+    class ActiveMQMessage :
         public ActiveMQMessageBase<cms::Message>
     {
     public:
 
-        static const unsigned char ID_ACTIVEMQMESSAGE = 23; 
+        static const unsigned char ID_ACTIVEMQMESSAGE = 23;
 
     public:
 
@@ -48,18 +48,43 @@
             ActiveMQMessageBase<cms::Message>::copyDataStructure( src );
         }
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::Message>::toString();
+            stream << "Begin Class = ActiveMQMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::Message>::equals( value );
+        }
+
     public:  // cms::Message
-    
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */
         virtual cms::Message* clone(void) const {
-            return dynamic_cast<cms::Message*>( 
+            return dynamic_cast<cms::Message*>(
                 this->cloneDataStructure() );
         }
-    
+
     };
 
 }}}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h Tue Feb 13 12:07:10 2007
@@ -101,6 +101,58 @@
             AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMessageBase" << std::endl;
+            stream << " Value of ackHandler = " << ackHandler << std::endl;
+            stream << " Value of redeliveryCount = " << this->redeliveryCount << std::endl;
+            stream << " Value of properties = " << this->properties.toString() << std::endl;
+            stream << commands::Message::toString();
+            stream << "End Class = ActiveMQMessageBase" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+
+            const ActiveMQMessageBase<T>* valuePtr =
+                dynamic_cast< const ActiveMQMessageBase<T>* >( value );
+
+            if( value == NULL || valuePtr == NULL ) {
+                return false;
+            }
+
+            // Check this class's fields
+            if( ackHandler != valuePtr->getAckHandler() ){
+                return false;
+            }
+            if( redeliveryCount != valuePtr->getRedeliveryCount() ) {
+                return false;
+            }
+            if( !properties.equals( valuePtr->properties ) ) {
+                return false;
+            }
+
+            // Now check the base class
+            if( !commands::Message::equals( value ) ) {
+                return false;
+            }
+
+            return true;
+        }
+
     public:   // core::ActiveMQMessage
 
         /**

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h Tue Feb 13 12:07:10 2007
@@ -31,7 +31,7 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQObjectMessage : 
+    class ActiveMQObjectMessage :
         public ActiveMQMessageBase<cms::ObjectMessage>
     {
     public:
@@ -50,9 +50,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQObjectMessage* message = new ActiveMQObjectMessage();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -64,16 +64,41 @@
         virtual void copyDataStructure( const DataStructure* src ) {
             ActiveMQMessageBase<cms::ObjectMessage>::copyDataStructure( src );
         }
-        
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::ObjectMessage>::toString();
+            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::ObjectMessage>::equals( value );
+        }
+
     public:  // cms::Message
-    
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */
         virtual cms::Message* clone(void) const {
-            return dynamic_cast<cms::Message*>( 
+            return dynamic_cast<cms::Message*>(
                 this->cloneDataStructure() );
         }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h Tue Feb 13 12:07:10 2007
@@ -52,9 +52,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQQueue* message = new ActiveMQQueue();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -67,6 +67,16 @@
             ActiveMQDestination::copyDataStructure( src );
         }
 
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
     public:   // CMS Destination
 
         /**
@@ -76,9 +86,9 @@
         virtual cms::Destination::DestinationType getDestinationType(void) const {
             return cms::Destination::QUEUE;
         }
-        
+
         /**
-         * Converts the Destination Name into a String 
+         * Converts the Destination Name into a String
          * @return string name
          */
         virtual std::string toString(void) const {
@@ -94,30 +104,30 @@
         virtual std::string toProviderString(void) const {
             return this->getPhysicalName();
         }
-        
+
         /**
          * Creates a new instance of this destination type that is a
          * copy of this one, and returns it.
          * @returns cloned copy of this object
          */
         virtual cms::Destination* clone(void) const {
-            return dynamic_cast<cms::Destination*>( 
+            return dynamic_cast<cms::Destination*>(
                 this->cloneDataStructure() );
         }
-      
+
         /**
          * Copies the contents of the given Destinastion object to this one.
          * @param source The source Destination object.
          */
         virtual void copy( const cms::Destination& source ) {
-            this->copyDataStructure( 
+            this->copyDataStructure(
                 dynamic_cast<const DataStructure*>( &source ) );
         }
 
         /**
          * Retrieve any properties that might be part of the destination
          * that was specified.  This is a deviation from the JMS spec
-         * but necessary due to C++ restrictions.  
+         * but necessary due to C++ restrictions.
          * @return const reference to a properties object.
          */
         virtual const activemq::util::Properties& getProperties(void) const {
@@ -130,7 +140,7 @@
          * Gets the name of this queue.
          * @return The queue name.
          */
-        virtual std::string getQueueName() const 
+        virtual std::string getQueueName() const
             throw( cms::CMSException ) {
                 return this->getPhysicalName();
         }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h Tue Feb 13 12:07:10 2007
@@ -57,6 +57,31 @@
             ActiveMQDestination::copyDataStructure( src );
         }
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQTempDestination" << std::endl;
+            stream << ActiveMQDestination::toString();
+            stream << "Begin Class = ActiveMQTempDestination" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
     };
 
 }}}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h Tue Feb 13 12:07:10 2007
@@ -55,9 +55,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQTempQueue* message = new ActiveMQTempQueue();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -70,6 +70,16 @@
             ActiveMQTempDestination::copyDataStructure( src );
         }
 
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
     public:   // CMS Destination
 
         /**
@@ -79,9 +89,9 @@
         virtual cms::Destination::DestinationType getDestinationType(void) const {
             return cms::Destination::TEMPORARY_QUEUE;
         }
-        
+
         /**
-         * Converts the Destination Name into a String 
+         * Converts the Destination Name into a String
          * @return string name
          */
         virtual std::string toString(void) const {
@@ -97,30 +107,30 @@
         virtual std::string toProviderString(void) const {
             return this->getPhysicalName();
         }
-        
+
         /**
          * Creates a new instance of this destination type that is a
          * copy of this one, and returns it.
          * @returns cloned copy of this object
          */
         virtual cms::Destination* clone(void) const {
-            return dynamic_cast<cms::Destination*>( 
+            return dynamic_cast<cms::Destination*>(
                 this->cloneDataStructure() );
         }
-      
+
         /**
          * Copies the contents of the given Destinastion object to this one.
          * @param source The source Destination object.
          */
         virtual void copy( const cms::Destination& source ) {
-            this->copyDataStructure( 
+            this->copyDataStructure(
                 dynamic_cast<const DataStructure*>( &source ) );
         }
 
         /**
          * Retrieve any properties that might be part of the destination
          * that was specified.  This is a deviation from the JMS spec
-         * but necessary due to C++ restrictions.  
+         * but necessary due to C++ restrictions.
          * @return const reference to a properties object.
          */
         virtual const activemq::util::Properties& getProperties(void) const {
@@ -128,16 +138,16 @@
         }
 
     public:
-    
+
         /**
          * Gets the name of this queue.
          * @return The queue name.
          */
-        virtual std::string getQueueName(void) const 
+        virtual std::string getQueueName(void) const
             throw( cms::CMSException ) {
                 return this->getPhysicalName();
         }
-            
+
     };
 
 }}}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h Tue Feb 13 12:07:10 2007
@@ -52,9 +52,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQTempTopic* message = new ActiveMQTempTopic();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -67,6 +67,16 @@
             ActiveMQTempDestination::copyDataStructure( src );
         }
 
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
     public:   // CMS Destination
 
         /**
@@ -76,9 +86,9 @@
         virtual cms::Destination::DestinationType getDestinationType(void) const {
             return cms::Destination::TEMPORARY_TOPIC;
         }
-        
+
         /**
-         * Converts the Destination Name into a String 
+         * Converts the Destination Name into a String
          * @return string name
          */
         virtual std::string toString(void) const {
@@ -94,30 +104,30 @@
         virtual std::string toProviderString(void) const {
             return this->getPhysicalName();
         }
-        
+
         /**
          * Creates a new instance of this destination type that is a
          * copy of this one, and returns it.
          * @returns cloned copy of this object
          */
         virtual cms::Destination* clone(void) const {
-            return dynamic_cast<cms::Destination*>( 
+            return dynamic_cast<cms::Destination*>(
                 this->cloneDataStructure() );
         }
-      
+
         /**
          * Copies the contents of the given Destinastion object to this one.
          * @param source The source Destination object.
          */
         virtual void copy( const cms::Destination& source ) {
-            this->copyDataStructure( 
+            this->copyDataStructure(
                 dynamic_cast<const DataStructure*>( &source ) );
         }
 
         /**
          * Retrieve any properties that might be part of the destination
          * that was specified.  This is a deviation from the JMS spec
-         * but necessary due to C++ restrictions.  
+         * but necessary due to C++ restrictions.
          * @return const reference to a properties object.
          */
         virtual const activemq::util::Properties& getProperties(void) const {
@@ -130,7 +140,7 @@
          * Gets the name of this topic.
          * @return The topic name.
          */
-        virtual std::string getTopicName(void) 
+        virtual std::string getTopicName(void)
             const throw( cms::CMSException ) {
                 return this->getPhysicalName();
         }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h Tue Feb 13 12:07:10 2007
@@ -33,7 +33,7 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQTextMessage : 
+    class ActiveMQTextMessage :
         public ActiveMQMessageBase<cms::TextMessage>
     {
     public:
@@ -52,9 +52,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQTextMessage* message = new ActiveMQTextMessage();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -67,20 +67,45 @@
             ActiveMQMessageBase<cms::TextMessage>::copyDataStructure( src );
         }
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQTextMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::TextMessage>::toString();
+            stream << "Begin Class = ActiveMQTextMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::TextMessage>::equals( value );
+        }
+
     public:   // CMS Message
-    
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */
         virtual cms::TextMessage* clone(void) const {
-            return dynamic_cast<cms::TextMessage*>( 
+            return dynamic_cast<cms::TextMessage*>(
                 this->cloneDataStructure() );
         }
-        
+
     public:   // cms::TextMessage
-    
+
         /**
          * Gets the message character buffer.
          * @return The message character buffer.
@@ -89,7 +114,7 @@
 
         /**
          * Sets the message contents, does not take ownership of the passed
-         * char*, but copies it instead.  
+         * char*, but copies it instead.
          * @param msg The message buffer.
          */
         virtual void setText( const char* msg ) throw( cms::CMSException );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h Tue Feb 13 12:07:10 2007
@@ -52,9 +52,9 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual DataStructure* cloneDataStructure() const { 
+        virtual DataStructure* cloneDataStructure() const {
             ActiveMQTopic* message = new ActiveMQTopic();
-            message->copyDataStructure( this );            
+            message->copyDataStructure( this );
             return message;
         }
 
@@ -67,6 +67,16 @@
             ActiveMQDestination::copyDataStructure( src );
         }
 
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
     public:   // CMS Destination
 
         /**
@@ -76,9 +86,9 @@
         virtual cms::Destination::DestinationType getDestinationType(void) const {
             return cms::Destination::TOPIC;
         }
-        
+
         /**
-         * Converts the Destination Name into a String 
+         * Converts the Destination Name into a String
          * @return string name
          */
         virtual std::string toString(void) const {
@@ -94,30 +104,30 @@
         virtual std::string toProviderString(void) const {
             return this->getPhysicalName();
         }
-        
+
         /**
          * Creates a new instance of this destination type that is a
          * copy of this one, and returns it.
          * @returns cloned copy of this object
          */
         virtual cms::Destination* clone(void) const {
-            return dynamic_cast<cms::Destination*>( 
+            return dynamic_cast<cms::Destination*>(
                 this->cloneDataStructure() );
         }
-      
+
         /**
          * Copies the contents of the given Destinastion object to this one.
          * @param source The source Destination object.
          */
         virtual void copy( const cms::Destination& source ) {
-            this->copyDataStructure( 
+            this->copyDataStructure(
                 dynamic_cast<const DataStructure*>( &source ) );
         }
 
         /**
          * Retrieve any properties that might be part of the destination
          * that was specified.  This is a deviation from the JMS spec
-         * but necessary due to C++ restrictions.  
+         * but necessary due to C++ restrictions.
          * @return const reference to a properties object.
          */
         virtual const activemq::util::Properties& getProperties(void) const {
@@ -130,7 +140,7 @@
          * Gets the name of this topic.
          * @return The topic name.
          */
-        virtual std::string getTopicName(void) 
+        virtual std::string getTopicName(void)
             const throw( cms::CMSException ) {
                 return this->getPhysicalName();
         }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h Tue Feb 13 12:07:10 2007
@@ -27,19 +27,19 @@
 namespace openwire{
 namespace commands{
 
-    template< typename T > 
+    template< typename T >
     class BaseCommand : public T,
                         public BaseDataStructure
     {
     public:
-    
+
         BaseCommand() {
             this->commandId = 0;
             this->responseRequired = false;
         }
-        
+
         virtual ~BaseCommand() {}
-        
+
         /**
          * Sets the Command Id of this Message
          * @param id Command Id
@@ -55,7 +55,7 @@
         virtual int getCommandId() const {
             return commandId;
         }
-        
+
         /**
          * Set if this Message requires a Response
          * @param required true if response is required
@@ -71,23 +71,48 @@
         virtual bool isResponseRequired() const {
             return responseRequired;
         }
-        
+
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src ) {
-            
-            const BaseCommand<T>* command = 
+
+            const BaseCommand<T>* command =
                 dynamic_cast< const BaseCommand<T>* >( src );
-            
+
             this->setResponseRequired( command->isResponseRequired() );
             this->setCommandId( command->getCommandId() );
         }
 
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = BaseCommand" << std::endl;
+            stream << BaseDataStructure::toString();
+            stream << "Begin Class = BaseCommand" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return BaseDataStructure::equals( value );
+        }
+
     private:
-    
+
         bool responseRequired;
         int commandId;
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseDataStructure.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseDataStructure.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseDataStructure.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseDataStructure.h Tue Feb 13 12:07:10 2007
@@ -22,6 +22,7 @@
 #include <activemq/util/Config.h>
 
 #include <string>
+#include <sstream>
 
 namespace activemq{
 namespace connector{

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BooleanExpression.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BooleanExpression.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BooleanExpression.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BooleanExpression.h Tue Feb 13 12:07:10 2007
@@ -29,10 +29,10 @@
     class BooleanExpression : public BaseDataStructure
     {
     public:
-    
+
         BooleanExpression() {}
         virtual ~BooleanExpression() {}
-        
+
         /**
          * Clone this obbject and return a new instance that the
          * caller now owns, this will be an exact copy of this one
@@ -46,7 +46,32 @@
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src AMQCPP_UNUSED) {}
-        
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = BooleanExpression" << std::endl;
+            stream << BaseDataStructure::toString();
+            stream << "Begin Class = BooleanExpression" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return BaseDataStructure::equals( value );
+        }
+
     };
 
 }}}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp Tue Feb 13 12:07:10 2007
@@ -42,7 +42,7 @@
         MAGIC.push_back( 'M' );
         MAGIC.push_back( 'Q' );
     }
-    
+
     // Initialize member magic buffer to the static buffer.
     magic.resize( MAGIC.size() );
     for( std::size_t ix=0; ix<MAGIC.size(); ++ix ){
@@ -84,6 +84,86 @@
 ////////////////////////////////////////////////////////////////////////////////
 unsigned char WireFormatInfo::getDataStructureType() const {
     return WireFormatInfo::ID_WIREFORMATINFO;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string WireFormatInfo::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = WireFormatInfo" << std::endl;
+
+    std::vector<unsigned char> magic;
+    std::vector<unsigned char> marshalledProperties;
+
+    for( size_t imagic = 0; imagic < magic.size(); ++imagic ) {
+        stream << " Value of magic[" << imagic << "] = " << magic[imagic] << std::endl;
+    }
+
+    for( size_t imarshalledProperties = 0; imarshalledProperties < marshalledProperties.size(); ++imarshalledProperties ) {
+        stream << " Value of marshalledProperties[" << imarshalledProperties << "] = "
+               << marshalledProperties[imarshalledProperties] << std::endl;
+    }
+
+    stream << " Value of properties = " << properties.toString() << std::endl;
+    stream << " Value of version = " << version << std::endl;
+    stream << " Value of stackTraceEnabled = " << stackTraceEnabled << std::endl;
+    stream << " Value of tcpNoDelayEnabled = " << tcpNoDelayEnabled << std::endl;
+    stream << " Value of cacheEnabled = " << cacheEnabled << std::endl;
+    stream << " Value of tightEncodingEnabled = " << tightEncodingEnabled << std::endl;
+    stream << " Value of sizePrefixDisabled = " << sizePrefixDisabled << std::endl;
+    stream << " Value of maxInactivityDuration = " << maxInactivityDuration << std::endl;
+
+    stream << BaseCommand<transport::Command>::toString();
+    stream << "End Class = WireFormatInfo" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::equals( const DataStructure* value ) const {
+
+    const WireFormatInfo* wireFormatInfo =
+        dynamic_cast<const WireFormatInfo*>( value );
+
+    if( value == NULL || wireFormatInfo == NULL ) {
+        return false;
+    }
+
+    if( magic != wireFormatInfo->getMagic() ) {
+        return false;
+    }
+    if( marshalledProperties != wireFormatInfo->getMarshalledProperties() ) {
+        return false;
+    }
+    if( !properties.equals( wireFormatInfo->properties ) ) {
+        return false;
+    }
+    if( version != wireFormatInfo->getVersion() ) {
+        return false;
+    }
+    if( stackTraceEnabled != wireFormatInfo->isStackTraceEnabled() ) {
+        return false;
+    }
+    if( tcpNoDelayEnabled != wireFormatInfo->isTcpNoDelayEnabled() ) {
+        return false;
+    }
+    if( cacheEnabled != wireFormatInfo->isCacheEnabled() ) {
+        return false;
+    }
+    if( tightEncodingEnabled != wireFormatInfo->isTightEncodingEnabled() ) {
+        return false;
+    }
+    if( sizePrefixDisabled != wireFormatInfo->isSizePrefixDisabled() ) {
+        return false;
+    }
+    if( maxInactivityDuration != wireFormatInfo->getMaxInactivityDuration() ) {
+        return false;
+    }
+    if( !BaseCommand<transport::Command>::equals( value ) ) {
+        return false;
+    }
+
+    return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h Tue Feb 13 12:07:10 2007
@@ -64,6 +64,20 @@
         virtual void copyDataStructure( const DataStructure* src );
 
         /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const;
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const;
+
+        /**
          * Indicates that this command is aware of Marshalling, and needs
          * to have its Marshalling methods invoked.
          * @returns boolean indicating desire to be in marshalling stages

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp Tue Feb 13 12:07:10 2007
@@ -17,6 +17,8 @@
 
 #include "PrimitiveMap.h"
 
+#include <sstream>
+
 using namespace activemq::util;
 using namespace activemq::exceptions;
 using namespace std;
@@ -43,6 +45,14 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+std::string PrimitiveMap::toString() const {
+
+    ostringstream stream;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::copy( const PrimitiveMap& src ) {
 
     return this->valueNodeMap.copy( src.valueNodeMap );
@@ -50,49 +60,49 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::clear() {
-    
+
     valueNodeMap.clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveMap::contains( const string& key ) const{
-    
+
     return valueNodeMap.containsKey( key );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 std::size_t PrimitiveMap::size() const{
-    
+
     return valueNodeMap.size();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveMap::isEmpty() const{
-    
+
     return valueNodeMap.isEmpty();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveMap::getBool( const string& key ) const 
+bool PrimitiveMap::getBool( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getBool();
 }
-    
+
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::setBool( const string& key, bool value ){
-    
+
     ValueNode node;
     node.setBool( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char PrimitiveMap::getByte( const string& key ) const 
+unsigned char PrimitiveMap::getByte( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getByte();
 }
@@ -101,14 +111,14 @@
 void PrimitiveMap::setByte( const string& key, unsigned char value ){
     ValueNode node;
     node.setByte( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-char PrimitiveMap::getChar( const string& key ) const 
+char PrimitiveMap::getChar( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getChar();
 }
@@ -117,14 +127,14 @@
 void PrimitiveMap::setChar( const string& key, char value ){
     ValueNode node;
     node.setChar( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-short PrimitiveMap::getShort( const string& key ) const 
+short PrimitiveMap::getShort( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getShort();
 }
@@ -133,14 +143,14 @@
 void PrimitiveMap::setShort( const string& key, short value ){
     ValueNode node;
     node.setShort( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int PrimitiveMap::getInt( const string& key ) const 
+int PrimitiveMap::getInt( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getInt();
 }
@@ -149,14 +159,14 @@
 void PrimitiveMap::setInt( const string& key, int value ){
     ValueNode node;
     node.setInt( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long PrimitiveMap::getLong( const string& key ) const 
+long long PrimitiveMap::getLong( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getLong();
 }
@@ -165,14 +175,14 @@
 void PrimitiveMap::setLong( const string& key, long long value ){
     ValueNode node;
     node.setLong( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-double PrimitiveMap::getDouble( const string& key ) const 
+double PrimitiveMap::getDouble( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getDouble();
 }
@@ -181,14 +191,14 @@
 void PrimitiveMap::setDouble( const string& key, double value ){
     ValueNode node;
     node.setDouble( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-float PrimitiveMap::getFloat( const string& key ) const 
+float PrimitiveMap::getFloat( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
     return node.getFloat();
 }
@@ -197,38 +207,38 @@
 void PrimitiveMap::setFloat( const string& key, float value ){
     ValueNode node;
     node.setFloat( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-string PrimitiveMap::getString( const string& key ) const 
+string PrimitiveMap::getString( const string& key ) const
     throw(NoSuchElementException){
-        
+
     ValueNode node = valueNodeMap.getValue( key );
-    return node.getString();        
+    return node.getString();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::setString( const string& key, const string& value ){
     ValueNode node;
     node.setString( value );
-    
+
     valueNodeMap.setValue( key, node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<unsigned char> PrimitiveMap::getByteArray( const std::string& key ) const 
+std::vector<unsigned char> PrimitiveMap::getByteArray( const std::string& key ) const
     throw( activemq::exceptions::NoSuchElementException ) {
 
     ValueNode node = valueNodeMap.getValue( key );
-    return node.getByteArray();        
+    return node.getByteArray();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveMap::setByteArray( const std::string& key, 
+void PrimitiveMap::setByteArray( const std::string& key,
                                  const std::vector<unsigned char>& value ) {
-                                    
+
     ValueNode node;
     node.setByteArray( value );
 
@@ -242,13 +252,13 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 vector<string> PrimitiveMap::getKeys() const{
-    
+
     return valueNodeMap.getKeys();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 vector<PrimitiveMap::ValueNode> PrimitiveMap::getValues() const{
-    
+
     return valueNodeMap.getValues();
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h?view=diff&rev=507189&r1=507188&r2=507189
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h Tue Feb 13 12:07:10 2007
@@ -23,14 +23,14 @@
 
 namespace activemq{
 namespace util{
-        
+
     /**
      * Map of named primitives.
      */
     class PrimitiveMap
-    {        
+    {
     public:
-    
+
         /**
          * Enumeration for the various primitive types.
          */
@@ -50,12 +50,12 @@
             LIST_TYPE               = 12,
             BIG_STRING_TYPE         = 13
         };
-        
+
         /**
          * Define a union type comprised of the various types.
          */
         union Value {
-            
+
             bool boolValue;
             unsigned char byteValue;
             char charValue;
@@ -67,43 +67,43 @@
             std::string* stringValue;
             std::vector<unsigned char>* byteArrayValue;
         };
-    
+
         /**
          * Class that wraps around a single value of one of the
          * many types.  Manages memory for complex types, such
          * as strings.  Note: the destructor was left non-virtual
          * so no virtual table will be created.  This probaly isn't
-         * necessary, but will avoid needless memory allocation. Since 
+         * necessary, but will avoid needless memory allocation. Since
          * we'll never extend this class, not having a virtual
          * destructor isn't a concern.
          */
         class ValueNode{
         private:
-        
-            ValueTypeEnum valueType;            
+
+            ValueTypeEnum valueType;
             Value value;
-            
+
         public:
-        
+
             ValueNode(){
-                valueType = NULL_TYPE;  
-                memset( &value, 0, sizeof(value) );              
+                valueType = NULL_TYPE;
+                memset( &value, 0, sizeof(value) );
             }
-            
+
             ValueNode( const ValueNode& node ){
-                valueType = NULL_TYPE; 
-                memset( &value, 0, sizeof(value) );                
-                (*this) = node;            
+                valueType = NULL_TYPE;
+                memset( &value, 0, sizeof(value) );
+                (*this) = node;
             }
-            
+
             ~ValueNode(){
                 clear();
             }
-            
+
             ValueNode& operator =( const ValueNode& node ){
                 clear();
                 valueType = node.valueType;
-                
+
                 if( valueType == STRING_TYPE && node.value.stringValue != NULL ){
                     value.stringValue = new std::string( *node.value.stringValue );
                 } else if( valueType == BYTE_ARRAY_TYPE && node.value.byteArrayValue != NULL ){
@@ -111,14 +111,14 @@
                 } else{
                     value = node.value;
                 }
-                
+
                 return *this;
             }
-            
+
             bool operator==( const ValueNode& node ) const{
 
                 if( valueType != node.valueType ) {
-                     return false; 
+                     return false;
                 }
 
                 if( valueType == BOOLEAN_TYPE &&
@@ -152,12 +152,12 @@
                     *value.byteArrayValue == *node.value.byteArrayValue ) {
                         return true;
                 }
-                
+
                 return false;
             }
-            
+
             ValueTypeEnum getValueType() const { return valueType; }
-            
+
             void clear(){
                 if( valueType == STRING_TYPE && value.stringValue != NULL ){
                     delete value.stringValue;
@@ -165,208 +165,215 @@
                 if( valueType == BYTE_ARRAY_TYPE && value.byteArrayValue != NULL ){
                     delete value.byteArrayValue;
                 }
-                valueType = NULL_TYPE;  
+                valueType = NULL_TYPE;
                 memset( &value, 0, sizeof(value) );
             }
-            
+
             void setBool( bool lvalue ){
                 clear();
                 valueType = BOOLEAN_TYPE;
                 value.boolValue = lvalue;
             }
-            
+
             bool getBool() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != BOOLEAN_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not BOOLEAN_TYPE" );
                 }
-                
+
                 return value.boolValue;
             }
-            
+
             void setByte( unsigned char lvalue ){
                 clear();
                 valueType = BYTE_TYPE;
                 value.byteValue = lvalue;
             }
-            
+
             unsigned char getByte() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != BYTE_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not BYTE_TYPE" );
                 }
-                
+
                 return value.byteValue;
             }
-            
+
             void setChar( char lvalue ){
                 clear();
                 valueType = CHAR_TYPE;
                 value.charValue = lvalue;
             }
-            
+
             char getChar() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != CHAR_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not CHAR_TYPE" );
                 }
-                
+
                 return value.charValue;
             }
-            
+
             void setShort( short lvalue ){
                 clear();
                 valueType = SHORT_TYPE;
                 value.shortValue = lvalue;
             }
-            
+
             short getShort() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != SHORT_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not SHORT_TYPE" );
                 }
-                
+
                 return value.shortValue;
             }
-            
+
             void setInt( int lvalue ){
                 clear();
                 valueType = INTEGER_TYPE;
                 value.intValue = lvalue;
             }
-            
+
             int getInt() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != INTEGER_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not INTEGER_TYPE" );
                 }
-                
+
                 return value.intValue;
             }
-            
+
             void setLong( long long lvalue ){
                 clear();
                 valueType = LONG_TYPE;
                 value.longValue = lvalue;
             }
-            
+
             long long getLong() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != LONG_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not LONG_TYPE" );
                 }
-                
+
                 return value.longValue;
             }
-            
+
             void setDouble( double lvalue ){
                 clear();
                 valueType = DOUBLE_TYPE;
                 value.doubleValue = lvalue;
             }
-            
+
             double getDouble() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != DOUBLE_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not DOUBLE_TYPE" );
                 }
-                
+
                 return value.doubleValue;
             }
-            
+
             void setFloat( float lvalue ){
                 clear();
                 valueType = FLOAT_TYPE;
                 value.floatValue = lvalue;
             }
-            
+
             float getFloat() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != FLOAT_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not FLOAT_TYPE" );
                 }
-                
+
                 return value.floatValue;
             }
-            
+
             void setString( const std::string& lvalue ){
                 clear();
                 valueType = STRING_TYPE;
                 value.stringValue = new std::string( lvalue );
             }
-            
+
             std::string getString() const throw(activemq::exceptions::NoSuchElementException){
                 if( valueType != STRING_TYPE ){
                     throw activemq::exceptions::NoSuchElementException( __FILE__,
                         __LINE__, "Value is not STRING_TYPE" );
                 }
-                
+
                 if( value.stringValue == NULL ){
                     return std::string();
                 }
-                
+
                 return *value.stringValue;
             }
-                        
+
             void setByteArray( const std::vector<unsigned char>& lvalue ){
                 clear();
                 valueType = BYTE_ARRAY_TYPE;
                 value.byteArrayValue = new std::vector<unsigned char>( lvalue );
             }
-            
+
             std::vector<unsigned char> getByteArray() const throw( activemq::exceptions::NoSuchElementException ) {
 
                 if( valueType != BYTE_ARRAY_TYPE ){
-                    throw activemq::exceptions::NoSuchElementException( 
+                    throw activemq::exceptions::NoSuchElementException(
                         __FILE__,
-                        __LINE__, 
+                        __LINE__,
                         "Value is not BYTE_ARRAY_TYPE" );
                 }
-                
+
                 if( value.byteArrayValue == NULL ){
                     return std::vector<unsigned char>();
                 }
-                
+
                 return *value.byteArrayValue;
             }
 
         };
-        
+
 
     private:
-    
+
         activemq::util::Map<std::string, ValueNode> valueNodeMap;
-        
+
     public:
-    
+
     	PrimitiveMap();
     	virtual ~PrimitiveMap();
-        
+
         /**
          * Copy Constructor
          * @param map - the PrimitiveMap to copy
          */
         PrimitiveMap( const PrimitiveMap& src );
-        
+
         /**
          * Compares this PrimitiveMap to another
          * @param source - Map to compare to
          * @return true if the maps are equeal
          */
         bool equals( const PrimitiveMap& source ) const;
-                
+
+        /**
+         * Converts the contents into a formatted string that can be output
+         * in a Log File or other debugging tool.
+         * @returns formatted String of all elements in the map.
+         */
+        std::string toString() const;
+
         /**
          * Comparison Operator
          * @param src - Map to compare to this one.
          * @returns true if Maps are equal.
          */
         void copy( const PrimitiveMap& src );
-        
+
         /**
          * Removes all keys and values from all maps.
          */
         virtual void clear();
-        
+
         /**
          * Indicates whether or this map contains a value for the
          * given key.
@@ -374,7 +381,7 @@
          * @return true if this map contains the value, otherwise false.
          */
         virtual bool contains( const std::string& key ) const;
-        
+
         /**
          * @return The number of elements (key/value pairs) in this map.
          */
@@ -383,71 +390,71 @@
         /**
          * @returns if there are any entries in the map.
          */
-        virtual bool isEmpty() const;        
+        virtual bool isEmpty() const;
 
-        virtual bool getBool( const std::string& key ) const 
+        virtual bool getBool( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setBool( const std::string& key, bool value );
-        
-        virtual unsigned char getByte( const std::string& key ) const 
+
+        virtual unsigned char getByte( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setByte( const std::string& key, unsigned char value );
 
-        virtual char getChar( const std::string& key ) const 
+        virtual char getChar( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setChar( const std::string& key, char value );
 
-        virtual short getShort( const std::string& key ) const 
+        virtual short getShort( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setShort( const std::string& key, short value );
-        
-        virtual int getInt( const std::string& key ) const 
+
+        virtual int getInt( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setInt( const std::string& key, int value );
-        
-        virtual long long getLong( const std::string& key ) const 
+
+        virtual long long getLong( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setLong( const std::string& key, long long value );
-        
-        virtual double getDouble( const std::string& key ) const 
+
+        virtual double getDouble( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setDouble( const std::string& key, double value );
-        
-        virtual float getFloat( const std::string& key ) const 
+
+        virtual float getFloat( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setFloat( const std::string& key, float value );
-        
-        virtual std::string getString( const std::string& key ) const 
+
+        virtual std::string getString( const std::string& key ) const
             throw(activemq::exceptions::NoSuchElementException);
         virtual void setString( const std::string& key, const std::string& value );
-        
-        virtual std::vector<unsigned char> getByteArray( const std::string& key ) const 
+
+        virtual std::vector<unsigned char> getByteArray( const std::string& key ) const
             throw( activemq::exceptions::NoSuchElementException );
         virtual void setByteArray( const std::string& key, const std::vector<unsigned char>& value );
 
         /**
-         * Removes the value (key/value pair) for the specified key from 
+         * Removes the value (key/value pair) for the specified key from
          * the map.
          * @param key The search key.
-         */        
+         */
         virtual void remove( const std::string& key );
-        
+
         /**
          * @return the entire set of keys in this map as a std::vector.
          */
         virtual std::vector<std::string> getKeys() const;
-        
+
         /**
          * @return the entire set of values in this map as a std::vector.
          */
         virtual std::vector<ValueNode> getValues() const;
-        
+
         /**
          * Get a Value from the Map, or throws a NoSuchElementException
          * @param key - string key to lookup
          * @returns the concrete Value
          * @throws NoSuchElementException
-         */ 
+         */
         ValueNode getValue( const std::string& key ) const
             throw( activemq::exceptions::NoSuchElementException );
 



Mime
View raw message