activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r741774 [17/17] - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/commands/ main/activemq/core/ main/activemq/exceptions/ main/activemq/state/ main/activemq/wireformat/openwire/marshal/ main/activemq/wireformat/openwire/marshal/v1/...
Date Fri, 06 Feb 2009 23:11:39 GMT
Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
Fri Feb  6 23:11:28 2009
@@ -53,6 +53,27 @@
         return ".cpp";
     }
 
+    public String toHeaderFileName( JClass type ) {
+        String name = type.getSimpleName();
+
+        if( name.equals( "String" ) ) {
+            return null;
+        } else if( type.isArrayType() ) {
+            JClass arrayClass = type.getArrayComponentType();
+            return toHeaderFileName( arrayClass );
+        } else if( name.equals( "Throwable" ) || name.equals( "Exception" ) ) {
+            return "BrokerError";
+        } else if( name.equals("BaseDataStructure" ) ){
+            return "DataStructure";
+        } else if( name.equals("ByteSequence") ) {
+            return "std::vector<unsigned char>";
+        } else if( !type.isPrimitiveType() ) {
+            return name;
+        } else {
+            return null;
+        }
+    }
+
     public String toCppType(JClass type) {
         String name = type.getSimpleName();
         if (name.equals("String")) {
@@ -65,9 +86,10 @@
             JClass arrayClass = type.getArrayComponentType();
 
             if( arrayClass.isPrimitiveType() ) {
-                return "std::vector<" + name.substring(0, name.length()-2) + ">";
+                return "std::vector<" + name.substring( 0, name.length()-2 ) + ">";
             } else {
-                return "std::vector<" + name.substring(0, name.length()-2) + "*>";
+                return "std::vector< decaf::lang::Pointer<" +
+                       name.substring( 0, name.length()-2 ) + "> >";
             }
         }
         else if( name.equals( "Throwable" ) || name.equals( "Exception" ) ) {
@@ -174,7 +196,9 @@
             String propertyName = property.getSimpleName();
             String parameterName = decapitalize(propertyName);
 
-            if( !type.startsWith("std::vector") ) {
+            if( property.getType().isPrimitiveType() ||
+                type.startsWith("std::string") ) {
+
 out.println("    this->"+parameterName+" = "+value+";");
             }
         }
@@ -191,25 +215,25 @@
 out.println(""+className+"::~"+className+"() {");
 out.println("");
 
-    for( Iterator iter = properties.iterator(); iter.hasNext(); ) {
-        JProperty property = (JProperty) iter.next();
-        String type = toCppType(property.getType());
-        String propertyName = property.getSimpleName();
-        String parameterName = decapitalize(propertyName);
-
-        if( property.getType().isPrimitiveType() ||
-            property.getType().getSimpleName().equals("String") ) {
-            continue;
-        }
-
-        if( !type.startsWith("std::vector" ) ) {
-out.println("    delete this->" + parameterName + ";");
-        } else if( type.contains( "*" ) ) {
-out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " < " +
parameterName + ".size(); ++i" + parameterName + " ) {");
-out.println("        delete " + parameterName + "[i" + parameterName + "];");
-out.println("    }");
-        }
-    }
+//    for( Iterator iter = properties.iterator(); iter.hasNext(); ) {
+//        JProperty property = (JProperty) iter.next();
+//        String type = toCppType(property.getType());
+//        String propertyName = property.getSimpleName();
+//        String parameterName = decapitalize(propertyName);
+//
+//        if( property.getType().isPrimitiveType() ||
+//            property.getType().getSimpleName().equals("String") ) {
+//            continue;
+//        }
+//
+//        if( !type.startsWith("std::vector" ) ) {
+//out.println("    delete this->" + parameterName + ";");
+//        } else if( type.contains( "*" ) ) {
+//out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " < "
+ parameterName + ".size(); ++i" + parameterName + " ) {");
+//out.println("        delete " + parameterName + "[i" + parameterName + "];");
+//out.println("    }");
+//        }
+//    }
 out.println("}");
 
 out.println("");
