activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r955045 - in /activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool: ./ marshallers/ tests/
Date Tue, 15 Jun 2010 20:53:37 GMT
Author: tabish
Date: Tue Jun 15 20:53:37 2010
New Revision: 955045

URL: http://svn.apache.org/viewvc?rev=955045&view=rev
Log:
Updated openwire code generators to create one set of marshalers that can handle all known versions

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/AmqCppGeneratorTask.java
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingClassesGenerator.java
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingHeadersGenerator.java
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingClassesGenerator.java
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingHeadersGenerator.java

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/AmqCppGeneratorTask.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/AmqCppGeneratorTask.java?rev=955045&r1=955044&r2=955045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/AmqCppGeneratorTask.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/AmqCppGeneratorTask.java Tue Jun 15 20:53:37 2010
@@ -93,49 +93,33 @@ public class AmqCppGeneratorTask extends
                 script.setTargetDir(target+"/src/main");
                 script.run();
             }
-
-            for( int i = 1; i <= maxVersion; ++i ) {
-
-                {
-                    AmqCppMarshallingHeadersGenerator script = new AmqCppMarshallingHeadersGenerator();
-                    script.setJam(jam);
-                    script.setTargetDir(target+"/src/main");
-                    script.setOpenwireVersion(i);
-                    script.run();
-                }
-                {
-                    AmqCppMarshallingClassesGenerator script = new AmqCppMarshallingClassesGenerator();
-                    script.setJam(jam);
-                    script.setTargetDir(target+"/src/main");
-                    script.setOpenwireVersion(i);
-                    script.run();
-                }
-                {
-                   AmqCppTestMarshallingHeadersGenerator script = new AmqCppTestMarshallingHeadersGenerator();
-                    script.setJam(jam);
-                    script.setTargetDir(target+"/src/test");
-                    script.setOpenwireVersion(i);
-                    script.run();
-                }
-                {
-                    AmqCppTestMarshallingClassesGenerator script = new AmqCppTestMarshallingClassesGenerator();
-                    script.setJam(jam);
-                    script.setTargetDir(target+"/src/test");
-                    script.setOpenwireVersion(i);
-                    script.run();
-                }
-                {
-                    AmqCppMakefileGenerator script = new AmqCppMakefileGenerator(
-                        "activemq/wireformat/openwire/marshal/v" + i );
-                    script.setTargetDir(target+"/src/main");
-                    script.run();
-                }
-                {
-                    AmqCppMakefileGenerator script = new AmqCppMakefileGenerator(
-                        "activemq/wireformat/openwire/marshal/v" + i );
-                    script.setTargetDir(target+"/src/test");
-                    script.run();
-                }
+            {
+                AmqCppMarshallingHeadersGenerator script = new AmqCppMarshallingHeadersGenerator();
+                script.setJam(jam);
+                script.setTargetDir(target+"/src/main");
+                script.setOpenwireVersion(maxVersion);
+                script.run();
+            }
+            {
+                AmqCppMarshallingClassesGenerator script = new AmqCppMarshallingClassesGenerator();
+                script.setJam(jam);
+                script.setTargetDir(target+"/src/main");
+                script.setOpenwireVersion(maxVersion);
+                script.run();
+            }
+            {
+               AmqCppTestMarshallingHeadersGenerator script = new AmqCppTestMarshallingHeadersGenerator();
+                script.setJam(jam);
+                script.setTargetDir(target+"/src/test");
+                script.setOpenwireVersion(maxVersion);
+                script.run();
+            }
+            {
+                AmqCppTestMarshallingClassesGenerator script = new AmqCppTestMarshallingClassesGenerator();
+                script.setJam(jam);
+                script.setTargetDir(target+"/src/test");
+                script.setOpenwireVersion(maxVersion);
+                script.run();
             }
 
         } catch (Exception e) {

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingClassesGenerator.java?rev=955045&r1=955044&r2=955045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingClassesGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingClassesGenerator.java Tue Jun 15 20:53:37 2010
@@ -98,115 +98,151 @@ public class AmqCppMarshallingClassesGen
         return false;
     }
 
