Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b306948e75dce9c2cc008980d6b769ea9066ed90 (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
[module CppTemplates('http://www.eclipse.org/uml2/5.0.0/UML')/]
[import org::eclipse::papyrus::acceleo::GenUtils/]
[import org::eclipse::papyrus::cpp::codegen::utils::CppGenUtils/]


[query public CppTemplateBindingParameter(tps : TemplateParameterSubstitution) : String =
if (tps.actual.oclIsKindOf(LiteralInteger)) then
	tps.actual.oclAsType(LiteralInteger).value
else
	tps.actual.oclAsType(NamedElement).name
endif
/]

[query public isTemplate(class : Classifier) : Boolean =
	getTemplateParameters()->size() > 0
/]


[template public templateSignature(class : Classifier)]
[if isTemplate()]
template<[for (getTemplateParameters()) separator(', ')][getTemplateTypeName()/][/for]>
[/if]
[/template]


[template public templateShortSignature(class : Classifier)]
[if isTemplate()]
<[for (getTemplateParameters()) separator(', ')][getTemplateName()/][/for]> [/if]
[/template]


[template public templateSignature(operation : Operation)]
[owner.oclAsType(Classifier).templateSignature()/]
[/template]


[template public templateShortSignature(operation : Operation)]
[owner.oclAsType(Classifier).templateShortSignature()/]
[/template]

Back to the top