Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0cb88942a4581dd6f07c6b5088ac233eb9aeaf03 (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
[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 templateSignature(operation : Operation)]
[owner.oclAsType(Classifier).templateSignature()/]
[/template]

Back to the top