Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl14
1 files changed, 14 insertions, 0 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl
index 18bcb778f50..7769d46e84d 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/operation/CppOperations.mtl
@@ -7,6 +7,20 @@
[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppTemplates/]
+[comment
+return a list of owned operations, since this is not supported directly on a classifier/]
+[query public getOwnedOperations(cl : Classifier) : Sequence(Operation) =
+ if (cl.oclIsKindOf(Class)) then
+ oclAsType(Class).ownedOperation
+ else
+ if (cl.oclIsKindOf(DataType)) then
+ oclAsType(DataType).ownedOperation
+ else
+ null
+ endif
+ endif
+/]
+
[template public virtualTxt(operation : Operation)]
[if((operation.interface <> null) or (operation.isAbstract) or (operation.hasStereotype(Virtual)))]virtual [/if]
[/template]

Back to the top