+    protected boolean checkNeedsWireFormatVersion() {
+        if( !getProperties().isEmpty() ) {
+
+            for ( JProperty property : getProperties() ) {
+
+                JAnnotation annotation = property.getAnnotation("openwire:property");
+                JAnnotationValue version = annotation.getValue("version");
+
+                if( version.asInt() > 1 ) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
     //////////////////////////////////////////////////////////////////////////////////////
     // This section is for the tight wire format encoding generator
     //////////////////////////////////////////////////////////////////////////////////////
 
     protected void generateTightUnmarshalBody(PrintWriter out) {
+
         for ( JProperty property : getProperties() ) {
             JAnnotation annotation = property.getAnnotation("openwire:property");
             JAnnotationValue size = annotation.getValue("size");
+            JAnnotationValue version = annotation.getValue("version");
             JClass propertyType = property.getType();
             String propertyTypeName = propertyType.getSimpleName();
+            String indent = "        ";
+
+            if( version.asInt() > 1 ) {
+                indent = indent + "    ";
+                out.println("        if( wireVersion >= " + version.asInt() + " ) {");
+            }
 
             if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
-                generateTightUnmarshalBodyForArrayProperty(out, property, size);
+                generateTightUnmarshalBodyForArrayProperty(out, property, size, indent);
             } else {
-                generateTightUnmarshalBodyForProperty(out, property, size);
+                generateTightUnmarshalBodyForProperty(out, property, size, indent);
+            }
+
+            if( version.asInt() > 1 ) {
+                out.println("        }");
             }
         }
     }
 
-    protected void generateTightUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
+    protected void generateTightUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size, String indent) {
 
         String setter = property.getSetter().getSimpleName();
         String type = property.getType().getSimpleName();
         String nativeType = toCppType(property.getType());
 
         if( type.equals("boolean") ) {
-            out.println("        info->" + setter + "( bs->readBoolean() );");
+            out.println(indent + "info->" + setter + "( bs->readBoolean() );");
         }
         else if( type.equals("byte") ) {
-            out.println("        info->" + setter + "( dataIn->readByte() );");
+            out.println(indent + "info->" + setter + "( dataIn->readByte() );");
         }
         else if( type.equals("char") ) {
-            out.println("        info->" + setter + "( dataIn->readChar() );");
+            out.println(indent + "info->" + setter + "( dataIn->readChar() );");
         }
         else if( type.equals("short") ) {
-            out.println("        info->" + setter + "( dataIn->readShort() );");
+            out.println(indent + "info->" + setter + "( dataIn->readShort() );");
         }
         else if( type.equals("int") ) {
-            out.println("        info->" + setter + "( dataIn->readInt() );");
+            out.println(indent + "info->" + setter + "( dataIn->readInt() );");
         }
         else if( type.equals("long") ) {
-            out.println("        info->" + setter + "( tightUnmarshalLong( wireFormat, dataIn, bs ) );");
+            out.println(indent + "info->" + setter + "( tightUnmarshalLong( wireFormat, dataIn, bs ) );");
         }
         else if( type.equals("String") ) {
-            out.println("        info->" + setter + "( tightUnmarshalString( dataIn, bs ) );");
+            out.println(indent + "info->" + setter + "( tightUnmarshalString( dataIn, bs ) );");
         }
         else if( type.equals("byte[]") || type.equals("ByteSequence") ) {
             if( size != null ) {
-                out.println("        info->" + setter + "( tightUnmarshalConstByteArray( dataIn, bs, "+ size.asInt() +" ) );");
+                out.println(indent + "info->" + setter + "( tightUnmarshalConstByteArray( dataIn, bs, "+ size.asInt() +" ) );");
             }
             else {
-                out.println("        info->" + setter + "( tightUnmarshalByteArray( dataIn, bs ) );");
+                out.println(indent + "info->" + setter + "( tightUnmarshalByteArray( dataIn, bs ) );");
             }
         }
         else if( isThrowable( property.getType() ) ) {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
-            out.println("            tightUnmarshalBrokerError( wireFormat, dataIn, bs ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
+            out.println(indent + "    tightUnmarshalBrokerError( wireFormat, dataIn, bs ) ) ) );");
         }
         else if( isCachedProperty(property) ) {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
-            out.println("            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
+            out.println(indent + "    tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) ) );");
         }
         else {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
-            out.println("            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
+            out.println(indent + "    tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) ) );");
         }
     }
 
-    protected void generateTightUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
+    protected void generateTightUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size, String indent) {
         JClass propertyType = property.getType();
         String arrayType = propertyType.getArrayComponentType().getSimpleName();
         String setter = property.getSetter().getSimpleName();
         String getter = property.getGetter().getSimpleName();
         out.println();
         if (size != null) {
-            out.println("        {");
-            out.println("            " + arrayType + " value[] = new " + arrayType + "[" + size.asInt() + "];");
-            out.println("            " + "for( int i = 0; i < " + size.asInt() + "; i++ ) {");
-            out.println("                value[i] = (" + arrayType + ") tightUnmarshalNestedObject( wireFormat, dataIn, bs );");
-            out.println("            }");
-            out.println("            info->" + setter + "( value );");
-            out.println("        }");
+            out.println(indent + "{");
+            out.println(indent + "    " + arrayType + " value[] = new " + arrayType + "[" + size.asInt() + "];");
+            out.println(indent + "    for( int i = 0; i < " + size.asInt() + "; i++ ) {");
+            out.println(indent + "        value[i] = (" + arrayType + ") tightUnmarshalNestedObject( wireFormat, dataIn, bs );");
+            out.println(indent + "    }");
+            out.println(indent + "    info->" + setter + "( value );");
+            out.println(indent + "}");
         }
         else {
-            out.println("        if( bs->readBoolean() ) {");
-            out.println("            short size = dataIn->readShort();");
-            out.println("            info->" + getter + "().reserve( size );");
-            out.println("            for( int i = 0; i < size; i++ ) {");
-            out.println("                info->" + getter + "().push_back( Pointer<"+arrayType+">( dynamic_cast< " + arrayType + "* >(");
-            out.println("                    tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) ) );");
-            out.println("            }");
-            out.println("        }");
-            out.println("        else {");
-            out.println("            info->" + getter + "().clear();");
-            out.println("        }");
+            out.println(indent + "if( bs->readBoolean() ) {");
+            out.println(indent + "    short size = dataIn->readShort();");
+            out.println(indent + "    info->" + getter + "().reserve( size );");
+            out.println(indent + "    for( int i = 0; i < size; i++ ) {");
+            out.println(indent + "        info->" + getter + "().push_back( Pointer<"+arrayType+">( dynamic_cast< " + arrayType + "* >(");
+            out.println(indent + "            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) ) );");
+            out.println(indent + "    }");
+            out.println(indent + "} else {");
+            out.println(indent + "    info->" + getter + "().clear();");
+            out.println(indent + "}");
         }
     }
 
     protected int generateTightMarshal1Body(PrintWriter out) {
         int baseSize = 0;
+
         for ( JProperty property : getProperties() ) {
             JAnnotation annotation = property.getAnnotation("openwire:property");
+            JAnnotationValue version = annotation.getValue("version");
             JAnnotationValue size = annotation.getValue("size");
             JClass propertyType = property.getType();
             String type = propertyType.getSimpleName();
             String getter = "info->" + property.getGetter().getSimpleName() + "()";
+            String indent = "        ";
+
+            if( version.asInt() > 1 ) {
+                indent = indent + "    ";
+                out.println("        if( wireVersion >= " + version.asInt() + " ) {");
+            }
 
             if (type.equals("boolean")) {
-                out.println("        bs->writeBoolean( " + getter + " );");
+                out.println(indent + "bs->writeBoolean( " + getter + " );");
             }
             else if (type.equals("byte")) {
                 baseSize += 1;
@@ -221,16 +257,16 @@ public class AmqCppMarshallingClassesGen
                 baseSize += 4;
             }
             else if (type.equals("long")) {
-                out.println("        rc += tightMarshalLong1( wireFormat, " + getter + ", bs );");
+                out.println(indent + "rc += tightMarshalLong1( wireFormat, " + getter + ", bs );");
             }
             else if (type.equals("String")) {
                 out.print("");
-                out.println("        rc += tightMarshalString1( " + getter + ", bs );" );
+                out.println(indent + "rc += tightMarshalString1( " + getter + ", bs );" );
             }
             else if (type.equals("byte[]") || type.equals("ByteSequence")) {
                 if (size == null) {
-                    out.println("        bs->writeBoolean( " + getter + ".size() != 0 );" );
-                    out.println("        rc += " + getter + ".size() == 0 ? 0 : (int)" + getter + ".size() + 4;");
+                    out.println(indent + "bs->writeBoolean( " + getter + ".size() != 0 );" );
+                    out.println(indent + "rc += " + getter + ".size() == 0 ? 0 : (int)" + getter + ".size() + 4;");
                 }
                 else {
                     baseSize += size.asInt();
@@ -238,23 +274,27 @@ public class AmqCppMarshallingClassesGen
             }
             else if (propertyType.isArrayType()) {
                 if (size != null) {
-                    out.println("        rc += tightMarshalObjectArrayConstSize1( wireFormat, " + getter + ", bs, " + size.asInt() + " );");
+                    out.println(indent + "rc += tightMarshalObjectArrayConstSize1( wireFormat, " + getter + ", bs, " + size.asInt() + " );");
                 }
                 else {
-                    out.println("        rc += tightMarshalObjectArray1( wireFormat, " + getter + ", bs );");
+                    out.println(indent + "rc += tightMarshalObjectArray1( wireFormat, " + getter + ", bs );");
                 }
             }
             else if (isThrowable(propertyType)) {
-                out.println("        rc += tightMarshalBrokerError1( wireFormat, " + getter + ".get(), bs );");
+                out.println(indent + "rc += tightMarshalBrokerError1( wireFormat, " + getter + ".get(), bs );");
             }
             else {
                 if (isCachedProperty(property)) {
-                    out.println("        rc += tightMarshalCachedObject1( wireFormat, " + getter + ".get(), bs );");
+                    out.println(indent + "rc += tightMarshalCachedObject1( wireFormat, " + getter + ".get(), bs );");
                 }
                 else {
-                    out.println("        rc += tightMarshalNestedObject1( wireFormat, " + getter + ".get(), bs );");
+                    out.println(indent + "rc += tightMarshalNestedObject1( wireFormat, " + getter + ".get(), bs );");
                 }
             }
+
+            if( version.asInt() > 1 ) {
+                out.println("        }");
+            }
         }
         return baseSize;
     }
@@ -266,63 +306,72 @@ public class AmqCppMarshallingClassesGen
         for ( JProperty property : getProperties() ) {
 
             JAnnotation annotation = property.getAnnotation("openwire:property");
+            JAnnotationValue version = annotation.getValue("version");
             JAnnotationValue size = annotation.getValue("size");
             JClass propertyType = property.getType();
             String type = propertyType.getSimpleName();
             String getter = "info->" + property.getGetter().getSimpleName() + "()";
+            String indent = "        ";
             count++;
 
+            if( version.asInt() > 1 ) {
+                indent = indent + "    ";
+                out.println("        if( wireVersion >= " + version.asInt() + " ) {");
+            }
+
             if (type.equals("boolean")) {
-                out.println("        bs->readBoolean();");
+                out.println(indent + "bs->readBoolean();");
             }
             else if (type.equals("byte")) {
-                out.println("        dataOut->write( " + getter + " );");
+                out.println(indent + "dataOut->write( " + getter + " );");
             }
             else if (type.equals("char")) {
-                out.println("        dataOut->write( " + getter + " );");
+                out.println(indent + "dataOut->write( " + getter + " );");
             }
             else if (type.equals("short")) {
-                out.println("        dataOut->writeShort( " + getter + " );");
+                out.println(indent + "dataOut->writeShort( " + getter + " );");
             }
             else if (type.equals("int")) {
-                out.println("        dataOut->writeInt( " + getter + " );");
+                out.println(indent + "dataOut->writeInt( " + getter + " );");
             }
             else if (type.equals("long")) {
-                out.println("        tightMarshalLong2( wireFormat, " + getter + ", dataOut, bs );");
+                out.println(indent + "tightMarshalLong2( wireFormat, " + getter + ", dataOut, bs );");
             }
             else if (type.equals("String")) {
-                out.println("        tightMarshalString2( " + getter + ", dataOut, bs );");
+                out.println(indent + "tightMarshalString2( " + getter + ", dataOut, bs );");
             }
             else if (type.equals("byte[]") || type.equals("ByteSequence")) {
                 if (size != null) {
-                    out.println("        dataOut->write( (const unsigned char*)(&" + getter + "[0]), " + size.asInt() + ", 0, " + size.asInt() + " );");
+                    out.println(indent + "dataOut->write( (const unsigned char*)(&" + getter + "[0]), " + size.asInt() + ", 0, " + size.asInt() + " );");
                 }
                 else {
-                    out.println("        if( bs->readBoolean() ) {");
-                    out.println("            dataOut->writeInt( (int)" + getter + ".size() );");
-                    out.println("            dataOut->write( (const unsigned char*)(&" + getter + "[0]), (int)" + getter + ".size(), 0, (int)" + getter + ".size() );");
-                    out.println("        }");
+                    out.println(indent + "if( bs->readBoolean() ) {");
+                    out.println(indent + "    dataOut->writeInt( (int)" + getter + ".size() );");
+                    out.println(indent + "    dataOut->write( (const unsigned char*)(&" + getter + "[0]), (int)" + getter + ".size(), 0, (int)" + getter + ".size() );");
+                    out.println(indent + "}");
                 }
             }
             else if (propertyType.isArrayType()) {
                 if (size != null) {
-                    out.println("        tightMarshalObjectArrayConstSize2( wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + " );");
+                    out.println(indent + "tightMarshalObjectArrayConstSize2( wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + " );");
                 }
                 else {
-                    out.println("        tightMarshalObjectArray2( wireFormat, " + getter + ", dataOut, bs );");
+                    out.println(indent + "tightMarshalObjectArray2( wireFormat, " + getter + ", dataOut, bs );");
                 }
-            }
-            else if( isThrowable(propertyType) ) {
-                out.println("        tightMarshalBrokerError2( wireFormat, " + getter + ".get(), dataOut, bs );");
-            }
-            else {
+            } else if( isThrowable(propertyType) ) {
+                out.println(indent + "tightMarshalBrokerError2( wireFormat, " + getter + ".get(), dataOut, bs );");
+            } else {
                 if( isCachedProperty(property) ) {
-                    out.println("        tightMarshalCachedObject2( wireFormat, "+getter+".get(), dataOut, bs );");
+                    out.println(indent + "tightMarshalCachedObject2( wireFormat, "+getter+".get(), dataOut, bs );");
                 }
                 else {
-                    out.println("        tightMarshalNestedObject2( wireFormat, "+getter+".get(), dataOut, bs );");
+                    out.println(indent + "tightMarshalNestedObject2( wireFormat, "+getter+".get(), dataOut, bs );");
                 }
             }
+
+            if( version.asInt() > 1 ) {
+                out.println("        }");
+            }
         }
     }
 
@@ -335,68 +384,79 @@ public class AmqCppMarshallingClassesGen
         for ( JProperty property : getProperties() ) {
 
             JAnnotation annotation = property.getAnnotation("openwire:property");
+            JAnnotationValue version = annotation.getValue("version");
             JAnnotationValue size = annotation.getValue("size");
             JClass propertyType = property.getType();
             String propertyTypeName = propertyType.getSimpleName();
+            String indent = "        ";
+
+            if( version.asInt() > 1 ) {
+                indent = indent + "    ";
+                out.println("        if( wireVersion >= " + version.asInt() + " ) {");
+            }
 
             if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
-                generateLooseUnmarshalBodyForArrayProperty(out, property, size);
+                generateLooseUnmarshalBodyForArrayProperty(out, property, size, indent);
             } else {
-                generateLooseUnmarshalBodyForProperty(out, property, size);
+                generateLooseUnmarshalBodyForProperty(out, property, size, indent);
+            }
+
+            if( version.asInt() > 1 ) {
+                out.println("        }");
             }
         }
     }
 
-    protected void generateLooseUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
+    protected void generateLooseUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size, String indent) {
 
         String type = property.getType().getSimpleName();
         String nativeType = toCppType(property.getType());
         String setter = property.getSetter().getSimpleName();
 
         if (type.equals("boolean")) {
-            out.println("        info->" + setter + "( dataIn->readBoolean() );");
+            out.println(indent + "info->" + setter + "( dataIn->readBoolean() );");
         }
         else if (type.equals("byte")) {
-            out.println("        info->" + setter + "( dataIn->readByte() );");
+            out.println(indent + "info->" + setter + "( dataIn->readByte() );");
         }
         else if (type.equals("char")) {
-            out.println("        info->" + setter + "( dataIn->readChar() );");
+            out.println(indent + "info->" + setter + "( dataIn->readChar() );");
         }
         else if (type.equals("short")) {
-            out.println("        info->" + setter + "( dataIn->readShort() );");
+            out.println(indent + "info->" + setter + "( dataIn->readShort() );");
         }
         else if (type.equals("int")) {
-            out.println("        info->" + setter + "( dataIn->readInt() );");
+            out.println(indent + "info->" + setter + "( dataIn->readInt() );");
         }
         else if (type.equals("long")) {
-            out.println("        info->" + setter + "( looseUnmarshalLong( wireFormat, dataIn ) );");
+            out.println(indent + "info->" + setter + "( looseUnmarshalLong( wireFormat, dataIn ) );");
         }
         else if (type.equals("String")) {
-            out.println("        info->" + setter + "( looseUnmarshalString( dataIn ) );");
+            out.println(indent + "info->" + setter + "( looseUnmarshalString( dataIn ) );");
         }
         else if (type.equals("byte[]") || type.equals("ByteSequence")) {
             if (size != null) {
-                out.println("        info->" + setter + "( looseUnmarshalConstByteArray( dataIn, " + size.asInt() + " ) );");
+                out.println(indent + "info->" + setter + "( looseUnmarshalConstByteArray( dataIn, " + size.asInt() + " ) );");
             }
             else {
-                out.println("        info->" + setter + "( looseUnmarshalByteArray( dataIn ) );");
+                out.println(indent + "info->" + setter + "( looseUnmarshalByteArray( dataIn ) );");
             }
         }
         else if (isThrowable(property.getType())) {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
-            out.println("            looseUnmarshalBrokerError( wireFormat, dataIn ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >(");
+            out.println(indent + "    looseUnmarshalBrokerError( wireFormat, dataIn ) ) ) );");
         }
         else if (isCachedProperty(property)) {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >( ");
-            out.println("            looseUnmarshalCachedObject( wireFormat, dataIn ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >( ");
+            out.println(indent + "    looseUnmarshalCachedObject( wireFormat, dataIn ) ) ) );");
         }
         else {
-            out.println("        info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >( ");
-            out.println("            looseUnmarshalNestedObject( wireFormat, dataIn ) ) ) );");
+            out.println(indent + "info->" + setter + "( Pointer<"+nativeType+">( dynamic_cast< " + nativeType + "* >( ");
+            out.println(indent + "    looseUnmarshalNestedObject( wireFormat, dataIn ) ) ) );");
         }
     }
 
-    protected void generateLooseUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
+    protected void generateLooseUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size, String indent) {
         JClass propertyType = property.getType();
         String arrayType = propertyType.getArrayComponentType().getSimpleName();
         String setter = property.getSetter().getSimpleName();
@@ -404,26 +464,25 @@ public class AmqCppMarshallingClassesGen
 
         out.println();
         if (size != null) {
-            out.println("        {");
-            out.println("            " + arrayType + "[] value = new " + arrayType + "[" + size.asInt() + "];");
-            out.println("            " + "for( int i=0; i < " + size.asInt() + "; i++ ) {");
-            out.println("                value[i] = (" + arrayType + ") looseUnmarshalNestedObject( wireFormat, dataIn );");
-            out.println("            }");
-            out.println("            info->" + setter + "( value );");
-            out.println("        }");
+            out.println(indent + "{");
+            out.println(indent + "    " + arrayType + "[] value = new " + arrayType + "[" + size.asInt() + "];");
+            out.println(indent + "    for( int i=0; i < " + size.asInt() + "; i++ ) {");
+            out.println(indent + "        value[i] = (" + arrayType + ") looseUnmarshalNestedObject( wireFormat, dataIn );");
+            out.println(indent + "    }");
+            out.println(indent + "    info->" + setter + "( value );");
+            out.println(indent + "}");
         }
         else {
-            out.println("        if( dataIn->readBoolean() ) {");
-            out.println("            short size = dataIn->readShort();");
-            out.println("            info->" + getter + "().reserve( size );");
-            out.println("            for( int i = 0; i < size; i++ ) {");
-            out.println("                info->" + getter + "().push_back( Pointer<"+arrayType+">( dynamic_cast<" + arrayType + "* >(");
-            out.println("                    looseUnmarshalNestedObject( wireFormat, dataIn ) ) ) );");
-            out.println("            }");
-            out.println("        }");
-            out.println("        else {");
-            out.println("            info->" + getter + "().clear();");
-            out.println("        }");
+            out.println(indent + "if( dataIn->readBoolean() ) {");
+            out.println(indent + "    short size = dataIn->readShort();");
+            out.println(indent + "    info->" + getter + "().reserve( size );");
+            out.println(indent + "    for( int i = 0; i < size; i++ ) {");
+            out.println(indent + "        info->" + getter + "().push_back( Pointer<"+arrayType+">( dynamic_cast<" + arrayType + "* >(");
+            out.println(indent + "            looseUnmarshalNestedObject( wireFormat, dataIn ) ) ) );");
+            out.println(indent + "    }");
+            out.println(indent + "} else {");
+            out.println(indent + "    info->" + getter + "().clear();");
+            out.println(indent + "}");
         }
     }
 