@@ -218,12 +242,12 @@
 
     String newInstance = decapitalize( className );
 
-out.println("    "+className+"* "+newInstance+" = new "+className+"();");
+out.println("    std::auto_ptr<"+className+"> "+newInstance+"( new "+className+"()
);");
 out.println("");
 out.println("    // Copy the data from the base class or classes");
 out.println("    "+newInstance+"->copyDataStructure( this );");
 out.println("");
-out.println("    return "+newInstance+";");
+out.println("    return "+newInstance+".release();");
 out.println("}");
 
 out.println("");
@@ -259,35 +283,41 @@
         String getter = property.getGetter().getSimpleName();
         String setter = property.getSetter().getSimpleName();
 
-        if( property.getType().isPrimitiveType() ||
-            type.equals("std::string") ||
-            property.getType().getSimpleName().equals("ByteSequence") ){
-    out.println("    this->"+setter+"( srcPtr->"+getter+"() );");
-        } else if( property.getType().isArrayType() &&
-                   !property.getType().getArrayComponentType().isPrimitiveType() ) {
-
-            String arrayType = property.getType().getArrayComponentType().getSimpleName();
-
-    out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " <
srcPtr->"+getter+"().size(); ++i" + parameterName + " ) {");
-    out.println("        if( srcPtr->"+getter+"()[i"+parameterName+"] != NULL ) {");
-    out.println("            this->"+getter+"().push_back(");
-    out.println("                dynamic_cast<"+arrayType+"*>(");
-    out.println("                    srcPtr->"+getter+"()[i"+parameterName+"]->cloneDataStructure()
) );");
-    out.println("        } else {");
-    out.println("            this->"+getter+"().push_back( NULL );");
-    out.println("        }");
-    out.println("    }");
-        } else if( property.getType().isArrayType() &&
-                   property.getType().getArrayComponentType().isPrimitiveType() ) {
-    out.println("    this->"+setter+"( srcPtr->"+getter+"() );");
-        } else {
-    out.println("    if( srcPtr->"+getter+"() != NULL ) {");
-    out.println("        this->"+setter+"(");
-    out.println("            dynamic_cast<"+type+"*>(");
-    out.println("                srcPtr->"+getter+"()->cloneDataStructure() ) );");
-    out.println("    }");
+//        if( property.getType().isPrimitiveType() ||
+//            type.equals("std::string") ||
+//            property.getType().getSimpleName().equals("ByteSequence") ){
+
+out.println("    this->"+setter+"( srcPtr->"+getter+"() );");
+
+//        } else if( property.getType().isArrayType() &&
+//                   !property.getType().getArrayComponentType().isPrimitiveType() ) {
+//
+//            String arrayType = property.getType().getArrayComponentType().getSimpleName();
+//
+//out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " < srcPtr->"+getter+"().size();
++i" + parameterName + " ) {");
+//out.println("        if( srcPtr->"+getter+"()[i"+parameterName+"] != NULL ) {");
+//out.println("            this->"+getter+"().push_back(");
+//out.println("                dynamic_cast<"+arrayType+"*>(");
+//out.println("                    srcPtr->"+getter+"()[i"+parameterName+"]->cloneDataStructure()
) );");
+//out.println("        } else {");
+//out.println("            this->"+getter+"().push_back( NULL );");
+//out.println("        }");
+//out.println("    }");
+//
+//        } else if( property.getType().isArrayType() &&
+//                   property.getType().getArrayComponentType().isPrimitiveType() ) {
+//
+//out.println("    this->"+setter+"( srcPtr->"+getter+"() );");
+//
+//        } else {
+//
+//out.println("    if( srcPtr->"+getter+"() != NULL ) {");
+//out.println("        this->"+setter+"(");
+//out.println("            dynamic_cast<"+type+"*>(");
+//out.println("                srcPtr->"+getter+"()->cloneDataStructure() ) );");
+//out.println("    }");
         }
