You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/03/24 22:29:17 UTC
svn commit: r1460466 [1/2] - in
/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator: ./
src/main/java/org/apache/activemq/openwire/tool/commands/
src/main/java/org/apache/activemq/openwire/tool/marshallers/
Author: tabish
Date: Sun Mar 24 21:29:16 2013
New Revision: 1460466
URL: http://svn.apache.org/r1460466
Log:
Updates for the source code generator
Modified:
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/pom.xml
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionInfoSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerInfoSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerInfoSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdHeaderGenerator.java
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdSourceGenerator.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
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/pom.xml?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/pom.xml (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/pom.xml Sun Mar 24 21:29:16 2013
@@ -53,6 +53,15 @@
<value>Sun Microsystems Inc.</value>
</property>
</activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.4.2</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGenerator.java Sun Mar 24 21:29:16 2013
@@ -37,6 +37,7 @@ public abstract class CommandCodeGenerat
private boolean comparable = false;
private boolean assignable = false;
private boolean genIsClass = false;
+ private boolean hashable = false;
public abstract void generate( PrintWriter out );
@@ -76,6 +77,14 @@ public abstract class CommandCodeGenerat
this.comparable = comparable;
}
+ public boolean isHashable() {
+ return hashable;
+ }
+
+ public void setHashable(boolean hashable) {
+ this.hashable = hashable;
+ }
+
public boolean isAssignable() {
return assignable;
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java Sun Mar 24 21:29:16 2013
@@ -36,30 +36,30 @@ public class CommandCodeGeneratorsFactor
* method call to override the virtual method in the base Command interface.
*/
{
- commandsWithShortcuts = new HashSet<String>();
- commandsWithShortcuts.add("BrokerInfo");
- commandsWithShortcuts.add("ControlCommand");
- commandsWithShortcuts.add("ConnectionControl");
- commandsWithShortcuts.add("ConnectionError");
- commandsWithShortcuts.add("ConnectionInfo");
- commandsWithShortcuts.add("ConsumerControl");
- commandsWithShortcuts.add("ConsumerInfo");
- commandsWithShortcuts.add("FlushCommand");
- commandsWithShortcuts.add("KeepAliveInfo");
- commandsWithShortcuts.add("Message");
- commandsWithShortcuts.add("MessageAck");
- commandsWithShortcuts.add("MessageDispatch");
- commandsWithShortcuts.add("MessageDispatchNotification");
- commandsWithShortcuts.add("MessagePull");
- commandsWithShortcuts.add("RemoveInfo");
- commandsWithShortcuts.add("RemoveSubscriptionInfo");
- commandsWithShortcuts.add("ReplayCommand");
- commandsWithShortcuts.add("Response");
- commandsWithShortcuts.add("ProducerAck");
- commandsWithShortcuts.add("ProducerInfo");
- commandsWithShortcuts.add("ShutdownInfo");
- commandsWithShortcuts.add("TransactionInfo");
- commandsWithShortcuts.add("WireFormatInfo");
+ commandsWithShortcuts = new HashSet<String>();
+ commandsWithShortcuts.add("BrokerInfo");
+ commandsWithShortcuts.add("ControlCommand");
+ commandsWithShortcuts.add("ConnectionControl");
+ commandsWithShortcuts.add("ConnectionError");
+ commandsWithShortcuts.add("ConnectionInfo");
+ commandsWithShortcuts.add("ConsumerControl");
+ commandsWithShortcuts.add("ConsumerInfo");
+ commandsWithShortcuts.add("FlushCommand");
+ commandsWithShortcuts.add("KeepAliveInfo");
+ commandsWithShortcuts.add("Message");
+ commandsWithShortcuts.add("MessageAck");
+ commandsWithShortcuts.add("MessageDispatch");
+ commandsWithShortcuts.add("MessageDispatchNotification");
+ commandsWithShortcuts.add("MessagePull");
+ commandsWithShortcuts.add("RemoveInfo");
+ commandsWithShortcuts.add("RemoveSubscriptionInfo");
+ commandsWithShortcuts.add("ReplayCommand");
+ commandsWithShortcuts.add("Response");
+ commandsWithShortcuts.add("ProducerAck");
+ commandsWithShortcuts.add("ProducerInfo");
+ commandsWithShortcuts.add("ShutdownInfo");
+ commandsWithShortcuts.add("TransactionInfo");
+ commandsWithShortcuts.add("WireFormatInfo");
}
/**
@@ -75,13 +75,14 @@ public class CommandCodeGeneratorsFactor
CommandCodeGenerator generator = null;
generator = this.getCodeGenerator( className, "Header" );
- if( className.endsWith("Id") ) {
- generator.setComparable( true );
- generator.setAssignable( true );
+ if (className.endsWith("Id")) {
+ generator.setComparable(true);
+ generator.setAssignable(true);
+ generator.setHashable(true);
}
- if( this.commandsWithShortcuts.contains( className ) ) {
- generator.setGenIsClass( true );
+ if (this.commandsWithShortcuts.contains(className)) {
+ generator.setGenIsClass(true);
}
return generator;
@@ -99,10 +100,11 @@ public class CommandCodeGeneratorsFactor
CommandCodeGenerator generator = null;
- generator = this.getCodeGenerator( className, "Source" );
- if( className.endsWith("Id") ) {
- generator.setComparable( true );
- generator.setAssignable( true );
+ generator = this.getCodeGenerator(className, "Source");
+ if (className.endsWith("Id")) {
+ generator.setComparable(true);
+ generator.setAssignable(true);
+ generator.setHashable(true);
}
return generator;
@@ -117,16 +119,19 @@ public class CommandCodeGeneratorsFactor
*
* @return a new Header File code generator.
*/
- public CommandCodeGenerator getCodeGenerator( String className, String fileType ) {
+ public CommandCodeGenerator getCodeGenerator(String className, String fileType) {
Class<?> generatorClass = null;
try {
- generatorClass = Class.forName( "org.apache.activemq.openwire.tool.commands." + className + fileType + "Generator" );
- } catch( ClassNotFoundException e ) {
+ generatorClass = Class.forName("org.apache.activemq.openwire.tool.commands." +
+ className + fileType + "Generator");
+ } catch (ClassNotFoundException e) {
try {
- generatorClass = Class.forName( "org.apache.activemq.openwire.tool.commands.Command" + fileType + "Generator" );
- } catch(ClassNotFoundException e1) {
+ generatorClass = Class
+ .forName("org.apache.activemq.openwire.tool.commands.Command"
+ + fileType + "Generator");
+ } catch (ClassNotFoundException e1) {
e1.printStackTrace();
return null;
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -69,8 +69,8 @@ public class CommandHeaderGenerator exte
if( !isAssignable() ) {
out.println(" private:");
out.println("");
- out.println(" "+getClassName()+"( const "+getClassName()+"& );");
- out.println(" "+getClassName()+"& operator= ( const "+getClassName()+"& );");
+ out.println(" "+getClassName()+"(const "+getClassName()+"&);");
+ out.println(" "+getClassName()+"& operator= (const "+getClassName()+"&);");
out.println("");
}
@@ -80,7 +80,7 @@ public class CommandHeaderGenerator exte
out.println("");
if( isAssignable() ) {
- out.println(" "+getClassName()+"( const "+getClassName()+"& other );");
+ out.println(" "+getClassName()+"(const "+getClassName()+"& other);");
out.println("");
}
@@ -92,29 +92,34 @@ public class CommandHeaderGenerator exte
out.println("");
out.println(" virtual "+getClassName()+"* cloneDataStructure() const;");
out.println("");
- out.println(" virtual void copyDataStructure( const DataStructure* src );");
+ out.println(" virtual void copyDataStructure(const DataStructure* src);");
out.println("");
out.println(" virtual std::string toString() const;");
out.println("");
- out.println(" virtual bool equals( const DataStructure* value ) const;" );
+ out.println(" virtual bool equals(const DataStructure* value) const;" );
out.println("");
generateAdditonalMembers( out );
generatePropertyAccessors( out );
if( isComparable() ) {
- out.println(" virtual int compareTo( const "+getClassName()+"& value ) const;");
+ out.println(" virtual int compareTo(const "+getClassName()+"& value) const;");
out.println("");
- out.println(" virtual bool equals( const "+getClassName()+"& value ) const;");
+ out.println(" virtual bool equals(const "+getClassName()+"& value) const;");
out.println("");
- out.println(" virtual bool operator==( const "+getClassName()+"& value ) const;");
+ out.println(" virtual bool operator==(const "+getClassName()+"& value) const;");
out.println("");
- out.println(" virtual bool operator<( const "+getClassName()+"& value ) const;");
+ out.println(" virtual bool operator<(const "+getClassName()+"& value) const;");
out.println("");
}
if( isAssignable() ) {
- out.println(" "+getClassName()+"& operator= ( const "+getClassName()+"& other );");
+ out.println(" "+getClassName()+"& operator= (const "+getClassName()+"& other);");
+ out.println("");
+ }
+
+ if( isHashable() ) {
+ out.println(" int getHashCode() const;");
out.println("");
}
@@ -129,7 +134,7 @@ public class CommandHeaderGenerator exte
}
if( getBaseClassName().equals( "BaseCommand" ) ) {
- out.println(" virtual Pointer<Command> visit( activemq::state::CommandVisitor* visitor );" );
+ out.println(" virtual Pointer<Command> visit(activemq::state::CommandVisitor* visitor);" );
out.println("");
}
@@ -178,8 +183,8 @@ public class CommandHeaderGenerator exte
}
protected void generateNamespaceWrapper( PrintWriter out ) {
- out.println("namespace activemq{");
- out.println("namespace commands{");
+ out.println("namespace activemq {");
+ out.println("namespace commands {");
out.println("");
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -43,6 +43,9 @@ public class CommandSourceGenerator exte
out.println("using namespace activemq::commands;");
out.println("using namespace decaf::lang;");
out.println("using namespace decaf::lang::exceptions;");
+ if( isComparable() ) {
+ out.println("using namespace decaf::internal::util;");
+ }
out.println("");
out.println("/*");
out.println(" *");
@@ -55,18 +58,18 @@ public class CommandSourceGenerator exte
out.println(" */");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println(""+getClassName()+"::"+getClassName()+"() " );
- out.println(" : " + generateInitializerList() + " {");
+ out.println(""+getClassName()+"::"+getClassName()+"() :" );
+ out.println(" " + generateInitializerList() + " {");
out.println("");
generateDefaultConstructorBody(out);
out.println("}");
out.println("");
if( isAssignable() ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println(""+getClassName()+"::"+getClassName()+"( const "+getClassName()+"& other )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println(""+getClassName()+"::"+getClassName()+"(const "+getClassName()+"& other) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
- out.println(" this->copyDataStructure( &other );");
+ out.println(" this->copyDataStructure(&other);");
out.println("}");
out.println("");
}
@@ -82,24 +85,24 @@ public class CommandSourceGenerator exte
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void "+getClassName()+"::copyDataStructure( const DataStructure* src ) {");
+ out.println("void "+getClassName()+"::copyDataStructure(const DataStructure* src) {");
out.println("");
out.println(" // Protect against invalid self assignment.");
- out.println(" if( this == src ) {");
+ out.println(" if (this == src) {");
out.println(" return;");
out.println(" }");
out.println("");
- out.println(" const "+getClassName()+"* srcPtr = dynamic_cast<const "+getClassName()+"*>( src );");
+ out.println(" const "+getClassName()+"* srcPtr = dynamic_cast<const "+getClassName()+"*>(src);");
out.println("");
- out.println(" if( srcPtr == NULL || src == NULL ) {");
+ out.println(" if (srcPtr == NULL || src == NULL) {");
out.println(" throw decaf::lang::exceptions::NullPointerException(");
out.println(" __FILE__, __LINE__,");
- out.println(" \""+getClassName()+"::copyDataStructure - src is NULL or invalid\" );");
+ out.println(" \""+getClassName()+"::copyDataStructure - src is NULL or invalid\");");
out.println(" }");
out.println("");
if( getBaseClassName() != null ) {
out.println(" // Copy the data of the base class or classes");
- out.println(" "+ getBaseClassName() +"::copyDataStructure( src );");
+ out.println(" "+ getBaseClassName() +"::copyDataStructure(src);");
out.println("");
}
generateCopyDataStructureBody(out);
@@ -117,21 +120,21 @@ public class CommandSourceGenerator exte
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("bool "+getClassName()+"::equals( const DataStructure* value ) const {");
+ out.println("bool "+getClassName()+"::equals(const DataStructure* value) const {");
out.println("");
- out.println(" if( this == value ) {");
+ out.println(" if (this == value) {");
out.println(" return true;");
out.println(" }");
out.println("");
- out.println(" const "+getClassName()+"* valuePtr = dynamic_cast<const "+getClassName()+"*>( value );");
+ out.println(" const "+getClassName()+"* valuePtr = dynamic_cast<const "+getClassName()+"*>(value);");
out.println("");
- out.println(" if( valuePtr == NULL || value == NULL ) {");
+ out.println(" if (valuePtr == NULL || value == NULL) {");
out.println(" return false;");
out.println(" }");
out.println("");
generateEqualsBody(out);
if( getBaseClassName() != null ) {
- out.println(" if( !"+ getBaseClassName() +"::equals( value ) ) {");
+ out.println(" if (!"+ getBaseClassName() +"::equals(value)) {");
out.println(" return false;");
out.println(" }");
}
@@ -141,9 +144,9 @@ public class CommandSourceGenerator exte
generatePropertyAccessors(out);
if( isComparable() ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("int " + getClassName() + "::compareTo( const "+getClassName()+"& value ) const {");
+ out.println("int " + getClassName() + "::compareTo(const "+getClassName()+"& value) const {");
out.println("");
- out.println(" if( this == &value ) {");
+ out.println(" if (this == &value) {");
out.println(" return 0;");
out.println(" }");
out.println("");
@@ -152,36 +155,43 @@ public class CommandSourceGenerator exte
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("bool " + getClassName() + "::equals( const "+getClassName()+"& value ) const {");
- out.println(" return this->equals( (const DataStructure*)&value );");
+ out.println("bool " + getClassName() + "::equals(const "+getClassName()+"& value) const {");
+ out.println(" return this->equals((const DataStructure*)&value);");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("bool " + getClassName() + "::operator==( const "+getClassName()+"& value ) const {");
- out.println(" return this->compareTo( value ) == 0;");
+ out.println("bool " + getClassName() + "::operator==(const "+getClassName()+"& value) const {");
+ out.println(" return this->compareTo(value) == 0;");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("bool " + getClassName() + "::operator<( const "+getClassName()+"& value ) const {");
- out.println(" return this->compareTo( value ) < 0;");
+ out.println("bool " + getClassName() + "::operator<(const "+getClassName()+"& value) const {");
+ out.println(" return this->compareTo(value) < 0;");
out.println("}");
out.println("");
}
if( isAssignable() ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println(""+getClassName()+"& "+getClassName()+"::operator= ( const "+getClassName()+"& other ) {");
- out.println(" this->copyDataStructure( &other );");
+ out.println(""+getClassName()+"& "+getClassName()+"::operator= (const "+getClassName()+"& other) {");
+ out.println(" this->copyDataStructure(&other);");
out.println(" return *this;");
out.println("}");
out.println("");
}
- if( getBaseClassName().equals( "BaseCommand" ) ) {
+ if (isHashable()) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("decaf::lang::Pointer<commands::Command> "+getClassName()+"::visit( activemq::state::CommandVisitor* visitor ) {");
+ out.println("int " + getClassName() + "::getHashCode() const {");
+ out.println(" return decaf::util::HashCode<std::string>()(this->toString());");
+ out.println("}");
out.println("");
- out.println(" return visitor->process"+getClassName()+"( this );");
+ }
+
+ if( getBaseClassName().equals( "BaseCommand" ) ) {
+ out.println("////////////////////////////////////////////////////////////////////////////////");
+ out.println("decaf::lang::Pointer<commands::Command> "+getClassName()+"::visit(activemq::state::CommandVisitor* visitor) {");
+ out.println(" return visitor->process"+getClassName()+"(this);");
out.println("}");
}
@@ -194,8 +204,11 @@ public class CommandSourceGenerator exte
includes.add("<activemq/state/CommandVisitor.h>");
includes.add("<activemq/exceptions/ActiveMQException.h>");
includes.add("<decaf/lang/exceptions/NullPointerException.h>");
+ if( isHashable() ) {
+ includes.add("<decaf/util/HashCode.h>");
+ }
if( isComparable() ) {
- includes.add("<apr_strings.h>");
+ includes.add("<decaf/internal/util/StringUtils.h>");
}
}
@@ -223,7 +236,6 @@ public class CommandSourceGenerator exte
int lastLineEnds = 0;
for( JProperty property : getProperties() ) {
- String type = toCppType(property.getType());
String value = toCppDefaultValue(property.getType());
String propertyName = property.getSimpleName();
String parameterName = decapitalize(propertyName);
@@ -251,10 +263,10 @@ public class CommandSourceGenerator exte
protected void generateCloneDataStructureBody( PrintWriter out ) {
String newInstance = decapitalize( getClassName() );
- out.println(" std::auto_ptr<"+getClassName()+"> "+newInstance+"( new "+getClassName()+"() );");
+ out.println(" std::auto_ptr<"+getClassName()+"> "+newInstance+"(new "+getClassName()+"());");
out.println("");
out.println(" // Copy the data from the base class or classes");
- out.println(" "+newInstance+"->copyDataStructure( this );");
+ out.println(" "+newInstance+"->copyDataStructure(this);");
out.println("");
out.println(" return "+newInstance+".release();");
}
@@ -263,7 +275,7 @@ public class CommandSourceGenerator exte
for( JProperty property : getProperties() ) {
String getter = property.getGetter().getSimpleName();
String setter = property.getSetter().getSimpleName();
- out.println(" this->"+setter+"( srcPtr->"+getter+"() );");
+ out.println(" this->"+setter+"(srcPtr->"+getter+"());");
}
}
@@ -297,7 +309,7 @@ public class CommandSourceGenerator exte
if( property.getType().getSimpleName().equals("ByteSequence") ) {
out.println(" stream << \""+propertyName+" = \";");
- out.println(" if( this->"+getter+"().size() > 0 ) {");
+ out.println(" if (this->"+getter+"().size() > 0) {");
out.println(" stream << \"[size=\" << this->" + getter + "().size() << \"]\";");
out.println(" } else {");
out.println(" stream << \"NULL\";");
@@ -314,10 +326,10 @@ public class CommandSourceGenerator exte
!property.getType().getArrayComponentType().isPrimitiveType() ) {
out.println(" stream << \""+propertyName+" = \";");
- out.println(" if( this->"+getter+"().size() > 0 ) {");
+ out.println(" if (this->"+getter+"().size() > 0) {");
out.println(" stream << \"[\";");
- 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(" for (size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + ") {");
+ out.println(" if (this->"+getter+"()[i"+parameterName+"] != NULL) {");
out.println(" stream << this->"+getter+"()[i"+parameterName+"]->toString() << \", \";");
out.println(" } else {");
out.println(" stream << \"NULL\" << \", \";");
@@ -332,9 +344,9 @@ public class CommandSourceGenerator exte
property.getType().getArrayComponentType().isPrimitiveType() ) {
out.println(" stream << \""+propertyName+" = \";");
- out.println(" if( this->"+getter+"().size() > 0 ) {");
+ out.println(" if (this->"+getter+"().size() > 0) {");
out.println(" stream << \"[\";");
- out.println(" for( size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + " ) {");
+ out.println(" for (size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + ") {");
out.println(" stream << this->"+getter+"()[i"+parameterName+"] << \",\";");
out.println(" }");
out.println(" stream << \"]\";");
@@ -345,7 +357,7 @@ public class CommandSourceGenerator exte
} else {
out.println(" stream << \""+propertyName+" = \";" );
- out.println(" if( this->"+getter+"() != NULL ) {");
+ out.println(" if (this->"+getter+"() != NULL) {");
out.println(" stream << this->"+getter+"()->toString();");
out.println(" } else {");
out.println(" stream << \"NULL\";");
@@ -370,41 +382,41 @@ public class CommandSourceGenerator exte
String getter = property.getGetter().getSimpleName();
if( property.getType().getSimpleName().equals("ByteSequence") ) {
- out.println(" for( size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + " ) {");
- out.println(" if( this->"+getter+"()[i" + parameterName+"] != valuePtr->"+getter+"()[i"+parameterName+"] ) {" );
+ out.println(" for (size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + ") {");
+ out.println(" if (this->"+getter+"()[i" + parameterName+"] != valuePtr->"+getter+"()[i"+parameterName+"]) {" );
out.println(" return false;" );
out.println(" }" );
out.println(" }" );
} else if( property.getType().isPrimitiveType() || type.equals("std::string") ){
- out.println(" if( this->"+getter+"() != valuePtr->"+getter+"() ) {");
+ out.println(" if (this->"+getter+"() != valuePtr->"+getter+"()) {");
out.println(" return false;" );
out.println(" }" );
} else if( property.getType().isArrayType() &&
!property.getType().getArrayComponentType().isPrimitiveType() ) {
- 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+"].get() ) ) {" );
+ 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+"].get())) {" );
out.println(" return false;");
out.println(" }");
- out.println(" } else if( valuePtr->"+getter+"()[i"+parameterName+"] != NULL ) {");
+ out.println(" } else if (valuePtr->"+getter+"()[i"+parameterName+"] != NULL) {");
out.println(" return false;");
out.println(" }");
out.println(" }");
} else if( property.getType().isArrayType() &&
property.getType().getArrayComponentType().isPrimitiveType() ) {
- out.println(" for( size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + " ) {");
- out.println(" if( this->"+getter+"()[i"+parameterName+"] != valuePtr->"+getter+"()[i"+parameterName+"] ) {");
+ out.println(" for (size_t i" + parameterName + " = 0; i" + parameterName + " < this->"+getter+"().size(); ++i" + parameterName + ") {");
+ out.println(" if (this->"+getter+"()[i"+parameterName+"] != valuePtr->"+getter+"()[i"+parameterName+"]) {");
out.println(" return false;");
out.println(" }");
out.println(" }");
} else {
- out.println(" if( this->"+getter+"() != NULL ) {");
- out.println(" if( !this->"+getter+"()->equals( valuePtr->"+getter+"().get() ) ) {" );
+ out.println(" if (this->"+getter+"() != NULL) {");
+ out.println(" if (!this->"+getter+"()->equals( valuePtr->"+getter+"().get())) {" );
out.println(" return false;");
out.println(" }");
- out.println(" } else if( valuePtr->"+getter+"() != NULL ) {");
+ out.println(" } else if (valuePtr->"+getter+"() != NULL) {");
out.println(" return false;");
out.println(" }");
}
@@ -453,7 +465,7 @@ public class CommandSourceGenerator exte
out.println("");
}
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void " + getClassName() + "::" + setter+"( " + constNess + type+ " " + parameterName +" ) {");
+ out.println("void " + getClassName() + "::" + setter+"(" + constNess + type+ " " + parameterName +") {");
out.println(" this->"+parameterName+" = "+parameterName+";");
out.println("}");
out.println("");
@@ -472,21 +484,21 @@ public class CommandSourceGenerator exte
!property.getType().getSimpleName().equals("String") &&
!type.startsWith("std::vector") ) {
- out.println(" int "+parameterName+"Comp = this->"+parameterName+"->compareTo( *( value."+parameterName+" ) );");
- out.println(" if( "+parameterName+"Comp != 0 ) {");
+ out.println(" int "+parameterName+"Comp = this->"+parameterName+"->compareTo(*(value."+parameterName+"));");
+ out.println(" if ("+parameterName+"Comp != 0) {");
out.println(" return "+parameterName+"Comp;");
out.println(" }");
out.println("");
} else if( property.getType().getSimpleName().equals("String") ) {
- out.println(" int "+parameterName+"Comp = apr_strnatcasecmp( this->"+parameterName+".c_str(), value."+parameterName+".c_str() );");
- out.println(" if( "+parameterName+"Comp != 0 ) {");
+ out.println(" int "+parameterName+"Comp = StringUtils::compareIgnoreCase(this->"+parameterName+".c_str(), value."+parameterName+".c_str());");
+ out.println(" if ("+parameterName+"Comp != 0) {");
out.println(" return "+parameterName+"Comp;");
out.println(" }");
out.println("");
} else {
- out.println(" if( this->"+parameterName+" > value."+parameterName+" ) {");
+ out.println(" if (this->"+parameterName+" > value."+parameterName+") {");
out.println(" return 1;");
- out.println(" } else if( this->"+parameterName+" < value."+parameterName+" ) {");
+ out.println(" } else if(this->"+parameterName+" < value."+parameterName+") {");
out.println(" return -1;");
out.println(" }");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -28,11 +28,11 @@ public class ConnectionIdHeaderGenerator
}
protected void generateAdditionalConstructors( PrintWriter out ) {
- out.println(" "+getClassName()+"( const SessionId* sessionId );");
+ out.println(" "+getClassName()+"(const SessionId* sessionId);");
out.println("");
- out.println(" "+getClassName()+"( const ProducerId* producerId );");
+ out.println(" "+getClassName()+"(const ProducerId* producerId);");
out.println("");
- out.println(" "+getClassName()+"( const ConsumerId* consumerId );");
+ out.println(" "+getClassName()+"(const ConsumerId* consumerId);");
out.println("");
super.generateAdditionalConstructors(out);
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -32,21 +32,21 @@ public class ConnectionIdSourceGenerator
protected void generateAdditionalConstructors( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ConnectionId::ConnectionId( const SessionId* sessionId )");
+ out.println("ConnectionId::ConnectionId(const SessionId* sessionId)");
out.println(" : " + generateInitializerList() + " {");
out.println("");
out.println(" this->value = sessionId->getConnectionId();");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ConnectionId::ConnectionId( const ProducerId* producerId )");
+ out.println("ConnectionId::ConnectionId(const ProducerId* producerId)");
out.println(" : " + generateInitializerList() + " {");
out.println("");
out.println(" this->value = producerId->getConnectionId();");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ConnectionId::ConnectionId( const ConsumerId* consumerId )");
+ out.println("ConnectionId::ConnectionId(const ConsumerId* consumerId)");
out.println(" : " + generateInitializerList() + " {");
out.println("");
out.println(" this->value = consumerId->getConnectionId();");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionInfoSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionInfoSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionInfoSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionInfoSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -24,9 +24,9 @@ public class ConnectionInfoSourceGenerat
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("Pointer<RemoveInfo> ConnectionInfo::createRemoveCommand() const {");
- out.println(" Pointer<RemoveInfo> info( new RemoveInfo() );");
- out.println(" info->setResponseRequired( this->isResponseRequired() );");
- out.println(" info->setObjectId( this->getConnectionId() );");
+ out.println(" Pointer<RemoveInfo> info(new RemoveInfo());");
+ out.println(" info->setResponseRequired(this->isResponseRequired());");
+ out.println(" info->setObjectId(this->getConnectionId());");
out.println(" return info;");
out.println("}");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -29,7 +29,7 @@ public class ConsumerIdHeaderGenerator e
}
protected void generateAdditionalConstructors( PrintWriter out ) {
- out.println(" "+getClassName()+"( const SessionId& sessionId, long long consumerIdd );");
+ out.println(" "+getClassName()+"(const SessionId& sessionId, long long consumerIdd);");
out.println("");
super.generateAdditionalConstructors(out);
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -24,12 +24,12 @@ public class ConsumerIdSourceGenerator e
protected void generateAdditionalConstructors( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ConsumerId::ConsumerId( const SessionId& sessionId, long long consumerIdd )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("ConsumerId::ConsumerId(const SessionId& sessionId, long long consumerId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->connectionId = sessionId.getConnectionId();");
out.println(" this->sessionId = sessionId.getValue();");
- out.println(" this->value = consumerIdd;");
+ out.println(" this->value = consumerId;");
out.println("}");
out.println("");
@@ -43,8 +43,8 @@ public class ConsumerIdSourceGenerator e
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("const Pointer<SessionId>& ConsumerId::getParentId() const {");
- out.println(" if( this->parentId == NULL ) {");
- out.println(" this->parentId.reset( new SessionId( this ) );");
+ out.println(" if (this->parentId == NULL) {");
+ out.println(" this->parentId.reset(new SessionId(this));");
out.println(" }");
out.println(" return this->parentId;");
out.println("}");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerInfoSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerInfoSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerInfoSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerInfoSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -23,9 +23,9 @@ public class ConsumerInfoSourceGenerator
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("Pointer<RemoveInfo> ConsumerInfo::createRemoveCommand() const {");
- out.println(" Pointer<RemoveInfo> info( new RemoveInfo() );");
- out.println(" info->setResponseRequired( this->isResponseRequired() );");
- out.println(" info->setObjectId( this->getConsumerId() );");
+ out.println(" Pointer<RemoveInfo> info(new RemoveInfo());");
+ out.println(" info->setResponseRequired(this->isResponseRequired());");
+ out.println(" info->setObjectId(this->getConsumerId());");
out.println(" return info;");
out.println("}");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -91,14 +91,14 @@ public class MessageHeaderGenerator exte
out.println(" * wire");
out.println(" * @param wireFormat - the wireformat controller");
out.println(" */");
- out.println(" virtual void beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED );");
+ out.println(" virtual void beforeMarshal(wireformat::WireFormat* wireFormat AMQCPP_UNUSED);");
out.println("");
out.println(" /**");
out.println(" * Called after unmarshaling is started to cleanup the object being");
out.println(" * unmarshaled.");
out.println(" * @param wireFormat - the wireformat object to control unmarshaling");
out.println(" */");
- out.println(" virtual void afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED );");
+ out.println(" virtual void afterUnmarshal(wireformat::WireFormat* wireFormat AMQCPP_UNUSED);");
out.println("");
out.println(" /**");
out.println(" * Indicates that this command is aware of Marshaling, and needs");
@@ -114,7 +114,7 @@ public class MessageHeaderGenerator exte
out.println(" * when the Acknowledge method is called.");
out.println(" * @param handler ActiveMQAckHandler to call");
out.println(" */");
- out.println(" virtual void setAckHandler( const Pointer<core::ActiveMQAckHandler>& handler ) {");
+ out.println(" virtual void setAckHandler(const Pointer<core::ActiveMQAckHandler>& handler) {");
out.println(" this->ackHandler = handler;");
out.println(" }");
out.println("");
@@ -132,7 +132,7 @@ public class MessageHeaderGenerator exte
out.println(" * when the session create methods are called to create a Message..");
out.println(" * @param handler ActiveMQConnection parent for this message");
out.println(" */");
- out.println(" void setConnection( core::ActiveMQConnection* connection ) {");
+ out.println(" void setConnection(core::ActiveMQConnection* connection) {");
out.println(" this->connection = connection;");
out.println(" }");
out.println("");
@@ -188,7 +188,7 @@ public class MessageHeaderGenerator exte
out.println(" * Set the Read Only State of the Message Properties.");
out.println(" * @param value - true if Properties should be read only.");
out.println(" */");
- out.println(" void setReadOnlyProperties( bool value ) {");
+ out.println(" void setReadOnlyProperties(bool value) {");
out.println(" this->readOnlyProperties = value;");
out.println(" }");
out.println("");
@@ -204,7 +204,7 @@ public class MessageHeaderGenerator exte
out.println(" * Set the Read Only State of the Message Content.");
out.println(" * @param value - true if Content should be read only.");
out.println(" */");
- out.println(" void setReadOnlyBody( bool value ) {");
+ out.println(" void setReadOnlyBody(bool value) {");
out.println(" this->readOnlyBody = value;");
out.println(" }");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -31,13 +31,13 @@ public class MessageIdHeaderGenerator ex
protected void generateAdditionalConstructors( PrintWriter out ) {
- out.println(" "+getClassName()+"( const std::string& messageKey );");
+ out.println(" "+getClassName()+"(const std::string& messageKey);");
out.println("");
- out.println(" "+getClassName()+"( const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId );");
+ out.println(" "+getClassName()+"(const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId);");
out.println("");
- out.println(" "+getClassName()+"( const Pointer<ProducerId>& producerId, long long producerSequenceId );");
+ out.println(" "+getClassName()+"(const Pointer<ProducerId>& producerId, long long producerSequenceId);");
out.println("");
- out.println(" "+getClassName()+"( const std::string& producerId, long long producerSequenceId );");
+ out.println(" "+getClassName()+"(const std::string& producerId, long long producerSequenceId);");
out.println("");
super.generateAdditionalConstructors(out);
@@ -54,9 +54,9 @@ public class MessageIdHeaderGenerator ex
}
protected void generateAdditonalMembers( PrintWriter out ) {
- out.println(" void setValue( const std::string& key );");
+ out.println(" void setValue(const std::string& key);");
out.println("");
- out.println(" void setTextView( const std::string& key );");
+ out.println(" void setTextView(const std::string& key);");
out.println("");
super.generateAdditonalMembers( out );
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -24,33 +24,33 @@ public class MessageIdSourceGenerator ex
protected void generateAdditionalConstructors( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("MessageId::MessageId( const std::string& messageKey )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("MessageId::MessageId(const std::string& messageKey) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
- out.println(" this->setValue( messageKey );");
+ out.println(" this->setValue(messageKey);");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("MessageId::MessageId( const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("MessageId::MessageId(const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->producerId = producerInfo->getProducerId();");
out.println(" this->producerSequenceId = producerSequenceId;");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("MessageId::MessageId( const Pointer<ProducerId>& producerId, long long producerSequenceId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("MessageId::MessageId(const Pointer<ProducerId>& producerId, long long producerSequenceId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->producerId = producerId;");
out.println(" this->producerSequenceId = producerSequenceId;");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("MessageId::MessageId( const std::string& producerId, long long producerSequenceId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("MessageId::MessageId(const std::string& producerId, long long producerSequenceId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
- out.println(" this->producerId.reset( new ProducerId( producerId ) );");
+ out.println(" this->producerId.reset(new ProducerId(producerId));");
out.println(" this->producerSequenceId = producerSequenceId;");
out.println("}");
out.println("");
@@ -64,24 +64,24 @@ public class MessageIdSourceGenerator ex
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void MessageId::setValue( const std::string& key ) {");
+ out.println("void MessageId::setValue(const std::string& key) {");
out.println("");
out.println(" std::string messageKey = key;");
out.println("");
out.println(" // Parse off the sequenceId");
out.println(" std::size_t p = messageKey.rfind( ':' );");
out.println("");
- out.println(" if( p != std::string::npos ) {");
- out.println(" producerSequenceId = Long::parseLong( messageKey.substr( p + 1, std::string::npos ) );");
- out.println(" messageKey = messageKey.substr( 0, p );");
+ out.println(" if (p != std::string::npos) {");
+ out.println(" producerSequenceId = Long::parseLong(messageKey.substr(p + 1, std::string::npos));");
+ out.println(" messageKey = messageKey.substr(0, p);");
out.println(" }");
out.println("");
- out.println(" this->producerId.reset( new ProducerId( messageKey ) );");
+ out.println(" this->producerId.reset(new ProducerId(messageKey));");
out.println(" this->key = messageKey;");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void MessageId::setTextView( const std::string& key ) {");
+ out.println("void MessageId::setTextView(const std::string& key) {");
out.println(" this->key = key;");
out.println("}");
out.println("");
@@ -102,8 +102,8 @@ public class MessageIdSourceGenerator ex
out.println("");
out.println(" if( key == \"\" ) {");
out.println(" this->key = this->producerId->toString() + \":\" + ");
- out.println(" Long::toString( this->producerSequenceId ) + \":\" + ");
- out.println(" Long::toString( this->brokerSequenceId );");
+ out.println(" Long::toString( this->producerSequenceId) + \":\" + ");
+ out.println(" Long::toString( this->brokerSequenceId);");
out.println(" }");
out.println("");
out.println(" return this->key;");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -47,11 +47,11 @@ public class MessageSourceGenerator exte
protected void generateCopyDataStructureBody( PrintWriter out ) {
super.generateCopyDataStructureBody(out);
- out.println(" this->properties.copy( srcPtr->properties );");
- out.println(" this->setAckHandler( srcPtr->getAckHandler() );");
- out.println(" this->setReadOnlyBody( srcPtr->isReadOnlyBody() );");
- out.println(" this->setReadOnlyProperties( srcPtr->isReadOnlyProperties() );");
- out.println(" this->setConnection( srcPtr->getConnection() );");
+ out.println(" this->properties.copy(srcPtr->properties);");
+ out.println(" this->setAckHandler(srcPtr->getAckHandler());");
+ out.println(" this->setReadOnlyBody(srcPtr->isReadOnlyBody());");
+ out.println(" this->setReadOnlyProperties(srcPtr->isReadOnlyProperties());");
+ out.println(" this->setConnection(srcPtr->getConnection());");
}
protected void generateToStringBody( PrintWriter out ) {
@@ -61,19 +61,19 @@ public class MessageSourceGenerator exte
protected void generateEqualsBody( PrintWriter out ) {
super.generateEqualsBody(out);
- out.println(" if( ackHandler != valuePtr->getAckHandler() ){");
+ out.println(" if (ackHandler != valuePtr->getAckHandler()){");
out.println(" return false;");
out.println(" }");
out.println("");
- out.println(" if( !properties.equals( valuePtr->properties ) ) {");
+ out.println(" if (!properties.equals(valuePtr->properties)) {");
out.println(" return false;");
out.println(" }");
out.println("");
- out.println(" if( readOnlyBody != valuePtr->isReadOnlyBody() ){");
+ out.println(" if (readOnlyBody != valuePtr->isReadOnlyBody()){");
out.println(" return false;");
out.println(" }");
out.println("");
- out.println(" if( readOnlyProperties != valuePtr->isReadOnlyProperties() ){");
+ out.println(" if (readOnlyProperties != valuePtr->isReadOnlyProperties()){");
out.println(" return false;");
out.println(" }");
out.println("");
@@ -91,7 +91,7 @@ public class MessageSourceGenerator exte
out.println("bool Message::isExpired() const {");
out.println(" long long expireTime = this->getExpiration();");
out.println(" long long currentTime = decaf::lang::System::currentTimeMillis();");
- out.println(" if( expireTime > 0 && currentTime > expireTime ) {");
+ out.println(" if (expireTime > 0 && currentTime > expireTime) {");
out.println(" return true;");
out.println(" }");
out.println(" return false;");
@@ -109,32 +109,30 @@ public class MessageSourceGenerator exte
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void Message::beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) {");
- out.println("");
- out.println(" try{");
+ out.println("void Message::beforeMarshal(wireformat::WireFormat* wireFormat AMQCPP_UNUSED) {");
out.println("");
+ out.println(" try {");
out.println(" marshalledProperties.clear();");
- out.println(" if( !properties.isEmpty() ) {");
+ out.println(" if (!properties.isEmpty()) {");
out.println(" wireformat::openwire::marshal::PrimitiveTypesMarshaller::marshal(");
out.println(" &properties, marshalledProperties );");
out.println(" }");
out.println(" }");
- out.println(" AMQ_CATCH_RETHROW( decaf::io::IOException )");
- out.println(" AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )");
- out.println(" AMQ_CATCHALL_THROW( decaf::io::IOException )");
+ out.println(" AMQ_CATCH_RETHROW(decaf::io::IOException)");
+ out.println(" AMQ_CATCH_EXCEPTION_CONVERT(decaf::lang::Exception, decaf::io::IOException)");
+ out.println(" AMQ_CATCHALL_THROW(decaf::io::IOException)");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("void Message::afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) {");
- out.println("");
- out.println(" try{");
+ out.println("void Message::afterUnmarshal(wireformat::WireFormat* wireFormat AMQCPP_UNUSED) {");
out.println("");
+ out.println(" try {");
out.println(" wireformat::openwire::marshal::PrimitiveTypesMarshaller::unmarshal(");
- out.println(" &properties, marshalledProperties );");
+ out.println(" &properties, marshalledProperties);");
out.println(" }");
- out.println(" AMQ_CATCH_RETHROW( decaf::io::IOException )");
- out.println(" AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )");
- out.println(" AMQ_CATCHALL_THROW( decaf::io::IOException )");
+ out.println(" AMQ_CATCH_RETHROW(decaf::io::IOException)");
+ out.println(" AMQ_CATCH_EXCEPTION_CONVERT(decaf::lang::Exception, decaf::io::IOException)");
+ out.println(" AMQ_CATCHALL_THROW(decaf::io::IOException)");
out.println("}");
out.println("");
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -29,9 +29,9 @@ public class ProducerIdHeaderGenerator e
}
protected void generateAdditionalConstructors( PrintWriter out ) {
- out.println(" "+getClassName()+"( const SessionId& sessionId, long long consumerId );");
+ out.println(" "+getClassName()+"(const SessionId& sessionId, long long consumerId);");
out.println("");
- out.println(" "+getClassName()+"( std::string producerId );");
+ out.println(" "+getClassName()+"(std::string producerId);");
out.println("");
super.generateAdditionalConstructors(out);
@@ -50,7 +50,7 @@ public class ProducerIdHeaderGenerator e
protected void generateAdditonalMembers( PrintWriter out ) {
out.println(" const Pointer<SessionId>& getParentId() const;");
out.println("");
- out.println(" void setProducerSessionKey( std::string sessionKey );");
+ out.println(" void setProducerSessionKey(std::string sessionKey);");
out.println("");
super.generateAdditonalMembers( out );
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -24,8 +24,8 @@ public class ProducerIdSourceGenerator e
protected void generateAdditionalConstructors( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ProducerId::ProducerId( const SessionId& sessionId, long long consumerId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("ProducerId::ProducerId( const SessionId& sessionId, long long consumerId ) : ");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->connectionId = sessionId.getConnectionId();");
out.println(" this->sessionId = sessionId.getValue();");
@@ -33,18 +33,18 @@ public class ProducerIdSourceGenerator e
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("ProducerId::ProducerId( std::string producerKey )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("ProducerId::ProducerId(std::string producerKey) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" // Parse off the producerId");
out.println(" std::size_t p = producerKey.rfind( ':' );");
out.println("");
- out.println(" if( p != std::string::npos ) {");
- out.println(" value = Long::parseLong( producerKey.substr( p + 1, std::string::npos ) );");
- out.println(" producerKey = producerKey.substr( 0, p );");
+ out.println(" if (p != std::string::npos) {");
+ out.println(" value = Long::parseLong(producerKey.substr(p + 1, std::string::npos));");
+ out.println(" producerKey = producerKey.substr(0, p);");
out.println(" }");
out.println("");
- out.println(" setProducerSessionKey( producerKey );");
+ out.println(" setProducerSessionKey(producerKey);");
out.println("}");
out.println("");
@@ -58,8 +58,8 @@ public class ProducerIdSourceGenerator e
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("const Pointer<SessionId>& ProducerId::getParentId() const {");
- out.println(" if( this->parentId == NULL ) {");
- out.println(" this->parentId.reset( new SessionId( this ) );");
+ out.println(" if (this->parentId == NULL) {");
+ out.println(" this->parentId.reset(new SessionId(this));");
out.println(" }");
out.println(" return this->parentId;");
out.println("}");
@@ -70,9 +70,9 @@ public class ProducerIdSourceGenerator e
out.println(" // Parse off the value");
out.println(" std::size_t p = sessionKey.rfind( ':' );");
out.println("");
- out.println(" if( p != std::string::npos ) {");
- out.println(" this->sessionId = Long::parseLong( sessionKey.substr( p + 1, std::string::npos ) );");
- out.println(" sessionKey = sessionKey.substr( 0, p );");
+ out.println(" if (p != std::string::npos) {");
+ out.println(" this->sessionId = Long::parseLong(sessionKey.substr(p + 1, std::string::npos));");
+ out.println(" sessionKey = sessionKey.substr(0, p);");
out.println(" }");
out.println("");
out.println(" // The rest is the value");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerInfoSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerInfoSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerInfoSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerInfoSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -23,9 +23,9 @@ public class ProducerInfoSourceGenerator
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("Pointer<RemoveInfo> ProducerInfo::createRemoveCommand() const {");
- out.println(" Pointer<RemoveInfo> info( new RemoveInfo() );");
- out.println(" info->setResponseRequired( this->isResponseRequired() );");
- out.println(" info->setObjectId( this->getProducerId() );");
+ out.println(" Pointer<RemoveInfo> info(new RemoveInfo());");
+ out.println(" info->setResponseRequired(this->isResponseRequired());");
+ out.println(" info->setObjectId(this->getProducerId());");
out.println(" return info;");
out.println("}");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -36,11 +36,11 @@ public class SessionIdHeaderGenerator ex
protected void generateAdditionalConstructors( PrintWriter out ) {
- out.println(" "+getClassName()+"( const ConnectionId* connectionId, long long sessionId );");
+ out.println(" "+getClassName()+"(const ConnectionId* connectionId, long long sessionId);");
out.println("");
- out.println(" "+getClassName()+"( const ProducerId* producerId );");
+ out.println(" "+getClassName()+"(const ProducerId* producerId);");
out.println("");
- out.println(" "+getClassName()+"( const ConsumerId* consumerId );");
+ out.println(" "+getClassName()+"(const ConsumerId* consumerId);");
out.println("");
super.generateAdditionalConstructors(out);
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -46,24 +46,24 @@ public class SessionIdSourceGenerator ex
protected void generateAdditionalConstructors( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("SessionId::SessionId( const ConnectionId* connectionId, long long sessionId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("SessionId::SessionId(const ConnectionId* connectionId, long long sessionId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->connectionId = connectionId->getValue();");
out.println(" this->value = sessionId;");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("SessionId::SessionId( const ProducerId* producerId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("SessionId::SessionId(const ProducerId* producerId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->connectionId = producerId->getConnectionId();");
out.println(" this->value = producerId->getSessionId();");
out.println("}");
out.println("");
out.println("////////////////////////////////////////////////////////////////////////////////");
- out.println("SessionId::SessionId( const ConsumerId* consumerId )");
- out.println(" : " + generateInitializerList() + " {");
+ out.println("SessionId::SessionId(const ConsumerId* consumerId) :");
+ out.println(" " + generateInitializerList() + " {");
out.println("");
out.println(" this->connectionId = consumerId->getConnectionId();");
out.println(" this->value = consumerId->getSessionId();");
@@ -76,8 +76,8 @@ public class SessionIdSourceGenerator ex
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("const Pointer<ConnectionId>& SessionId::getParentId() const {");
- out.println(" if( this->parentId == NULL ) {");
- out.println(" this->parentId.reset( new ConnectionId( this ) );");
+ out.println(" if (this->parentId == NULL) {");
+ out.println(" this->parentId.reset(new ConnectionId(this));");
out.println(" }");
out.println(" return this->parentId;");
out.println("}");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -45,7 +45,7 @@ public class SessionInfoHeaderGenerator
out.println(" return this->ackMode;");
out.println(" }");
out.println("");
- out.println(" void setAckMode( unsigned int mode ) {");
+ out.println(" void setAckMode(unsigned int mode) {");
out.println(" this->ackMode = mode;");
out.println(" }");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java Sun Mar 24 21:29:16 2013
@@ -36,9 +36,9 @@ public class SessionInfoSourceGenerator
protected void generateAdditionalMethods( PrintWriter out ) {
out.println("////////////////////////////////////////////////////////////////////////////////");
out.println("Pointer<RemoveInfo> SessionInfo::createRemoveCommand() const {");
- out.println(" Pointer<RemoveInfo> info( new RemoveInfo() );");
- out.println(" info->setResponseRequired( this->isResponseRequired() );");
- out.println(" info->setObjectId( this->getSessionId() );");
+ out.println(" Pointer<RemoveInfo> info(new RemoveInfo());");
+ out.println(" info->setResponseRequired(this->isResponseRequired());");
+ out.println(" info->setObjectId(this->getSessionId());");
out.println(" return info;");
out.println("}");
out.println("");
Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdHeaderGenerator.java?rev=1460466&r1=1460465&r2=1460466&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdHeaderGenerator.java (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/XATransactionIdHeaderGenerator.java Sun Mar 24 21:29:16 2013
@@ -51,11 +51,11 @@ public class XATransactionIdHeaderGenera
out.println("");
out.println(" virtual Xid* clone() const;");
out.println("");
- out.println(" virtual bool equals( const Xid* other ) const;");
+ out.println(" virtual bool equals(const Xid* other) const;");
out.println("");
- out.println(" virtual int getBranchQualifier( unsigned char* buffer, int size ) const;");
+ out.println(" virtual int getBranchQualifier(unsigned char* buffer, int size) const;");
out.println("");
- out.println(" virtual int getGlobalTransactionId( unsigned char* buffer, int size ) const;");
+ out.println(" virtual int getGlobalTransactionId(unsigned char* buffer, int size) const;");
out.println("");
super.generateAdditonalMembers( out );