activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r744147 - in /activemq/activemq-cpp/trunk/src/main/activemq/commands: ActiveMQDestination.cpp ActiveMQDestination.h
Date Fri, 13 Feb 2009 15:50:08 GMT
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;
 
         /**



Mime
View raw message