Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/operation/CppOperationParameters.util.jet')
-rw-r--r--extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/operation/CppOperationParameters.util.jet35
1 files changed, 35 insertions, 0 deletions
diff --git a/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/operation/CppOperationParameters.util.jet b/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/operation/CppOperationParameters.util.jet
new file mode 100644
index 00000000000..00858e02574
--- /dev/null
+++ b/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/operation/CppOperationParameters.util.jet
@@ -0,0 +1,35 @@
+<%@ jet package = "org.eclipse.papyrus.cpp.codegen.jet.util"
+ skeleton = "../../generator.skeleton"
+ imports = "org.eclipse.uml2.uml.* java.util.*"
+ class = "CppOperationParameters"
+%>
+<%
+//////////////////////////////////////////////////////////////////////////////////////////
+// Java preparation
+//////////////////////////////////////////////////////////////////////////////////////////
+
+ // Retrieve the Operation
+ Operation currentOperation = (Operation) argument;
+ Parameter currentParameter;
+
+ String paramDecl = "";
+
+ Iterator<Parameter> parameters = currentOperation.getOwnedParameters().iterator();
+ while(parameters.hasNext()) {
+ currentParameter = parameters.next();
+ if (currentParameter.getDirection () != ParameterDirectionKind.RETURN_LITERAL) {
+ // Prepare parameters
+ CppParameter jetParam = new CppParameter();
+ if (!paramDecl.equals("")) {
+ paramDecl += ", ";
+ }
+ paramDecl = paramDecl+jetParam.generate(currentParameter);
+ }
+ }
+
+ paramDecl.replaceAll(NL, "");
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// The following part contains the template
+//////////////////////////////////////////////////////////////////////////////////////////
+%><%= paramDecl %> \ No newline at end of file

Back to the top