-    }
+//    }
 
 out.println("}");
 out.println("");
@@ -400,8 +430,7 @@
 out.println("        }" );
 out.println("    }" );
 
-    } else if( property.getType().isPrimitiveType() ||
-               type.equals("std::string") ){
+    } else if( property.getType().isPrimitiveType() || type.equals("std::string") ){
 
 out.println("    if( this->"+getter+"() != valuePtr->"+getter+"() ) {");
 out.println("        return false;" );
@@ -414,7 +443,7 @@
 
 out.println("    for( size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size();
++i" + parameterName + " ) {");
 out.println("        if( this->"+getter+"()[i"+parameterName+"] != NULL ) {" );
-out.println("            if( !this->"+getter+"()[i"+parameterName+"]->equals( valuePtr->"+getter+"()[i"+parameterName+"]
) ) {" );
+out.println("            if( !this->"+getter+"()[i"+parameterName+"]->equals( valuePtr->"+getter+"()[i"+parameterName+"].get()
) ) {" );
 out.println("                return false;");
 out.println("            }");
 out.println("        } else if( valuePtr->"+getter+"()[i"+parameterName+"] != NULL ) {");
@@ -430,7 +459,7 @@
 out.println("    }");
     } else {
 out.println("    if( this->"+getter+"() != NULL ) {");
-out.println("        if( !this->"+getter+"()->equals( valuePtr->"+getter+"() ) )
{" );
+out.println("        if( !this->"+getter+"()->equals( valuePtr->"+getter+"().get()
) ) {" );
 out.println("            return false;");
 out.println("        }");
 out.println("    } else if( valuePtr->"+getter+"() != NULL ) {");
@@ -465,7 +494,7 @@
    if( baseClass.equals( "BaseCommand" ) ) {
 out.println("");
 out.println("////////////////////////////////////////////////////////////////////////////////");
-out.println("commands::Command* "+className+"::visit( activemq::state::CommandVisitor* visitor
) ");
+out.println("decaf::lang::Pointer<commands::Command> "+className+"::visit( activemq::state::CommandVisitor*
visitor ) ");
 out.println("    throw( exceptions::ActiveMQException ) {");
 out.println("");
 out.println("    return visitor->process"+className+"( this );");
@@ -486,7 +515,9 @@
                 !property.getType().getSimpleName().equals("String") &&
                 !type.startsWith("std::vector") ) {
 
-                type = type + "*";
+                type = "decaf::lang::Pointer<" + type + ">&";
+                constNess = "const ";
+//                type = type + "*";
             } else if( property.getType().getSimpleName().equals("String") ||
                        type.startsWith( "std::vector") ) {
                 type = type + "&";

Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java
Fri Feb  6 23:11:28 2009
@@ -52,6 +52,7 @@
 out.println("");
 out.println("#include <activemq/util/Config.h>");
 out.println("#include <activemq/commands/"+baseClass+".h>");
+out.println("#include <decaf/lang/Pointer.h>");
 
         if( comparable ) {
 out.println("#include <decaf/lang/Comparable.h>");
@@ -64,18 +65,10 @@
         !property.getType().getSimpleName().equals("String") &&
         !property.getType().getSimpleName().equals("ByteSequence") )
     {
-        String includeName = toCppType(property.getType());
-        if( property.getType().isArrayType() )
-        {
-            JClass arrayType = property.getType().getArrayComponentType();
-            if( arrayType.isPrimitiveType() )
-                continue;
+        String includeName = toHeaderFileName( property.getType() );
+        if( includeName != null ) {
+            out.println("#include <activemq/commands/"+includeName+".h>");
         }
-        if( includeName.startsWith("std::vector") ) {
-            includeName = includeName.substring(12, includeName.length()-2);
-        }
-
-        out.println("#include <activemq/commands/"+includeName+".h>");
     }
 }
 
@@ -123,7 +116,7 @@
                 !property.getType().getSimpleName().equals("String") &&
                 !type.startsWith("std::vector") ) {
 
-                type = type + "*";
+                type = "decaf::lang::Pointer<" + type + ">";
             }
 
             out.println("        "+type+" "+name+";");
@@ -144,6 +137,10 @@
 out.println("");
 out.println("        const static unsigned char ID_"+typeName+" = "+getOpenWireOpCode(jclass)+";");
 out.println("");
+        if( comparable ) {
+out.println("        typedef decaf::lang::PointerComparator<"+className+"> COMPARATOR;");
+out.println("");
+        }
 out.println("    public:");
 out.println("");
 out.println("        "+className+"();");
@@ -209,7 +206,7 @@
 out.println("         * " );
 out.println("         * @return a Response to the visitor being called or NULL if no response."
);
 out.println("         */" );
-out.println("        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor
)" );
+out.println("        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor*
visitor )" );
 out.println("            throw( exceptions::ActiveMQException );" );
 out.println("");
 
@@ -227,7 +224,8 @@
                 !property.getType().getSimpleName().equals("String") &&
                 !type.startsWith("std::vector") ) {
 
-                    type = type + "*";
+                    type = "decaf::lang::Pointer<" + type + ">&";
+                    constness = "const ";
             } else if( property.getType().getSimpleName().equals("String") ||
                        type.startsWith("std::vector") ) {
 

Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java
Fri Feb  6 23:11:28 2009
@@ -144,16 +144,16 @@
             }
         }
         else if( isThrowable( property.getType() ) ) {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >(");
-            out.println("            tightUnmarshalBrokerError( wireFormat, dataIn, bs )
) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >(");
+            out.println("            tightUnmarshalBrokerError( wireFormat, dataIn, bs )
) ) );");
         }
         else if( isCachedProperty(property) ) {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >(");
-            out.println("            tightUnmarshalCachedObject( wireFormat, dataIn, bs )
) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >(");
+            out.println("            tightUnmarshalCachedObject( wireFormat, dataIn, bs )
) ) );");
         }
         else {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >(");
-            out.println("            tightUnmarshalNestedObject( wireFormat, dataIn, bs )
) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >(");
+            out.println("            tightUnmarshalNestedObject( wireFormat, dataIn, bs )
) ) );");
         }
     }
 
@@ -177,8 +177,8 @@
             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( dynamic_cast<
" + arrayType + "* >(");
-            out.println("                    tightUnmarshalNestedObject( wireFormat, dataIn,
bs ) ) );");
+            out.println("                info->" + getter + "().push_back( Pointer<"+arrayType+">(
dynamic_cast< " + arrayType + "* >(");
+            out.println("                    tightUnmarshalNestedObject( wireFormat, dataIn,
bs ) ) ) );");
             out.println("            }");
             out.println("        }");
             out.println("        else {");
