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


[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(', ')][getType()/][/for]>
[/if]
[/template]


[template public templateShortSignature(class : Classifier)]
[if isTemplate()]
<[for (getTemplateParameters()) separator(', ')][getName()/][/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