Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f7b8e72484cf56d9fb0d6ba3e978e51aaf7ceb5d (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
48
[module CppAttribute('http://www.eclipse.org/uml2/4.0.0/UML', 'http://www.eclipse.org/papyrus/C_Cpp/1')/]
[import org::eclipse::papyrus::acceleo::GenUtils/]
[import org::eclipse::papyrus::cpp::codegen::utils::CppGenUtils/]
[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.cppQualifiedName()/][modPtr()/][modRef()/] [attribute.name/][modArray()/][if (hasStereotype(C_Cpp::Const))][defaultValue()/][/if];
[/template]


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

[template public CppStaticAttributeImplementation(attribute : Property)]
[CppElementDoc()/]
[type.cppQualifiedName()/][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