@@ -433,63 +492,74 @@ public class AmqCppMarshallingClassesGen
         for ( JProperty property : getProperties() ) {
 
             JAnnotation annotation = property.getAnnotation("openwire:property");
+            JAnnotationValue version = annotation.getValue("version");
             JAnnotationValue size = annotation.getValue("size");
             JClass propertyType = property.getType();
             String type = propertyType.getSimpleName();
             String getter = "info->" + property.getGetter().getSimpleName() + "()";
+            String indent = "        ";
+
+            if( version.asInt() > 1 ) {
+                indent = indent + "    ";
+                out.println("        if( wireVersion >= " + version.asInt() + " ) {");
+            }
 
             if( type.equals( "boolean" ) ) {
-                out.println("        dataOut->writeBoolean( " + getter + " );");
+                out.println(indent + "dataOut->writeBoolean( " + getter + " );");
             }
             else if( type.equals("byte") ) {
-                out.println("        dataOut->write( " + getter + " );");
+                out.println(indent + "dataOut->write( " + getter + " );");
             }
             else if( type.equals("char") ) {
-                out.println("        dataOut->write( " + getter + " );");
+                out.println(indent + "dataOut->write( " + getter + " );");
             }
             else if( type.equals("short") ) {
-                out.println("        dataOut->writeShort( " + getter + " );");
+                out.println(indent + "dataOut->writeShort( " + getter + " );");
             }
             else if( type.equals("int")) {
-                out.println("        dataOut->writeInt( " + getter + " );");
+                out.println(indent + "dataOut->writeInt( " + getter + " );");
             }
             else if( type.equals("long") ) {
-                out.println("        looseMarshalLong( wireFormat, " + getter + ", dataOut );");
+                out.println(indent + "looseMarshalLong( wireFormat, " + getter + ", dataOut );");
             }
             else if( type.equals("String") ) {
-                out.println("        looseMarshalString( " + getter + ", dataOut );");
+                out.println(indent + "looseMarshalString( " + getter + ", dataOut );");
             }
             else if( type.equals("byte[]") || type.equals("ByteSequence") ) {
                 if(size != null) {
-                    out.println("        dataOut->write( (const unsigned char*)(&" + getter + "[0]), " + size.asInt() + ", 0, " + size.asInt() + " );");
+                    out.println(indent + "dataOut->write( (const unsigned char*)(&" + getter + "[0]), " + size.asInt() + ", 0, " + size.asInt() + " );");
                 }
                 else {
-                    out.println("        dataOut->write( " + getter + ".size() != 0 );");
-                    out.println("        if( " + getter + ".size() != 0 ) {");
-                    out.println("            dataOut->writeInt( (int)" + getter + ".size() );");
-                    out.println("            dataOut->write( (const unsigned char*)(&" + getter + "[0]), (int)" + getter + ".size(), 0, (int)" + getter + ".size() );");
-                    out.println("        }");
+                    out.println(indent + "dataOut->write( " + getter + ".size() != 0 );");
+                    out.println(indent + "if( " + getter + ".size() != 0 ) {");
+                    out.println(indent + "    dataOut->writeInt( (int)" + getter + ".size() );");
+                    out.println(indent + "    dataOut->write( (const unsigned char*)(&" + getter + "[0]), (int)" + getter + ".size(), 0, (int)" + getter + ".size() );");
+                    out.println(indent + "}");
                 }
             }
             else if( propertyType.isArrayType() ) {
                 if (size != null) {
-                    out.println("        looseMarshalObjectArrayConstSize( wireFormat, " + getter + ", dataOut, " + size.asInt() + " );");
+                    out.println(indent + "looseMarshalObjectArrayConstSize( wireFormat, " + getter + ", dataOut, " + size.asInt() + " );");
                 }
                 else {
-                    out.println("        looseMarshalObjectArray( wireFormat, " + getter + ", dataOut );");
+                    out.println(indent + "looseMarshalObjectArray( wireFormat, " + getter + ", dataOut );");
                 }
             }
             else if( isThrowable( propertyType ) ) {
-                out.println("        looseMarshalBrokerError( wireFormat, " + getter + ".get(), dataOut );");
+                out.println(indent + "looseMarshalBrokerError( wireFormat, " + getter + ".get(), dataOut );");
             }
             else {
                 if( isCachedProperty( property ) ) {
-                    out.println("        looseMarshalCachedObject( wireFormat, "+getter+".get(), dataOut );");
+                    out.println(indent + "looseMarshalCachedObject( wireFormat, "+getter+".get(), dataOut );");
                 }
                 else {
-                    out.println("        looseMarshalNestedObject( wireFormat, "+getter+".get(), dataOut );");
+                    out.println(indent + "looseMarshalNestedObject( wireFormat, "+getter+".get(), dataOut );");
                 }
             }
+
+            if( version.asInt() > 1 ) {
+                out.println("        }");
+            }
         }
     }
 
