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/clazz/CppClassAttributesDeclaration.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassAttributesDeclaration.mtl13
1 files changed, 12 insertions, 1 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassAttributesDeclaration.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassAttributesDeclaration.mtl
index 7ff3bd720e9..f4ad914778a 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassAttributesDeclaration.mtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassAttributesDeclaration.mtl
@@ -2,9 +2,20 @@
[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppAttribute/]
+[query public getOwnedAttributes(cl : Classifier) : Sequence(Property) =
+ if (cl.oclIsKindOf(Class)) then
+ oclAsType(Class).ownedAttribute
+ else
+ if (cl.oclIsKindOf(DataType)) then
+ oclAsType(DataType).ownedAttribute
+ else
+ null
+ endif
+ endif
+/]
[template public CppClassAttributesDeclaration(class : Classifier, visibilityFilter : VisibilityKind)]
-[for (attribute->select(visibility = visibilityFilter))]
+[for (getOwnedAttributes()->select(visibility = visibilityFilter))]
[CppAttributeDeclaration()/]
[/for]

Back to the top