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

[comment
Return a list of relationships that are either Generalizations or InterfaceRealiazations
and the target does not point to a classifier that has the no-code-gen Stereotype
TODO: not sure if it makes sense NOT to declare an inheritance, since we do not generate code.
/]
[query public filteredRelationships(class : Classifier) : Set(DirectedRelationship) =
	getSourceDirectedRelationships()->select(
		(oclIsKindOf(Generalization) or oclIsKindOf(InterfaceRealization)) and
		(not target->asSequence()->first().hasStereotype(NoCodeGen))
	)	
/]

[query public getCppVisibility(relationship : Relationship) : String =
if (hasStereotype(Visibility)) then getApplication(Visibility).oclAsType(Visibility).value else 'public' endif
/]

[template public CppClassInheritedDeclarations(class : Classifier)]
[if (filteredRelationships()->size() > 0)] : [/if]
[for (filteredRelationships()) separator(', \n')]
	[getCppVisibility()/] [target->asSequence()->first().oclAsType(Classifier).qualifiedName()/][/for]	
[/template]

Back to the top