@@ -238,14 +238,14 @@
                 }
             }
             else if (isThrowable(propertyType)) {
-                out.println("        rc += tightMarshalBrokerError1( wireFormat, " + getter
+ ", bs );");
+                out.println("        rc += tightMarshalBrokerError1( wireFormat, " + getter
+ ".get(), bs );");
             }
             else {
                 if (isCachedProperty(property)) {
-                    out.println("        rc += tightMarshalCachedObject1( wireFormat, " +
getter + ", bs );");
+                    out.println("        rc += tightMarshalCachedObject1( wireFormat, " +
getter + ".get(), bs );");
                 }
                 else {
-                    out.println("        rc += tightMarshalNestedObject1( wireFormat, " +
getter + ", bs );");
+                    out.println("        rc += tightMarshalNestedObject1( wireFormat, " +
getter + ".get(), bs );");
                 }
             }
         }
@@ -305,14 +305,14 @@
                 }
             }
             else if( isThrowable(propertyType) ) {
-                out.println("        tightMarshalBrokerError2( wireFormat, " + getter + ",
dataOut, bs );");
+                out.println("        tightMarshalBrokerError2( wireFormat, " + getter + ".get(),
dataOut, bs );");
             }
             else {
                 if( isCachedProperty(property) ) {
-                    out.println("        tightMarshalCachedObject2( wireFormat, "+getter+",
dataOut, bs );");
+                    out.println("        tightMarshalCachedObject2( wireFormat, "+getter+".get(),
dataOut, bs );");
                 }
                 else {
-                    out.println("        tightMarshalNestedObject2( wireFormat, "+getter+",
dataOut, bs );");
+                    out.println("        tightMarshalNestedObject2( wireFormat, "+getter+".get(),
dataOut, bs );");
                 }
             }
         }
