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/CppClassHeader.mtl')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassHeader.mtl122
1 files changed, 0 insertions, 122 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassHeader.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassHeader.mtl
deleted file mode 100644
index b89a0c84e7e..00000000000
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassHeader.mtl
+++ /dev/null
@@ -1,122 +0,0 @@
-[module CppClassHeader('http://www.eclipse.org/uml2/5.0.0/UML', 'http://www.eclipse.org/papyrus/C_Cpp/1', 'http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard')/]
-[import org::eclipse::papyrus::acceleo::GenUtils/]
-[import org::eclipse::papyrus::cpp::codegen::utils::CppGenUtils/]
-[import org::eclipse::papyrus::cpp::codegen::utils::ClassUtils/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::Constants/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::CppIncludeUtils/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassIncludeClassDeclaration/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassTypeAndEnum/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassFriendDeclaration/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassInheritedDeclarations/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassAttributesDeclaration/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassOperationsDeclaration/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassOperationsImplementation/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::operation::CppOperations/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppTemplates/]
-[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppDocumentation/]
-
-[template public classUnionOrStruct(classifier : Classifier)]
-[if (hasStereotype(C_Cpp::Union))]
- 'union'
-[else]
- [if (oclIsKindOf(DataType))]
- [VisibilityKind::public.resetVisibility()/]
- struct
- [else]
- [VisibilityKind::private.resetVisibility()/]
- class
- [/if]
-[/if]
-[/template]
-
-[comment default initializer for non-static attributes with a default value
-TODO: should be disabled by default, since non-static members can be initialized directly
-in C++ 011/]
-[template public defaultInitializer(classifier : Classifier) post(trim())]
-[comment
-Bug 422373: The default initializer should not be generated if there are any user-defined
- constructors. In plain C++ code, the existence of a constructor with parameters
- means that the compiler will not synthesize a default one.
-
- E.g., this would be invalid in plain C++ code:
- class T1 { };
- class T2 { public: T(int); };
- T1 * t1 = new T1; // OK, sythesized default constructor used
- T2 * t2a = new T2(5); // OK, user-defined constructor used
- T2 * t2b = new T2; // ERROR, default constructor was not synthesized
-
- Also, if the user has provided a default constructor in the code, we don't need
- to generate a second copy here. A default constructor should only be generated
- here if the compiler would have synthesized one anyhow. Otherwise the default
- property values should be set in the constructors that are generated by
- CppClassOperationsDeclaration.
-/]
-[if getOwnedOperations()->any(hasStereotype(standard::Create)) = null]
- [let attributeList : OrderedSet(Property) = attribute->select(
- (isStatic = false) and
- (defaultValue <> null) and
- (defaultValue.stringValue() <> null))]
- [if not attributeList->isEmpty()]
- [classifier.name/]() : [for (a : Property | attributeList) separator(', ')
- ][name/]([defaultValue.stringValue()/])[/for] {}
- [/if][/let]
-[/if]
-[/template]
-
-
-[template public CppClassHeader(class : Classifier)]
-#ifndef [getFullNameUC()/]_H
-#define [getFullNameUC()/]_H
-
-/************************************************************
- [class.name/] class header
- ************************************************************/
-
-[for (path : String |
- Sequence{ _package.cppOwnerPackageIncludePath() }
- ->addAll( CppClassAllIncludes() )
- ->flatten()
- ->asOrderedSet())]
-[path.IncludeDirective()/]
-[/for]
-
-[CppIncludeHeader()/]
-
-[openNS()/]
-
-/************************************************************/
-[CppElementDoc()/]
-[templateSignature()/][classUnionOrStruct()/] [class.name/][CppClassInheritedDeclarations()/] {
-[CppClassIncludeFriendDeclaration()/][CppClassTypeAndEnum()/]
- [VisibilityKind::public.getSection(defaultInitializer())/]
- [VisibilityKind::public.getSection(CppClassAttributesDeclaration(VisibilityKind::public))/]
- [VisibilityKind::public.getSection(CppClassOperationsDeclaration(VisibilityKind::public))/]
-
- [VisibilityKind::protected.getSection(CppClassAttributesDeclaration(VisibilityKind::protected))/]
- [VisibilityKind::protected.getSection(CppClassOperationsDeclaration(VisibilityKind::protected))/]
-
- [VisibilityKind::private.getSection(CppClassAttributesDeclaration(VisibilityKind::private))/]
- [VisibilityKind::private.getSection(CppClassOperationsDeclaration(VisibilityKind::private))/]
-};
-/************************************************************/
-/* External declarations (package visibility) */
-[CppClassAttributesDeclaration(VisibilityKind::_package)/]
-[CppClassOperationsDeclaration(VisibilityKind::_package)/]
-/************************************************************/
-
-[if isTemplate()]
-/************************************************************/
-/* Template functions */
-[CppClassOperationsImplementation(false)/]
-[/if]
-
-/* Inline functions */
-[CppClassOperationsImplementation(true)/]
-[closeNS()/]
-
-/************************************************************
- End of [class.name/] class header
- ************************************************************/
-
-#endif
-[/template]

Back to the top