You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/07/28 18:04:03 UTC

svn commit: r426586 - /incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy

Author: chirino
Date: Fri Jul 28 09:04:03 2006
New Revision: 426586

URL: http://svn.apache.org/viewvc?rev=426586&view=rev
Log:
svn propset svn:eol-style native

Modified:
    incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy   (contents, props changed)

Modified: incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy?rev=426586&r1=426585&r2=426586&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy (original)
+++ incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy Fri Jul 28 09:04:03 2006
@@ -1,149 +1,149 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import org.apache.activemq.openwire.tool.OpenWireCppHeadersScript
-
-/**
- * Generates the C++ commands for the Open Wire Format
- *
- * @version $Revision$
- */
-class GenerateCppHeaders extends OpenWireCppHeadersScript {
-
-	void generateFile(PrintWriter out) {
-                out << """/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-#ifndef ${className}_hpp_
-#define ${className}_hpp_
-
-#include <string>
-"""
-if( baseClass.equals("BrokerError") )
-    out << """#include "${baseClass}.hpp"
-"""
-else
-    out << """#include "command/${baseClass}.hpp"
-    
-"""
-for (property in properties)
-{
-    if( !property.type.isPrimitiveType() &&
-         property.type.simpleName != "String" &&
-         property.type.simpleName != "ByteSequence" )
-    {
-        def includeName = toCppType(property.type)
-        if( property.type.isArrayType() )
-        {
-            def arrayType = property.type.arrayComponentType ;
-            if( arrayType.isPrimitiveType() )
-                continue ;
-        }
-        if( includeName.startsWith("ap<") )
-            includeName = includeName.substring(3, includeName.length()-1) ;
-        else if( includeName.startsWith("p<") )
-            includeName = includeName.substring(2, includeName.length()-1)
-
-        if( includeName.equals("BrokerError") )
-            out << """#include "${includeName}.hpp"
-"""
-        else
-            out << """#include "command/${includeName}.hpp"
-"""
-    }
-}
-out << """
-#include "util/ifr/ap.hpp"
-#include "util/ifr/p.hpp"
-
-namespace apache
-{
-  namespace activemq
-  {
-    namespace client
-    {
-      namespace command
-      {
-        using namespace ifr;
-        using namespace std;
-        using namespace apache::activemq::client;
-
-/*
- *
- *  Marshalling code for Open Wire Format for ${className}
- *
- *
- *  NOTE!: This file is autogenerated - do not modify!
- *         if you need to make a change, please see the Groovy scripts in the
- *         activemq-core module
- *
- */
-class ${className} : public ${baseClass}
-{
-private:
-"""
-    for (property in properties) {
-        def type = toCppType(property.type)
-        def name = decapitalize(property.simpleName)
-        out << """    $type $name ;
-"""
-    }
-    out << """
-public:
-    const static int TYPE = ${getOpenWireOpCode(jclass)};
-
-public:
-    ${className}() ;
-    virtual ~${className}() ;
-
-    virtual int getCommandType() ;
-"""
-    for (property in properties) {
-        def type = toCppType(property.type)
-        def propertyName = property.simpleName
-        def parameterName = decapitalize(propertyName)
-        out << """
-    virtual ${type} get${propertyName}() ;
-    virtual void set${propertyName}(${type} ${parameterName}) ;
-"""
-    }
-    out << """
-
-} ;
-
-/* namespace */
-      }
-    }
-  }
-}
-
-#endif /*${className}_hpp_*/
-"""
-    }
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import org.apache.activemq.openwire.tool.OpenWireCppHeadersScript
+
+/**
+ * Generates the C++ commands for the Open Wire Format
+ *
+ * @version $Revision$
+ */
+class GenerateCppHeaders extends OpenWireCppHeadersScript {
+
+	void generateFile(PrintWriter out) {
+                out << """/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef ${className}_hpp_
+#define ${className}_hpp_
+
+#include <string>
+"""
+if( baseClass.equals("BrokerError") )
+    out << """#include "${baseClass}.hpp"
+"""
+else
+    out << """#include "command/${baseClass}.hpp"
+    
+"""
+for (property in properties)
+{
+    if( !property.type.isPrimitiveType() &&
+         property.type.simpleName != "String" &&
+         property.type.simpleName != "ByteSequence" )
+    {
+        def includeName = toCppType(property.type)
+        if( property.type.isArrayType() )
+        {
+            def arrayType = property.type.arrayComponentType ;
+            if( arrayType.isPrimitiveType() )
+                continue ;
+        }
+        if( includeName.startsWith("ap<") )
+            includeName = includeName.substring(3, includeName.length()-1) ;
+        else if( includeName.startsWith("p<") )
+            includeName = includeName.substring(2, includeName.length()-1)
+
+        if( includeName.equals("BrokerError") )
+            out << """#include "${includeName}.hpp"
+"""
+        else
+            out << """#include "command/${includeName}.hpp"
+"""
+    }
+}
+out << """
+#include "util/ifr/ap.hpp"
+#include "util/ifr/p.hpp"
+
+namespace apache
+{
+  namespace activemq
+  {
+    namespace client
+    {
+      namespace command
+      {
+        using namespace ifr;
+        using namespace std;
+        using namespace apache::activemq::client;
+
+/*
+ *
+ *  Marshalling code for Open Wire Format for ${className}
+ *
+ *
+ *  NOTE!: This file is autogenerated - do not modify!
+ *         if you need to make a change, please see the Groovy scripts in the
+ *         activemq-core module
+ *
+ */
+class ${className} : public ${baseClass}
+{
+private:
+"""
+    for (property in properties) {
+        def type = toCppType(property.type)
+        def name = decapitalize(property.simpleName)
+        out << """    $type $name ;
+"""
+    }
+    out << """
+public:
+    const static int TYPE = ${getOpenWireOpCode(jclass)};
+
+public:
+    ${className}() ;
+    virtual ~${className}() ;
+
+    virtual int getCommandType() ;
+"""
+    for (property in properties) {
+        def type = toCppType(property.type)
+        def propertyName = property.simpleName
+        def parameterName = decapitalize(propertyName)
+        out << """
+    virtual ${type} get${propertyName}() ;
+    virtual void set${propertyName}(${type} ${parameterName}) ;
+"""
+    }
+    out << """
+
+} ;
+
+/* namespace */
+      }
+    }
+  }
+}
+
+#endif /*${className}_hpp_*/
+"""
+    }
 }

Propchange: incubator/activemq/branches/activemq-4.0/activemq-core/src/gram/script/GenerateCppHeaders.groovy
------------------------------------------------------------------------------
    svn:eol-style = native