You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/02/13 16:50:08 UTC

svn commit: r744147 - in /activemq/activemq-cpp/trunk/src/main/activemq/commands: ActiveMQDestination.cpp ActiveMQDestination.h

Author: tabish
Date: Fri Feb 13 15:50:05 2009
New Revision: 744147

URL: http://svn.apache.org/viewvc?rev=744147&view=rev
Log:
Add a definition for method equals since the base class equals does nothing.  

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.h

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.cpp?rev=744147&r1=744146&r2=744147&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.cpp Fri Feb 13 15:50:05 2009
@@ -122,6 +122,22 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQDestination::equals( const DataStructure* value ) const {
+
+    if( this == value ) {
+        return true;
+    }
+
+    const ActiveMQDestination* valuePtr = dynamic_cast<const ActiveMQDestination*>( value );
+
+    if( valuePtr == NULL || value == NULL ) {
+        return false;
+    }
+
+    return this->getPhysicalName() == valuePtr->getPhysicalName();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 unsigned char ActiveMQDestination::getDataStructureType() const {
     return ActiveMQDestination::ID_ACTIVEMQDESTINATION;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.h?rev=744147&r1=744146&r2=744147&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQDestination.h Fri Feb 13 15:50:05 2009
@@ -114,6 +114,14 @@
          */
         virtual void copyDataStructure( const DataStructure* 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;
+
         virtual unsigned char getDataStructureType() const;
 
         /**