Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/template/CppTemplateInlineOperationsImplementation.util.jet')
-rw-r--r--extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/template/CppTemplateInlineOperationsImplementation.util.jet42
1 files changed, 42 insertions, 0 deletions
diff --git a/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/template/CppTemplateInlineOperationsImplementation.util.jet b/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/template/CppTemplateInlineOperationsImplementation.util.jet
new file mode 100644
index 00000000000..146deefca76
--- /dev/null
+++ b/extraplugins/cpp-codegen/org.eclipse.papyrus.cpp.codegen/templates/util/template/CppTemplateInlineOperationsImplementation.util.jet
@@ -0,0 +1,42 @@
+<%@ jet package = "org.eclipse.papyrus.cpp.codegen.jet.util"
+ skeleton = "../../generator.skeleton"
+ imports = "org.eclipse.papyrus.cpp.codegen.jet.doc.* org.eclipse.uml2.uml.Class org.eclipse.uml2.uml.Operation java.util.Iterator Cpp.* org.eclipse.papyrus.cpp.codegen.utils.GenUtils"
+ class = "CppTemplateInlineOperationsImplementation"
+%>
+<%
+//////////////////////////////////////////////////////////////////////////////////////////
+// Java preparation
+//////////////////////////////////////////////////////////////////////////////////////////
+
+ // Retrieve the class
+ Class currentClass = (Class) argument;
+ String opDecl = "";
+ String tDecl = "";
+
+ // Retrieve template declaration
+ CppTemplateDeclaration jetTDecl = new CppTemplateDeclaration();
+ // tDecl should contain something like "template <class x, class y>"
+ tDecl = jetTDecl.generate(currentClass) + " ";
+
+ // Retrieve operations
+ Iterator<Operation> operations = currentClass.getOwnedOperations().iterator();
+ while (operations.hasNext()) {
+ Operation currentOperation = operations.next();
+
+ if (GenUtils.hasStereotype (currentOperation, CppInline.class) &&
+ !GenUtils.hasStereotype (currentOperation, CppNoCodeGen.class)) {
+ String opDoc = "";
+
+ // Doc for the template
+ CppOperationDoc jDoc = new CppOperationDoc();
+ opDoc = jDoc.generate(currentOperation);
+
+ CppOperationTemplateImplementation jetOpImpl = new CppOperationTemplateImplementation();
+ opDecl = opDecl+opDoc+NL+tDecl+jetOpImpl.generate(currentOperation)+NL;
+ }
+ }
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// The following part contains the template
+//////////////////////////////////////////////////////////////////////////////////////////
+%><%= opDecl %> \ No newline at end of file

Back to the top