@@ -498,7 +568,7 @@ public class AmqCppMarshallingClassesGen
         generateLicence(out);
 
 out.println("");
-out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/"+className+".h>");
+out.println("#include <activemq/wireformat/openwire/marshal/universal/"+className+".h>");
 out.println("");
 out.println("#include <activemq/commands/"+jclass.getSimpleName()+".h>");
 out.println("#include <activemq/exceptions/ActiveMQException.h>");
@@ -518,7 +588,7 @@ out.println("using namespace activemq::w
 out.println("using namespace activemq::wireformat::openwire;");
 out.println("using namespace activemq::wireformat::openwire::marshal;");
 out.println("using namespace activemq::wireformat::openwire::utils;");
-out.println("using namespace activemq::wireformat::openwire::marshal::v"+getOpenwireVersion()+";");
+out.println("using namespace activemq::wireformat::openwire::marshal::universal;");
 out.println("using namespace decaf;");
 out.println("using namespace decaf::io;");
 out.println("using namespace decaf::lang;");
@@ -561,6 +631,12 @@ out.println("        info->beforeUnmarsh
 out.println("");
     }
 
+    if( checkNeedsWireFormatVersion() ) {
+        out.println("");
+        out.println("        int wireVersion = wireFormat->getVersion();");
+        out.println("");
+    }
+
     generateTightUnmarshalBody(out);
 
     if( marshallerAware ) {
@@ -593,6 +669,12 @@ out.println("        info->beforeMarshal
 
 out.println("        int rc = "+baseClass+"::tightMarshal1( wireFormat, dataStructure, bs );");
 
+    if( checkNeedsWireFormatVersion() ) {
+        out.println("");
+        out.println("        int wireVersion = wireFormat->getVersion();");
+        out.println("");
+    }
+
     int baseSize = generateTightMarshal1Body(out);
 
 out.println("");
@@ -617,6 +699,12 @@ out.println("        "+properClassName+"
 out.println("            dynamic_cast<"+properClassName+"*>( dataStructure );");
     }
 
+    if( checkNeedsWireFormatVersion() ) {
+        out.println("");
+        out.println("        int wireVersion = wireFormat->getVersion();");
+        out.println("");
+    }
+
     generateTightMarshal2Body(out);
 
     if( marshallerAware ) {
@@ -646,6 +734,12 @@ out.println("            dynamic_cast<"+
 out.println("        info->beforeUnmarshal( wireFormat );");
     }
 
+    if( checkNeedsWireFormatVersion() ) {
+        out.println("");
+        out.println("        int wireVersion = wireFormat->getVersion();");
+        out.println("");
+    }
+
     generateLooseUnmarshalBody(out);
 
     if( marshallerAware ) {
@@ -675,7 +769,12 @@ out.println("        info->beforeMarshal
     }
 
 out.println("        "+baseClass+"::looseMarshal( wireFormat, dataStructure, dataOut );");
-out.println("");
+
+    if( checkNeedsWireFormatVersion() ) {
+        out.println("");
+        out.println("        int wireVersion = wireFormat->getVersion();");
+        out.println("");
+    }
 
     generateLooseMarshalBody(out);
 
@@ -694,7 +793,7 @@ out.println("");
     public void generateFactory(PrintWriter out) {
         generateLicence(out);
 
-out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/MarshallerFactory.h>");
+out.println("#include <activemq/wireformat/openwire/marshal/universal/MarshallerFactory.h>");
 
         List<JClass> list = new ArrayList<JClass>(getConcreteClasses());
         Collections.sort(list, new Comparator<JClass>(){
@@ -703,7 +802,7 @@ out.println("#include <activemq/wireform
         }});
 
         for ( JClass jclass : list ) {
-out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/"+jclass.getSimpleName()+"Marshaller.h>");
+out.println("#include <activemq/wireformat/openwire/marshal/universal/"+jclass.getSimpleName()+"Marshaller.h>");
         }
 
 out.println("");
@@ -722,7 +821,7 @@ out.println("using namespace activemq;")
 out.println("using namespace activemq::wireformat;");
 out.println("using namespace activemq::wireformat::openwire;");
 out.println("using namespace activemq::wireformat::openwire::marshal;");
-out.println("using namespace activemq::wireformat::openwire::marshal::v"+getOpenwireVersion()+";");
+out.println("using namespace activemq::wireformat::openwire::marshal::universal;");
 out.println("");
 out.println("///////////////////////////////////////////////////////////////////////////////");
 out.println("void MarshallerFactory::configure( OpenWireFormat* format ) {");

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingHeadersGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingHeadersGenerator.java?rev=955045&r1=955044&r2=955045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingHeadersGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/marshallers/AmqCppMarshallingHeadersGenerator.java Tue Jun 15 20:53:37 2010
@@ -77,7 +77,7 @@ public class AmqCppMarshallingHeadersGen
     public Object run() {
         filePostFix = getFilePostFix();
         if (destDir == null) {
-            destDir = new File(targetDir+"/activemq/wireformat/openwire/marshal/v"+getOpenwireVersion());
+            destDir = new File(targetDir+"/activemq/wireformat/openwire/marshal/universal");
         }
         Object answer = super.run();
         processFactory();
@@ -220,8 +220,8 @@ out.println(" */");
         generateLicence(out);
 
 out.println("");
-out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_");
-out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_");
+out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_");
+out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_");
 out.println("");
 out.println("// Turn off warning message for ignored exception specification");
 out.println("#ifdef _MSC_VER");
@@ -232,7 +232,7 @@ out.println("");
     if( baseClass.equals("BaseDataStreamMarshaller") ) {
         out.println("#include <activemq/wireformat/openwire/marshal/"+baseClass+".h>");
     } else {
-        out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/"+baseClass+".h>");
+        out.println("#include <activemq/wireformat/openwire/marshal/universal/"+baseClass+".h>");
     }
 
 out.println("");
@@ -248,7 +248,7 @@ out.println("namespace activemq{");
 out.println("namespace wireformat{");
 out.println("namespace openwire{");
 out.println("namespace marshal{");
-out.println("namespace v"+getOpenwireVersion()+"{");
+out.println("namespace universal{");
 out.println("");
 out.println("    /**");
 out.println("     * Marshaling code for Open Wire Format for "+className);
@@ -355,7 +355,7 @@ out.println("    };");
 out.println("");
 out.println("}}}}}");
 out.println("");
-out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_*/");
+out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_*/");
 out.println("");
         }
 
@@ -378,8 +378,8 @@ out.println("");
 
     public void generateFactory(PrintWriter out) {
         generateLicence(out);
-out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_MARSHALERFACTORY_H_");
-out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_MARSHALERFACTORY_H_");
+out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MARSHALERFACTORY_H_");
+out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MARSHALERFACTORY_H_");
 out.println("");
 out.println("//       Turn off warning message for ignored exception specification");
 out.println("#ifdef _MSC_VER");
@@ -392,7 +392,7 @@ out.println("namespace activemq{");
 out.println("namespace wireformat{");
 out.println("namespace openwire{");
 out.println("namespace marshal{");
-out.println("namespace v"+getOpenwireVersion()+"{");
+out.println("namespace universal{");
 out.println("");
 out.println("    /**");
 out.println("     * Used to create marshallers for a specific version of the wire");
@@ -413,7 +413,7 @@ out.println("    };");
 out.println("");
 out.println("}}}}}");
 out.println("");
-out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_V"+getOpenwireVersion()+"_MARSHALLERFACTORY_H_*/");
+out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_UNIVERSAL_MARSHALLERFACTORY_H_*/");
     }
 
     public List<JClass> getConcreteClasses() {

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingClassesGenerator.java?rev=955045&r1=955044&r2=955045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingClassesGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingClassesGenerator.java Tue Jun 15 20:53:37 2010
@@ -33,9 +33,9 @@ public class AmqCppTestMarshallingClasse
         generateLicence(out);
 
 out.println("");
-out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/"+className+".h>");
+out.println("#include <activemq/wireformat/openwire/marshal/universal/"+className+".h>");
 out.println("");
-out.println("#include <activemq/wireformat/openwire/marshal/v"+getOpenwireVersion()+"/"+super.getTargetClassName(jclass)+".h>");
+out.println("#include <activemq/wireformat/openwire/marshal/universal/"+super.getTargetClassName(jclass)+".h>");
 out.println("#include <activemq/commands/"+jclass.getSimpleName()+".h>");
 out.println("");
 out.println("#include <activemq/wireformat/openwire/OpenWireFormat.h>");
@@ -65,7 +65,7 @@ out.println("using namespace activemq::w
 out.println("using namespace activemq::wireformat::openwire;");
 out.println("using namespace activemq::wireformat::openwire::marshal;");
 out.println("using namespace activemq::wireformat::openwire::utils;");
-out.println("using namespace activemq::wireformat::openwire::marshal::v"+getOpenwireVersion()+";");
+out.println("using namespace activemq::wireformat::openwire::marshal::universal;");
 out.println("using namespace decaf::io;");
 out.println("using namespace decaf::lang;");
 out.println("using namespace decaf::util;");

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingHeadersGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingHeadersGenerator.java?rev=955045&r1=955044&r2=955045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingHeadersGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/tests/AmqCppTestMarshallingHeadersGenerator.java Tue Jun 15 20:53:37 2010
@@ -45,7 +45,7 @@ public class AmqCppTestMarshallingHeader
 
         filePostFix = getFilePostFix();
         if (destDir == null) {
-            destDir = new File(targetDir+"/activemq/wireformat/openwire/marshal/v"+getOpenwireVersion());
+            destDir = new File(targetDir+"/activemq/wireformat/openwire/marshal/universal");
         }
         return super.run();
     }
@@ -128,8 +128,8 @@ out.println(" */");
         generateLicence(out);
 
 out.println("");
-out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_");
-out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_");
+out.println("#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_");
+out.println("#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_");
 out.println("");
 out.println("// Turn off warning message for ignored exception specification");
 out.println("#ifdef _MSC_VER");
@@ -143,7 +143,7 @@ out.println("namespace activemq{");
 out.println("namespace wireformat{");
 out.println("namespace openwire{");
 out.println("namespace marshal{");
-out.println("namespace v"+getOpenwireVersion()+"{");
+out.println("namespace universal{");
 out.println("");
 out.println("    /**");
 out.println("     * Marshalling Test code for Open Wire Format for "+className);
@@ -176,7 +176,7 @@ out.println("    };");
 out.println("");
 out.println("}}}}}");
 out.println("");
-out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V"+getOpenwireVersion()+"_"+className.toUpperCase()+"_H_*/");
+out.println("#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_"+className.toUpperCase()+"_H_*/");
         }
 
     public String getTargetDir() {



Mime
View raw message