Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c2e57b0864cdf49aeb24dfdd35de57b15b6a5008 (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
41
42
43
44
45
46
47
48
[module CppClassIncludeClassDeclaration('http://www.eclipse.org/uml2/4.0.0/UML', 'http://www.eclipse.org/papyrus/C_Cpp/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)]
[CppClassAllIncludesDeclaration(includedClassifiers())/]
[/template]

[template public CppClassAllIncludesDeclarationBody(class : Classifier)]
[CppClassAllIncludesDeclaration(getDependencies())/]
[/template]

[template public CppClassAllIncludesDeclaration(class : Classifier, list : Sequence(Classifier) )]
[for (cl : Classifier | list)]
	[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