activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r464730 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts: AmqCppClassesGenerator.java AmqCppMakefileGenerator.java
Date Mon, 16 Oct 2006 23:46:05 GMT
Author: tabish
Date: Mon Oct 16 16:46:04 2006
New Revision: 464730

URL: http://svn.apache.org/viewvc?view=rev&rev=464730
Log: (empty)

Removed:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppMakefileGenerator.java
Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppClassesGenerator.java

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppClassesGenerator.java
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppClassesGenerator.java?view=diff&rev=464730&r1=464729&r2=464730
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppClassesGenerator.java
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/temp-scripts/AmqCppClassesGenerator.java
Mon Oct 16 16:46:04 2006
@@ -280,7 +280,10 @@
 out.println("");
 out.println("////////////////////////////////////////////////////////////////////////////////");
 out.println(className+"* "+className+"::clone() const {");
-out.println("    "+className+"* "+decaptialize(className)+" = ");
+
+    String newInstance = decaptialize(className);
+
+out.println("    "+className+"* "+newInstance+" = ");
 out.println("        new "+className+"();");
 out.println("");
 
@@ -293,13 +296,17 @@
     
         if( !property.getType().isPrimitiveType() &&
             !property.getType().getSimpleName().equals("ByteSequence") && 
-            !property.getType().getSimpleName().equals("String") &&
             !type.startsWith("std::vector") ) {
                
-            type = type + "*";
-        } else if( property.getType().getSimpleName().equals("String") ) {
-            type = type + "&";
-            constNess = "const ";
+out.println("    "+newInstance+"->"+parameterName+" = this->get"+propertyName"();");
           
+        } else if( property.getType().getSimpleName().startsWith("std::vector") &&
+                   type.contains( "*" ) ) {
+out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " < " +
parameterName + ".size(); ++i" + parameterName + " ) {");
+out.println("        "+newInstance+"->"+parameterName+".psuh_back( ");
+out.println("            this->"+parameterName+"[i"+parameterName+"]->clone();"); 
          
+out.println("    }");
+        } else {
+out.println("    "+newInstance+"->"+parameterName+" = this->get"+propertyName"()->clone();");
           
         }
     }
 



Mime
View raw message