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/CppAttribute.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppAttribute.mtl17
1 files changed, 16 insertions, 1 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppAttribute.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppAttribute.mtl
index f7b8e72484c..e7cd43911d2 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppAttribute.mtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/CppAttribute.mtl
@@ -34,11 +34,26 @@
[comment
+return a list of owned attributes, since this is not supported directly on a classifier/]
+[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
+/]
+
+
+[comment
Loop over attributes. Check that the attribute is not a static const.
Constant static attributes are declared within the class declaration/]
[template public CppStaticAttributes(classifier : Classifier)]
[constStaticAttributes()/]
-[for (classifier.attribute)]
+[for (getOwnedAttributes())]
[if(isStatic and (not hasStereotype(C_Cpp::Const)))]
[CppStaticAttributeImplementation()/]

Back to the top