Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 66a0c4d223d5f37d8e91af378541feccec65b0e1 (plain) (tree)
1
2
3
                                                                                                                          

                                                                 



















                                                                                                              
                                                                                                                
           
[module CppClassInheritedDeclarations('http://www.eclipse.org/uml2/5.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/]

[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).cppQualifiedName()/][/for]	
[/template]

Back to the top