Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8db26305532bc4948b6d9cca2f74ae7a322ae86d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[module CppClassIncludeClassDeclaration('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::utils::ClassUtils/]
[import org::eclipse::papyrus::cpp::codegen::acceleo::util::clazz::CppClassIncludeDeclaration/]

[comment USED??? /]
[template public CppClassIncludeClassDeclarationTemplate(class : Class)]
[openNS()/]
[if hasStereotype(class, 'CppTemplate.class')]template [/if]class [class.name/];
[closeNS()/]
[/template]


[template public CppOwnerPackageIncludeDeclaration(pkg : Package)]
[comment if currentPkg is not root it is referenced here/]
[if ((pkg <> null) and (not hasStereotype(CppRoot)))]
/* Owner package header include                             */
#include <[getFullPath()/]/Pkg_[pkg.name/].h>
[/if] 
[/template]


[template public CppClassAllIncludesDeclaration(class : Classifier)]
[for (cl : Classifier | includedClassifiers())]
	[comment Only add include if this is not for the current class and if it does not have the stereotype "CppNoCodeGen", unless
			it has stereotype "CppExternalClass"/]
	[if((cl <> class) and (not hasStereotype(NoCodeGen)) or hasStereotype(ExternClass))]
		[if(oclIsKindOf(Enumeration) or oclIsKindOf(PrimitiveType))]
			[comment Enumeration is not defined in a separate file, but in the package that owns it
				=> include the owning package (might be a duplicate input, if owning package is also the owner of current class/]
			[if (cl.owner.oclIsKindOf(Package))]
[cl.owner.oclAsType(Package).CppOwnerPackageIncludeDeclaration()/]
			[/if]
		[else]
			[comment include file associated with the classifier/] 
[CppClassIncludeDeclaration()/]
		[/if]
	[/if]
[/for]
[/template]

Back to the top