diff options
author | aradermache | 2013-04-04 22:03:13 +0000 |
---|---|---|
committer | aradermache | 2013-04-04 22:03:13 +0000 |
commit | 168bcb97ea99372e921c00bd859b0bab61076cf8 (patch) | |
tree | 1b182af08dd573928591906d9adf4b2d13373524 /extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl | |
parent | 51518784b0995b2f15bff5982cd1421be3fe6910 (diff) | |
download | org.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.tar.gz org.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.tar.xz org.eclipse.papyrus-168bcb97ea99372e921c00bd859b0bab61076cf8.zip |
Transition to Acceleo based generator
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl')
-rw-r--r-- | extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl new file mode 100644 index 00000000000..22eb62b8de0 --- /dev/null +++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassInheritedDeclarations.mtl @@ -0,0 +1,24 @@ +[module CppClassInheritedDeclarations('http://www.eclipse.org/uml2/4.0.0/UML', 'http://papyrus/C_CppProfile/1')/] +[import org::eclipse::papyrus::cpp::codegen::utils::GenUtils/] + +[comment +Return a list of relationships that are either Generalizations or InterfaceRealiazations +and the target does not point to a classifier that has the no-code-gen Stereotype +TODO: not sure if it makes sense NOT to declare an inheritance, since we do not generate code. +/] +[query public filteredRelationships(class : Classifier) : Set(DirectedRelationship) = + getSourceDirectedRelationships()->select( + (oclIsKindOf(Generalization) or oclIsKindOf(InterfaceRealization)) and + (not target->asSequence()->first().hasStereotype(NoCodeGen)) + ) +/] + +[query public getCppVisibility(relationship : Relationship) : String = +if (hasStereotype(Visibility)) then getApplication(Visibility).oclAsType(Visibility).value else 'public' endif +/] + +[template public CppClassInheritedDeclarations(class : Classifier)] +[if (filteredRelationships()->size() > 0)] : [/if] +[for (filteredRelationships()) separator(', \n')] + [getCppVisibility()/] [target->asSequence()->first().oclAsType(Classifier).qualifiedName()/][/for] +[/template] |