activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r503428 - /activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java
Date Sun, 04 Feb 2007 16:01:07 GMT
Author: tabish
Date: Sun Feb  4 08:01:06 2007
New Revision: 503428

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java

Modified: activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java?view=diff&rev=503428&r1=503427&r2=503428
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/openwire-scripts/AmqCppMarshallingClassesGenerator.java
Sun Feb  4 08:01:06 2007
@@ -48,6 +48,31 @@
         return className;
     }
     
+    protected boolean checkNeedsInfoPointer() {
+        
+        if( isMarshallerAware() ){
+            return true;
+        }
+        
+        List properties = getProperties();
+        for (Iterator iter = properties.iterator(); iter.hasNext();) {
+            JProperty property = (JProperty) iter.next();
+            JClass propertyType = property.getType();
+            String type = propertyType.getSimpleName();
+            
+            if( !( type.equals("byte") ) &&
+                !( type.equals("char") ) &&
+                !( type.equals("short") ) &&
+                !( type.equals("int") ) ) {
+                
+                return true;
+            }
+            
+        }
+        
+        return false;
+    }
+    
     //////////////////////////////////////////////////////////////////////////////////////
     // This section is for the tight wire format encoding generator
     //////////////////////////////////////////////////////////////////////////////////////
@@ -489,7 +514,8 @@
 out.println("int "+className+"::tightMarshal1( OpenWireFormat* wireFormat, DataStructure*
dataStructure, BooleanStream* bs ) throw( io::IOException ) {");
 out.println("");
 
-    if( !properties.isEmpty()  || marshallerAware ) { 
+//    if( !properties.isEmpty()  || marshallerAware ) { 
+    if( checkNeedsInfoPointer() ) {
         String properClassName = getProperClassName( jclass.getSimpleName() );
 out.println("    "+properClassName+"* info ="); 
 out.println("        dynamic_cast<"+properClassName+"*>( dataStructure );");



Mime
View raw message