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/CppClassTypeAndEnum.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassTypeAndEnum.mtl30
1 files changed, 30 insertions, 0 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassTypeAndEnum.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassTypeAndEnum.mtl
new file mode 100644
index 00000000000..50f2a7c4928
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/util/clazz/CppClassTypeAndEnum.mtl
@@ -0,0 +1,30 @@
+[module CppClassTypeAndEnum('http://www.eclipse.org/uml2/4.0.0/UML', 'http://papyrus/C_CppProfile/1')/]
+[import org::eclipse::papyrus::cpp::codegen::utils::GenUtils/]
+[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppPrimitiveTypes/]
+[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppEnumerations/]
+
+[template public TypeAndEnumForVisibility(element : Element, visibilityFilter : VisibilityKind)]
+[if (not hasStereotype(NoCodeGen) and oclIsKindOf(Classifier) and oclAsType(Classifier).visibility = visibilityFilter)]
+[ if (oclIsKindOf(Enumeration))][oclAsType(Enumeration).CppEnumerationDefinition()/][/if]
+[ if (oclIsKindOf(PrimitiveType))][oclAsType(PrimitiveType).CppPrimitiveTypeDefinition()/][/if]
+[/if]
+[/template]
+
+[template public TypesAndEnumsForVisibility(ne : Namespace, visibilityFilter : VisibilityKind)]
+[for (ownedElement)][TypeAndEnumForVisibility(visibilityFilter)/][/for]
+[/template]
+
+[template public CppClassTypeAndEnum(class : Classifier)]
+ public:
+ [TypesAndEnumsForVisibility(VisibilityKind::public)/]
+ protected:
+ [TypesAndEnumsForVisibility(VisibilityKind::protected)/]
+ private:
+ [TypesAndEnumsForVisibility(VisibilityKind::private)/]
+[/template]
+
+
+[template public CppClassTypeAndEnumPackage(pkg : Package)]
+[TypesAndEnumsForVisibility(VisibilityKind::_package)/]
+[TypesAndEnumsForVisibility(VisibilityKind::public)/]
+[/template] \ No newline at end of file

Back to the top