diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-09-04 16:38:54 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-09-04 21:38:16 +0200 |
commit | 61f9748061ef752b5617ec244a8f451700dc18f4 (patch) | |
tree | 66dd61031a506844e0dfd8ad52f598b3989121d4 /scripts/templates/qclass.cpp | |
parent | df7fb2f660e151d0c5fbe62f90be9437ed190087 (diff) |
Add implementation of clone() in all UML metamodel objects
Change-Id: I9bb9c90159b813ee7d7b941b9fbb1d6f426bf487
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates/qclass.cpp')
-rw-r--r-- | scripts/templates/qclass.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp index 70ca0bab..b235d671 100644 --- a/scripts/templates/qclass.cpp +++ b/scripts/templates/qclass.cpp @@ -49,20 +49,16 @@ [%- SET generalization = class.findnodes("generalization") -%] [%- FOREACH superclass IN generalization -%] [%- superclasses.push("${namespace}${superclass.findvalue('@general')}") -%] -[%- END -%] +[%- END %] +[% SET useNamespace = 'false' -%] [%- forwards = [] -%] -[%- FOREACH forward = class.findnodes("ownedAttribute[@type] | ownedOperation/ownedParameter[@type]") -%] -[%- SET forwardName = forward.findvalue('@type') -%] -[%- IF xmi.findnodes("//packagedElement[@xmi:type='uml:Enumeration' and @name='$forwardName']").findvalue("@name") == "" -%] -[%- IF forwardName != className && superclasses.grep("^${namespace}${forwardName}\$").size == 0 -%][%- forwards.push("${namespace}${forwardName}") -%][%- END -%] -[%- END -%] +[%- visitedClasses = [] -%] +[%- GENERATE_FWD_DECLARATIONS(class, visitedClasses, forwards, useNamespace) -%] +[%- FOREACH forward = forwards.unique.sort %] +#include <Qt${namespace}/${forward}> +[%- IF loop.last %] +[% END -%] [%- END -%] -[%- FOREACH forward = forwards.unique.sort -%] -[%- IF loop.first %] -[% END %] -#include <Qt${namespace}/Q$${forward}> -[%- END %] - /*! \class Q${namespace}${className} |