summaryrefslogtreecommitdiff
path: root/gentools
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2006-12-18 15:37:14 +0000
committerKim van der Riet <kpvdr@apache.org>2006-12-18 15:37:14 +0000
commit1423e51d2918007f5b99fa86e04fc91a0147dfdf (patch)
tree8a03cc27c5e5bb88610a067d0fc6eac35633813b /gentools
parent1d38989c35a211ace6f379dc83cbdd6a36295d53 (diff)
downloadqpid-python-1423e51d2918007f5b99fa86e04fc91a0147dfdf.tar.gz
Added additional files AMQP_HighestVersion.h/.cpp to identify the highest available version for client use.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@488304 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'gentools')
-rw-r--r--gentools/src/org/apache/qpid/gentools/CppGenerator.java4
-rw-r--r--gentools/src/org/apache/qpid/gentools/Main.java3
-rw-r--r--gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl31
3 files changed, 37 insertions, 1 deletions
diff --git a/gentools/src/org/apache/qpid/gentools/CppGenerator.java b/gentools/src/org/apache/qpid/gentools/CppGenerator.java
index 7aa6b2d21c..c96cb2b08f 100644
--- a/gentools/src/org/apache/qpid/gentools/CppGenerator.java
+++ b/gentools/src/org/apache/qpid/gentools/CppGenerator.java
@@ -348,6 +348,10 @@ public class CppGenerator extends Generator
return generateServerOperationsInvoke(thisClass, method, version, 4, 4);
if (token.compareTo("${mb_buffer_param}") == 0)
return method.fieldMap.size() > 0 ? " buffer" : "";
+ if (token.compareTo("${hv_latest_major}") == 0)
+ return String.valueOf(globalVersionSet.last().getMajor());
+ if (token.compareTo("${hv_latest_minor}") == 0)
+ return String.valueOf(globalVersionSet.last().getMinor());
throw new AmqpTemplateException("Template token " + token + " unknown.");
}
diff --git a/gentools/src/org/apache/qpid/gentools/Main.java b/gentools/src/org/apache/qpid/gentools/Main.java
index 28bf7e02c1..4f33ff8bde 100644
--- a/gentools/src/org/apache/qpid/gentools/Main.java
+++ b/gentools/src/org/apache/qpid/gentools/Main.java
@@ -201,7 +201,8 @@ public class Main
new File(tmplDir + Utils.fileSeparator + "AMQP_ClientProxy.cpp.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_Constants.h.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl")
+ new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl"),
+ new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.cpp.tmpl")
};
methodTemplateFiles = new File[]
{
diff --git a/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl b/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl
new file mode 100644
index 0000000000..e82a8d697d
--- /dev/null
+++ b/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl
@@ -0,0 +1,31 @@
+&{AMQP_HighestVersion.cpp}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by ${GENERATOR} - do not modify.
+ * Supported AMQP versions:
+%{VLIST} * ${major}-${minor}
+ */
+
+#include <AMQP_HighestVersion.h>
+
+qpid::framing::ProtocolVersion highestProtocolVersion(${hv_latest_major}, ${hv_latest_minor});