Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7227283ec0fb50164e57e9a842b7ead49d6c670b (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
[module CppAttribute('http://www.eclipse.org/uml2/4.0.0/UML')/]
[import org::eclipse::papyrus::cpp::codegen::utils::GenUtils/]
[import org::eclipse::papyrus::cpp::codegen::utils::Modifier/]
[import org::eclipse::papyrus::cpp::codegen::acceleo::Constants/]
[import org::eclipse::papyrus::cpp::codegen::acceleo::util::CppDocumentation/]


[template public defaultValue(attribute : Property)]
[if (defaultValue <> null) and isStatic] = [attribute.defaultValue.stringValue()/][/if]
[/template]


[template public staticValue(attribute : Property)]
[if (attribute.isStatic)]static [/if]
[/template]


[template public CppAttributeDeclaration(attribute : Property)]
[CppElementDoc()/]
[staticValue()/][modConst()/][attribute.type.qualifiedName()/][modPtr()/][modRef()/] [attribute.name/][modArray()/][if (hasStereotype(C_Cpp::Const))][defaultValue()/][/if];
[/template]


[template public CppAttributeImplementation(attribute : Property)]
	[CppElementDoc()/]
	[modConst()/][attribute.type.qualifiedName()/][modPtr()/][modRef()/] [attribute.name/][modArray()/];
[/template]

[template public CppStaticAttributeImplementation(attribute : Property)]
[CppElementDoc()/]
[type.qualifiedName()/][modPtr()/][modRef()/] [attribute.class.name/]::[attribute.name/][modArray()/][defaultValue()/];
[/template]


[comment
Loop over attributes. Check that the attribute is not a static const.
Constant static attributes are declared within the class declaration/] 
[template public CppStaticAttributes(classifier : Classifier)]
[constStaticAttributes()/]
[for (classifier.attribute)]
	[if(isStatic and (not hasStereotype(C_Cpp::Const)))]
[CppStaticAttributeImplementation()/]

	[/if]
[/for]
[/template]

Back to the top