Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6086e5d19516e7d809c24f6107be5dbc25b441ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[module CppClassIncludeDeclaration('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::preferences::CppCodeGenUtils/]


[query public includeName(ne : NamedElement) : String =
if (hasStereotype(Template)) then
	getApplication(Template).oclAsType(Template).declaration
else
	if (hasStereotype(ExternClass)) then getApplication(ExternClass).oclAsType(ExternClass).name
	else
		-- standard case (no stereotypes are applied)
		getNearestPackage().getFullPath() + '/' + ne.name + '.' + getHeaderSuffix()
	endif
endif
/]

[comment TODO: original code did not use nearest package, if stereotype CppRoot was applied/]
[template public CppClassIncludeDeclaration(ne : NamedElement)]
#include <[ne.includeName()/]>
[/template]

Back to the top