@@ -359,16 +359,16 @@
             }
         }
         else if (isThrowable(property.getType())) {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >(");
-            out.println("            looseUnmarshalBrokerError( wireFormat, dataIn ) ) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >(");
+            out.println("            looseUnmarshalBrokerError( wireFormat, dataIn ) ) )
);");
         }
         else if (isCachedProperty(property)) {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >( ");
-            out.println("            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >( ");
+            out.println("            looseUnmarshalCachedObject( wireFormat, dataIn ) ) )
);");
         }
         else {
-            out.println("        info->" + setter + "( dynamic_cast< " + nativeType
+ "* >( ");
-            out.println("            looseUnmarshalNestedObject( wireFormat, dataIn ) ) );");
+            out.println("        info->" + setter + "( Pointer<"+nativeType+">(
dynamic_cast< " + nativeType + "* >( ");
+            out.println("            looseUnmarshalNestedObject( wireFormat, dataIn ) ) )
);");
         }
     }
 
@@ -394,8 +394,8 @@
             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( dynamic_cast<"
+ arrayType + "* >(");
-            out.println("                    looseUnmarshalNestedObject( wireFormat, dataIn
) ) );");
+            out.println("                info->" + getter + "().push_back( Pointer<"+arrayType+">(
dynamic_cast<" + arrayType + "* >(");
+            out.println("                    looseUnmarshalNestedObject( wireFormat, dataIn
) ) ) );");
             out.println("            }");
             out.println("        }");
             out.println("        else {");
@@ -457,14 +457,14 @@
                 }
             }
             else if( isThrowable( propertyType ) ) {
-                out.println("        looseMarshalBrokerError( wireFormat, " + getter + ",
dataOut );");
+                out.println("        looseMarshalBrokerError( wireFormat, " + getter + ".get(),
dataOut );");
             }
             else {
                 if( isCachedProperty( property ) ) {
-                    out.println("        looseMarshalCachedObject( wireFormat, "+getter+",
dataOut );");
+                    out.println("        looseMarshalCachedObject( wireFormat, "+getter+".get(),
dataOut );");
                 }
                 else {
-                    out.println("        looseMarshalNestedObject( wireFormat, "+getter+",
dataOut );");
+                    out.println("        looseMarshalNestedObject( wireFormat, "+getter+".get(),
dataOut );");
                 }
             }
         }
@@ -479,6 +479,7 @@
 out.println("");
 out.println("#include <activemq/commands/"+jclass.getSimpleName()+".h>");
 out.println("#include <activemq/exceptions/ActiveMQException.h>");
+out.println("#include <decaf/lang/Pointer.h>");
 out.println("");
 out.println("//");
 out.println("//     NOTE!: This file is autogenerated - do not modify!");
@@ -497,6 +498,7 @@
 out.println("using namespace activemq::wireformat::openwire::marshal::v"+getOpenwireVersion()+";");
 out.println("using namespace decaf;");
 out.println("using namespace decaf::io;");
+out.println("using namespace decaf::lang;");
 out.println("");
 
     String typeName = jclass.getSimpleName().toUpperCase();

