out.println("#include <string>");
out.println("#include \"activemq/command/"+baseClass+".hpp\"");
List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next();
if( !property.getType().isPrimitiveType() &&
!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 ;
}
if( includeName.startsWith("array<") )
includeName = includeName.substring(6, includeName.length()-1);
else if( includeName.startsWith("p<") )
includeName = includeName.substring(2, includeName.length()-1);
if( includeName.equals("IDataStructure") ) {
out.println("#include \"activemq/"+includeName+".hpp\"");
} else {
out.println("#include \"activemq/command/"+includeName+".hpp\"");
}
}
}
out.println("");
out.println("#include \"activemq/protocol/IMarshaller.hpp\"");
out.println("#include \"ppr/io/IOutputStream.hpp\"");
out.println("#include \"ppr/io/IInputStream.hpp\"");
out.println("#include \"ppr/io/IOException.hpp\"");
out.println("#include \"ppr/util/ifr/array\"");
out.println("#include \"ppr/util/ifr/p\"");
out.println("");
out.println("namespace apache");
out.println("{");
out.println(" namespace activemq");
out.println(" {");
out.println(" namespace command");
out.println(" {");
out.println(" using namespace ifr;");
out.println(" using namespace std;");
out.println(" using namespace apache::activemq;");
out.println(" using namespace apache::activemq::protocol;");
out.println(" using namespace apache::ppr::io;");
out.println("");
out.println("/*");
out.println(" *");
out.println(" * Command and marshalling code for OpenWire format for "+className+"");
out.println(" *");
out.println(" *");
out.println(" * NOTE!: This file is autogenerated - do not modify!");
out.println(" * if you need to make a change, please see the Groovy scripts in the");
out.println(" * activemq-core module");
out.println(" *");
out.println(" */");
out.println("class "+className+" : public "+baseClass+"");
out.println("{");
out.println("protected:");
for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next();
String type = toCppType(property.getType());
String name = decapitalize(property.getSimpleName());
out.println(" "+type+" "+name+" ;");
}
out.println("");
out.println("public:");
out.println(" const static unsigned char TYPE = "+getOpenWireOpCode(jclass)+";");
out.println("");
out.println("public:");
out.println(" "+className+"() ;");
out.println(" virtual ~"+className+"() ;");
out.println("");
out.println(" virtual unsigned char getDataStructureType() ;");
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);
out.println("");
out.println(" virtual "+type+" get"+propertyName+"() ;");
out.println(" virtual void set"+propertyName+"("+type+" "+parameterName+") ;");
}