Modified: activemq/activemq-cpp/trunk/src/test/activemq/commands/ActiveMQMessageTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/commands/ActiveMQMessageTest.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/commands/ActiveMQMessageTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/commands/ActiveMQMessageTest.h Fri Feb 
6 23:11:28 2009
@@ -44,7 +44,7 @@
              * @param message Message to Acknowlegde
              * @throw CMSException
              */
-            virtual void acknowledgeMessage( const core::ActiveMQMessage* message )
+            virtual void acknowledgeMessage( const commands::Message* message )
                 throw ( cms::CMSException ) {
 
                 this->wasAcked = true;

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h Fri Feb  6
23:11:28 2009
@@ -24,11 +24,11 @@
 #include <cms/Connection.h>
 #include <cms/ExceptionListener.h>
 
-#include <activemq/core/ActiveMQMessage.h>
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/DefaultTransportListener.h>
 #include <activemq/util/Config.h>
 #include <activemq/core/ActiveMQConnection.h>
+#include <activemq/commands/Message.h>
 
 namespace activemq{
 namespace core{
@@ -82,7 +82,7 @@
         {
         public:
 
-            std::vector<ActiveMQMessage*> messages;
+            std::vector< decaf::lang::Pointer<commands::Message> > messages;
 
         public:
             virtual ~MyDispatcher(){}

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp Fri Feb  6
23:11:28 2009
@@ -31,11 +31,14 @@
 #include <activemq/core/ActiveMQProducer.h>
 #include <decaf/util/Properties.h>
 #include <decaf/util/Date.h>
+#include <decaf/lang/Pointer.h>
 
 using namespace std;
 using namespace activemq;
 using namespace activemq::core;
 using namespace activemq::commands;
+using namespace decaf;
+using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQSessionTest::testAutoAcking() {
@@ -518,14 +521,14 @@
                                              const long long timeStamp,
                                              const long long timeToLive )
 {
-    ActiveMQTextMessage* msg = new ActiveMQTextMessage();
+    Pointer<ActiveMQTextMessage> msg( new ActiveMQTextMessage() );
 
-    ProducerId* producerId = new ProducerId();
+    Pointer<ProducerId> producerId( new ProducerId() );
     producerId->setConnectionId( id.getConnectionId() );
     producerId->setSessionId( id.getSessionId() );
     producerId->setValue( 1 );
 
-    MessageId* messageId = new MessageId();
+    Pointer<MessageId> messageId( new MessageId() );
     messageId->setProducerId( producerId );
     messageId->setProducerSequenceId( 2 );
 
@@ -552,7 +555,7 @@
 
     MessageDispatch* dispatch = new MessageDispatch();
     dispatch->setMessage( msg );
-    dispatch->setConsumerId( id.cloneDataStructure() );
+    dispatch->setConsumerId( Pointer<ConsumerId>( id.cloneDataStructure() ) );
 
     dTransport->fireCommand( dispatch );
 }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp Fri Feb  6
23:11:28 2009
@@ -46,8 +46,8 @@
 
     virtual unsigned char getDataStructureType() const { return 1; }
 
-    virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
-        throw( exceptions::ActiveMQException ) { return NULL; }
+    virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor*
visitor )
+        throw( exceptions::ActiveMQException ) { return decaf::lang::Pointer<commands::Command>();
}
 
     virtual std::string toString() const{ return ""; }
     virtual MyCommand* cloneDataStructure() const{

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
Fri Feb  6 23:11:28 2009
@@ -57,8 +57,8 @@
 
             virtual unsigned char getDataStructureType() const { return 1; }
 
-            virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
-                throw( exceptions::ActiveMQException ) { return NULL; }
+            virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor*
visitor )
+                throw( exceptions::ActiveMQException ) { return decaf::lang::Pointer<commands::Command>();
}
 
             virtual MyCommand* cloneDataStructure() const{
                 MyCommand* command = new MyCommand;



Mime
View raw message