summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-08-24 19:22:18 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-08-25 00:20:50 +0200
commitb03d76a60e4be52e8438f219bf7c45cc33dc3785 (patch)
tree095b111f366ffa77d86c6b81573b2e3263236ce2 /scripts
parent8d1209966085829e94894472be5e08c88de1554d (diff)
Add d-pointer support when generating artifacts from xmi
Change-Id: Ie9049b3d68208422c0860dc63ea295feb830451c Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/normative-xmi/DuSE.qtxmi151
-rw-r--r--scripts/normative-xmi/MOF-merged.qtxmi.gzbin16074 -> 0 bytes
-rw-r--r--scripts/normative-xmi/SADuSEProfile.qtxmi13
-rw-r--r--scripts/normative-xmi/UML.qtxmi.gzbin76837 -> 0 bytes
-rw-r--r--scripts/normative-xmi/testing.qtxmi266
-rw-r--r--scripts/normative-xmi/xmi2qt.xq436
-rw-r--r--scripts/normative-xmi/xmi2qt2.xq160
-rw-r--r--scripts/templates/class.cpp16
-rw-r--r--scripts/templates/class.h20
-rw-r--r--scripts/templates/class_p.h24
-rw-r--r--scripts/templates/module.pro2
-rwxr-xr-xscripts/xmiclassinheritance2png.sh25
-rwxr-xr-xscripts/xmiinheritance2png.sh10
13 files changed, 78 insertions, 1045 deletions
diff --git a/scripts/normative-xmi/DuSE.qtxmi b/scripts/normative-xmi/DuSE.qtxmi
deleted file mode 100644
index c813af2e..00000000
--- a/scripts/normative-xmi/DuSE.qtxmi
+++ /dev/null
@@ -1,151 +0,0 @@
-<qtxmi:XMI xmlns:qtxmi="http://www.qt-project.org" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701">
- <namespace path="QtDuse">
- <class name="QDuseDesignSpace" isAbstract="false">
- <documentation>A design space entails the design dimensions (degrees of freedom) and quality metrics for a particular application domain.</documentation>
- <qtinclude>QtCore/QString</qtinclude>
- <qtinclude>QtCore/QList</qtinclude>
- <qtinclude>QtCore/QSet</qtinclude>
- <forwarddecl namespace="QtDuse" class="QDuseDesignDimension"/>
- <forwarddecl namespace="QtDuse" class="QDuseQualityMetric"/>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignSpace-name" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="name" constness=" const"/>
- <accessor return="void " name="setName" constness="">
- <parameter type="QString " name="name"/>
- </accessor>
- <documentation>The design space's name.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignSpace-designDimension" defaultValue="" aggregation="composite" subsettedBy="">
- <accessor return="QList&lt;QDuseDesignDimension *&gt; " name="designDimensions" constness=" const"/>
- <accessor return="void " name="addDesignDimension" constness="">
- <parameter type="QDuseDesignDimension *" name="designDimension"/>
- </accessor>
- <accessor return="void " name="removeDesignDimension" constness="">
- <parameter type="QDuseDesignDimension *" name="designDimension"/>
- </accessor>
- <documentation>The design dimensions (degrees of freedom) of the design space.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignSpace-qualityMetric" defaultValue="" aggregation="composite" subsettedBy="">
- <accessor return="QSet&lt;QDuseQualityMetric *&gt; " name="qualityMetrics" constness=" const"/>
- <accessor return="void " name="addQualityMetric" constness="">
- <parameter type="QDuseQualityMetric *" name="qualityMetric"/>
- </accessor>
- <accessor return="void " name="removeQualityMetric" constness="">
- <parameter type="QDuseQualityMetric *" name="qualityMetric"/>
- </accessor>
- <documentation>The quality metrics defined for the design space.</documentation>
- </attribute>
- </class>
- <class name="QDuseDesignDimension" isAbstract="false">
- <documentation>A design dimension captures a specific degree of freedom when designing architectures in the given application domain. A design dimension entails a set of variation points which denote alternative solutions for such degree of freedom. Optionally, a variation point may define validation rules which should return a true value if that variation point is to be considered valid for the corresponding input model. A variation point may also specify a set of other variation points which should be previously evaluated, defining a sort of design dimension dependency.</documentation>
- <qtinclude>QtCore/QString</qtinclude>
- <qtinclude>QtCore/QSet</qtinclude>
- <forwarddecl namespace="QtDuse" class="QDuseDesignDimension"/>
- <forwarddecl namespace="QtDuse" class="QDuseVariationPoint"/>
- <forwarddecl namespace="QtDuse" class="QDuseDesignDimensionInstance"/>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignSpace-name" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="name" constness=" const"/>
- <accessor return="void " name="setName" constness="">
- <parameter type="QString " name="name"/>
- </accessor>
- <documentation>The design dimension's name.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignSpace-instanceSelectionRule" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="instanceSelectionRule" constness=" const"/>
- <accessor return="void " name="setInstanceSelectionRule" constness="">
- <parameter type="QString " name="instanceSelectionRule"/>
- </accessor>
- <documentation>The rule for detecting a specific locus of architectural decision related to this design dimension. Such rule relies on the accompanying UML profile for the specific application domain, in order to identify the decision loci.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignDimension-requiredPreviousEvaluation" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QDuseDesignDimension *&gt; " name="requiredPreviousEvaluations" constness=" const"/>
- <accessor return="void " name="addRequiredPreviousEvaluation" constness="">
- <parameter type="QDuseDesignDimension *" name="requiredPreviousEvaluation"/>
- </accessor>
- <accessor return="void " name="removeRequiredPreviousEvaluation" constness="">
- <parameter type="QDuseDesignDimension *" name="requiredPreviousEvaluation"/>
- </accessor>
- <documentation>The design dimensions that must be previously evaluated before this design dimension. Such dependency may be required in order to tackle dependent design dimensions and identify invalid design space locations.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignDimension-variationPoint" defaultValue="" aggregation="composite" subsettedBy="">
- <accessor return="QSet&lt;QDuseVariationPoint *&gt; " name="variationPoints" constness=" const"/>
- <accessor return="void " name="addVariationPoint" constness="">
- <parameter type="QDuseVariationPoint *" name="variationPoint"/>
- </accessor>
- <accessor return="void " name="removeVariationPoint" constness="">
- <parameter type="QDuseVariationPoint *" name="variationPoint"/>
- </accessor>
- <documentation>The design dimension's variation points (alternative solutions for the design dimension's concern).</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="DesignDimension-designDimensionInstance" defaultValue="" aggregation="composite" subsettedBy="">
- <accessor return="QSet&lt;QDuseDesignDimensionInstance *&gt; " name="designDimensionInstances" constness=" const"/>
- <accessor return="void " name="addDesignDimensionInstance" constness="">
- <parameter type="QDuseDesignDimensionInstance *" name="designDimensionInstance"/>
- </accessor>
- <accessor return="void " name="removeDesignDimensionInstance" constness="">
- <parameter type="QDuseDesignDimensionInstance *" name="designDimensionInstance"/>
- </accessor>
- <documentation>A specific design dimension instance created for a identified locus of architectural decision.</documentation>
- </attribute>
- </class>
- <class name="QDuseVariationPoint" isAbstract="false">
- <documentation>A variation point represents a specific solution for a given design dimension. A variation point entails validation rules which check for valid combinations of variation points and a script which defines the architectural changes to be enacted from such solution.</documentation>
- <qtinclude>QtCore/QString</qtinclude>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="VariationPoint-name" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="name" constness=" const"/>
- <accessor return="void " name="setName" constness="">
- <parameter type="QString " name="name"/>
- </accessor>
- <documentation>The variation point's name.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="VariationPoint-rationale" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="rationale" constness=" const"/>
- <accessor return="void " name="setRationale" constness="">
- <parameter type="QString " name="rationale"/>
- </accessor>
- <documentation>The variation point's rationale.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="VariationPoint-preChangeValidationRule" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="preChangeValidationRule" constness=" const"/>
- <accessor return="void " name="setPreChangeValidationRule" constness="">
- <parameter type="QString " name="preChangeValidationRule"/>
- </accessor>
- <documentation>A set of rules which should be evaluated as true if design space locations containing such variation point are to be considered as valid ones.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="VariationPoint-modelChange" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="modelChange" constness=" const"/>
- <accessor return="void " name="setModelChange" constness="">
- <parameter type="QString " name="modelChange"/>
- </accessor>
- <documentation>The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points.</documentation>
- </attribute>
- </class>
- <class name="QDuseDesignDimensionInstance" isAbstract="false">
- <documentation>A specific design dimenstion instance created to tackle a particular locus of architectural decision in the input model.</documentation>
- </class>
- <class name="QDuseQualityMetric" isAbstract="false">
- <documentation>A quality metric defined for the corresponding design space.</documentation>
- <qtinclude>QtCore/QString</qtinclude>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="QualityMetric-name" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="name" constness=" const"/>
- <accessor return="void " name="setName" constness="">
- <parameter type="QString " name="name"/>
- </accessor>
- <documentation>The quality metric's name.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="QualityMetric-value" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="qreal " name="value" constness=" const"/>
- <accessor return="void " name="setValue" constness="">
- <parameter type="qreal " name="value"/>
- </accessor>
- <documentation>The quality metric's value.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="QualityMetric-expression" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QString " name="expression" constness=" const"/>
- <accessor return="void " name="setExpression" constness="">
- <parameter type="QString " name="expression"/>
- </accessor>
- <documentation>The quality metric's evaluation expression.</documentation>
- </attribute>
- </class>
- </namespace>
-</qtxmi:XMI>
diff --git a/scripts/normative-xmi/MOF-merged.qtxmi.gz b/scripts/normative-xmi/MOF-merged.qtxmi.gz
deleted file mode 100644
index 8c3c2192..00000000
--- a/scripts/normative-xmi/MOF-merged.qtxmi.gz
+++ /dev/null
Binary files differ
diff --git a/scripts/normative-xmi/SADuSEProfile.qtxmi b/scripts/normative-xmi/SADuSEProfile.qtxmi
deleted file mode 100644
index 117cb2e4..00000000
--- a/scripts/normative-xmi/SADuSEProfile.qtxmi
+++ /dev/null
@@ -1,13 +0,0 @@
-<qtxmi:XMI xmlns:qtxmi="http://www.qt-project.org" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701">
- <namespace path="QtSADuse">
- <class name="QSADuseProcessComponent" isAbstract="false">
- <forwarddecl namespace="QtUml" class="QUmlComponent"/>
- <associationend isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="ProcessComponent-base_Component" defaultValue="" aggregation="none" oppositeEnd="" subsettedBy="">
- <accessor return="QUmlComponent *" name="base_Component" constness=" const"/>
- <accessor return="void " name="setBase_Component" constness="">
- <parameter type="QUmlComponent *" name="base_Component"/>
- </accessor>
- </associationend>
- </class>
- </namespace>
-</qtxmi:XMI>
diff --git a/scripts/normative-xmi/UML.qtxmi.gz b/scripts/normative-xmi/UML.qtxmi.gz
deleted file mode 100644
index 0638cb94..00000000
--- a/scripts/normative-xmi/UML.qtxmi.gz
+++ /dev/null
Binary files differ
diff --git a/scripts/normative-xmi/testing.qtxmi b/scripts/normative-xmi/testing.qtxmi
deleted file mode 100644
index 2ef144de..00000000
--- a/scripts/normative-xmi/testing.qtxmi
+++ /dev/null
@@ -1,266 +0,0 @@
-<qtxmi:XMI xmlns:qtxmi="http://www.qt-project.org" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701">
- <namespace path="QtUnknown">
- <class name="QBaseClass" isAbstract="true">
- <qtinclude>QtCore/QSet</qtinclude>
- <forwarddecl namespace="">QUsedClass</forwarddecl>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="BaseClass-readWriteSingleValuedPrimitiveAttribute" defaultValue="true" aggregation="none" subsettedBy="">
- <accessor return="bool " name="readWriteSingleValuedPrimitiveAttribute" constness=" const"/>
- <accessor return="void " name="setReadWriteSingleValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readWriteSingleValuedPrimitiveAttribute"/>
- </accessor>
- <documentation>readWriteSingleValuedPrimitiveAttribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="true" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="BaseClass-subsettedReadWriteAttribute" defaultValue="" aggregation="none" subsettedBy="TestingClass-subsetReadWriteAttribute">
- <accessor return="QUsedClass *" name="subsettedReadWriteAttribute" constness=" const"/>
- <accessor return="void " name="setSubsettedReadWriteAttribute" constness="">
- <parameter type="QUsedClass *" name="subsettedReadWriteAttribute"/>
- </accessor>
- <documentation>subsettedReadWriteAttribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="true" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="BaseClass-subsettedReadOnlyAttribute" defaultValue="" aggregation="none" subsettedBy="TestingClass-subsetReadOnlyAttribute">
- <accessor return="QSet&lt;QUsedClass *&gt; " name="subsettedReadOnlyAttributes" constness=" const"/>
- <accessor return="void " name="addSubsettedReadOnlyAttribute" constness="">
- <parameter type="QUsedClass *" name="subsettedReadOnlyAttribute"/>
- </accessor>
- <accessor return="void " name="removeSubsettedReadOnlyAttribute" constness="">
- <parameter type="QUsedClass *" name="subsettedReadOnlyAttribute"/>
- </accessor>
- <documentation>subsettedReadOnlyAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="BaseClass-slot" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="slots_" constness=" const"/>
- <accessor return="void " name="addSlot_" constness="">
- <parameter type="bool " name="slot_"/>
- </accessor>
- <accessor return="void " name="removeSlot_" constness="">
- <parameter type="bool " name="slot_"/>
- </accessor>
- <documentation>name mapped attribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="BaseClass-readWriteDerivedAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readWriteDerivedAttributes" constness=" const"/>
- <accessor return="void " name="addReadWriteDerivedAttribute" constness="">
- <parameter type="bool " name="readWriteDerivedAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadWriteDerivedAttribute" constness="">
- <parameter type="bool " name="readWriteDerivedAttribute"/>
- </accessor>
- <documentation>readWriteDerivedAttribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="BaseClass-readOnlyDerivedAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readOnlyDerivedAttributes" constness=" const"/>
- <accessor return="void " name="addReadOnlyDerivedAttribute" constness="">
- <parameter type="bool " name="readOnlyDerivedAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadOnlyDerivedAttribute" constness="">
- <parameter type="bool " name="readOnlyDerivedAttribute"/>
- </accessor>
- <documentation>readOnlyDerivedAttribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="true" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="BaseClass-readWriteDerivedUnionAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readWriteDerivedUnionAttributes" constness=" const"/>
- <accessor return="void " name="addReadWriteDerivedUnionAttribute" constness="">
- <parameter type="bool " name="readWriteDerivedUnionAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadWriteDerivedUnionAttribute" constness="">
- <parameter type="bool " name="readWriteDerivedUnionAttribute"/>
- </accessor>
- <documentation>readWriteDerivedUnionAttribute.</documentation>
- </attribute>
- <attribute isDerived="true" isDerivedUnion="true" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="BaseClass-readOnlyDerivedUnionAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readOnlyDerivedUnionAttributes" constness=" const"/>
- <accessor return="void " name="addReadOnlyDerivedUnionAttribute" constness="">
- <parameter type="bool " name="readOnlyDerivedUnionAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadOnlyDerivedUnionAttribute" constness="">
- <parameter type="bool " name="readOnlyDerivedUnionAttribute"/>
- </accessor>
- <documentation>readOnlyDerivedUnionAttribute.</documentation>
- </attribute>
- <operation return="QSet&lt;bool&gt; " name="aRealOperation" constness=" const">
- <documentation>Testing aRealOperation.</documentation>
- </operation>
- </class>
- <class name="QUsedClass" isAbstract="false"/>
- <class name="QTestingClass" isAbstract="false">
- <documentation>Testing class' comment 1.Testing class' comment 2.</documentation>
- <qtumlinclude>QtUnknown/QtUnknownNamespace</qtumlinclude>
- <superclass include="QtUnknown/QBaseClass" name="QBaseClass"/>
- <qtinclude>QtCore/QSet</qtinclude>
- <forwarddecl namespace="">QUsedClass</forwarddecl>
- <forwarddecl namespace="">QTestingClass</forwarddecl>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="BaseClass-subsettedReadWriteAttribute" redefinedProperty="" id="TestingClass-subsetReadWriteAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QUsedClass *&gt; " name="subsetReadWriteAttributes" constness=" const"/>
- <accessor return="void " name="addSubsetReadWriteAttribute" constness="">
- <parameter type="QUsedClass *" name="subsetReadWriteAttribute"/>
- </accessor>
- <accessor return="void " name="removeSubsetReadWriteAttribute" constness="">
- <parameter type="QUsedClass *" name="subsetReadWriteAttribute"/>
- </accessor>
- <documentation>subsetReadWriteAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="BaseClass-subsettedReadOnlyAttribute" redefinedProperty="" id="TestingClass-subsetReadOnlyAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QUsedClass *" name="subsetReadOnlyAttribute" constness=" const"/>
- <accessor return="void " name="setSubsetReadOnlyAttribute" constness="">
- <parameter type="QUsedClass *" name="subsetReadOnlyAttribute"/>
- </accessor>
- <documentation>subsetReadOnlyAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="BaseClass-readWriteSingleValuedPrimitiveAttribute" id="TestingClass-readWriteSingleValuedPrimitiveAttribute" defaultValue="false" aggregation="none" subsettedBy="">
- <accessor return="bool " name="readWriteSingleValuedPrimitiveAttribute" constness=" const"/>
- <accessor return="void " name="setReadWriteSingleValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readWriteSingleValuedPrimitiveAttribute"/>
- </accessor>
- <documentation>readWriteSingleValuedPrimitiveAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlySingleValuedPrimitiveAttribute" defaultValue="1" aggregation="none" subsettedBy="">
- <accessor return="qint32 " name="readOnlySingleValuedPrimitiveAttribute" constness=" const"/>
- <accessor return="void " name="setReadOnlySingleValuedPrimitiveAttribute" constness="">
- <parameter type="qint32 " name="readOnlySingleValuedPrimitiveAttribute"/>
- </accessor>
- <documentation>readOnlySingleValuedPrimitiveAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="TestingClass-readWriteMultiValuedPrimitiveAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readWriteMultiValuedPrimitiveAttributes" constness=" const"/>
- <accessor return="void " name="addReadWriteMultiValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readWriteMultiValuedPrimitiveAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadWriteMultiValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readWriteMultiValuedPrimitiveAttribute"/>
- </accessor>
- <documentation>readWriteMultiValuedPrimitiveAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlyMultiValuedPrimitiveAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;bool&gt; " name="readOnlyMultiValuedPrimitiveAttributes" constness=" const"/>
- <accessor return="void " name="addReadOnlyMultiValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readOnlyMultiValuedPrimitiveAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadOnlyMultiValuedPrimitiveAttribute" constness="">
- <parameter type="bool " name="readOnlyMultiValuedPrimitiveAttribute"/>
- </accessor>
- <documentation>readOnlyMultiValuedPrimitiveAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlySingleValuedEnumerationAttribute" defaultValue="" aggregation="none" subsettedBy="TestingClass-readWriteSingleValuedEnumerationAttribute">
- <accessor return="QtUnknown::VisibilityKind " name="readOnlySingleValuedEnumerationAttribute" constness=" const"/>
- <accessor return="void " name="setReadOnlySingleValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readOnlySingleValuedEnumerationAttribute"/>
- </accessor>
- <documentation>readOnlySingleValuedEnumerationAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="TestingClass-readWriteMultiValuedEnumerationAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QtUnknown::VisibilityKind&gt; " name="readWriteMultiValuedEnumerationAttributes" constness=" const"/>
- <accessor return="void " name="addReadWriteMultiValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readWriteMultiValuedEnumerationAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadWriteMultiValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readWriteMultiValuedEnumerationAttribute"/>
- </accessor>
- <documentation>readWriteMultiValuedEnumerationAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlyMultiValuedEnumerationAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QtUnknown::VisibilityKind&gt; " name="readOnlyMultiValuedEnumerationAttributes" constness=" const"/>
- <accessor return="void " name="addReadOnlyMultiValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readOnlyMultiValuedEnumerationAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadOnlyMultiValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readOnlyMultiValuedEnumerationAttribute"/>
- </accessor>
- <documentation>readOnlyMultiValuedEnumerationAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlySingleValuedObjectAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QUsedClass *" name="readOnlySingleValuedObjectAttribute" constness=" const"/>
- <accessor return="void " name="setReadOnlySingleValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readOnlySingleValuedObjectAttribute"/>
- </accessor>
- <documentation>readOnlySingleValuedObjectAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="TestingClass-readWriteMultiValuedObjectAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QUsedClass *&gt; " name="readWriteMultiValuedObjectAttributes" constness=" const"/>
- <accessor return="void " name="addReadWriteMultiValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readWriteMultiValuedObjectAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadWriteMultiValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readWriteMultiValuedObjectAttribute"/>
- </accessor>
- <documentation>readWriteMultiValuedObjectAttribute.</documentation>
- </attribute>
- <attribute isDerived="false" isDerivedUnion="false" isReadOnly="true" subsettedProperty="" redefinedProperty="" id="TestingClass-readOnlyMultiValuedObjectAttribute" defaultValue="" aggregation="none" subsettedBy="">
- <accessor return="QSet&lt;QUsedClass *&gt; " name="readOnlyMultiValuedObjectAttributes" constness=" const"/>
- <accessor return="void " name="addReadOnlyMultiValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readOnlyMultiValuedObjectAttribute"/>
- </accessor>
- <accessor return="void " name="removeReadOnlyMultiValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readOnlyMultiValuedObjectAttribute"/>
- </accessor>
- <documentation>readOnlyMultiValuedObjectAttribute.</documentation>
- </attribute>
- <associationend isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="UsedClass-oppositeReadWriteSingleValuedObjectAttribute" defaultValue="" aggregation="none" oppositeEnd="TestingClass-readWriteSingleValuedObjectAttribute" subsettedBy="">
- <accessor return="QTestingClass *" name="oppositeReadWriteSingleValuedObjectAttribute" constness=" const"/>
- <accessor return="void " name="setOppositeReadWriteSingleValuedObjectAttribute" constness="">
- <parameter type="QTestingClass *" name="oppositeReadWriteSingleValuedObjectAttribute"/>
- </accessor>
- <documentation>oppositeReadWriteSingleValuedObjectAttribute.</documentation>
- </associationend>
- <associationend isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="TestingClass-readOnlySingleValuedEnumerationAttribute TestingClass-readWriteMultiValuedEnumerationAttribute" redefinedProperty="" id="TestingClass-readWriteSingleValuedEnumerationAttribute" defaultValue="QtUnknown::VisibilityPublic" aggregation="none" oppositeEnd="" subsettedBy="">
- <accessor return="QtUnknown::VisibilityKind " name="readWriteSingleValuedEnumerationAttribute" constness=" const"/>
- <accessor return="void " name="setReadWriteSingleValuedEnumerationAttribute" constness="">
- <parameter type="QtUnknown::VisibilityKind " name="readWriteSingleValuedEnumerationAttribute"/>
- </accessor>
- <documentation>readWriteSingleValuedEnumerationAttribute.</documentation>
- </associationend>
- <associationend isDerived="false" isDerivedUnion="false" isReadOnly="false" subsettedProperty="" redefinedProperty="" id="TestingClass-readWriteSingleValuedObjectAttribute" defaultValue="" aggregation="none" oppositeEnd="UsedClass-oppositeReadWriteSingleValuedObjectAttribute" subsettedBy="">
- <accessor return="QUsedClass *" name="readWriteSingleValuedObjectAttribute" constness=" const"/>
- <accessor return="void " name="setReadWriteSingleValuedObjectAttribute" constness="">
- <parameter type="QUsedClass *" name="readWriteSingleValuedObjectAttribute"/>
- </accessor>
- <documentation>readWriteSingleValuedObjectAttribute.</documentation>
- </associationend>
- <operation return="bool " name="opReturnPrimitiveSV" constness=" const">
- <documentation>Testing opReturnPrimitiveSV.</documentation>
- </operation>
- <operation return="QSet&lt;bool&gt; " name="opReturnPrimitiveMV" constness=" const">
- <documentation>Testing opReturnPrimitiveMV.</documentation>
- </operation>
- <operation return="QtUnknown::VisibilityKind " name="opReturnEnumerationSV" constness=" const">
- <documentation>Testing opReturnEnumerationSV.</documentation>
- </operation>
- <operation return="QSet&lt;QtUnknown::VisibilityKind&gt; " name="opReturnEnumerationMV" constness=" const">
- <documentation>Testing opReturnEnumerationMV.</documentation>
- </operation>
- <operation return="QUsedClass *" name="opReturnObjectSV" constness=" const">
- <documentation>Testing opReturnObjectSV.</documentation>
- </operation>
- <operation return="QSet&lt;QUsedClass *&gt; " name="opReturnObjectMV" constness=" const">
- <documentation>Testing opReturnObjectMV.</documentation>
- </operation>
- <operation return="void " name="opParameters" constness=" const">
- <parameter type="bool " name="pinprimitiveSV"/>
- <parameter type="QtUnknown::VisibilityKind " name="pinenumerationSV"/>
- <parameter type="const QUsedClass *" name="pinobjectSV"/>
- <parameter type="QSet&lt;bool&gt; " name="pinprimitiveMV"/>
- <parameter type="QSet&lt;QtUnknown::VisibilityKind&gt; " name="pinenumerationMV"/>
- <parameter type="QSet&lt;QUsedClass *&gt; " name="pinobjectMV"/>
- <parameter type="bool &amp;" name="pinoutprimitiveSV"/>
- <parameter type="QtUnknown::VisibilityKind &amp;" name="pinoutenumerationSV"/>
- <parameter type="QUsedClass *" name="pinoutobjectSV"/>
- <parameter type="const QSet&lt;bool&gt; &amp;" name="pinoutprimitiveMV"/>
- <parameter type="const QSet&lt;QtUnknown::VisibilityKind&gt; &amp;" name="pinoutenumerationMV"/>
- <parameter type="const QSet&lt;QUsedClass *&gt; " name="pinoutobjectMV"/>
- <parameter type="bool &amp;" name="poutprimitiveSV"/>
- <parameter type="QtUnknown::VisibilityKind &amp;" name="poutenumerationSV"/>
- <parameter type="QUsedClass *" name="poutobjectSV"/>
- <parameter type="const QSet&lt;bool&gt; &amp;" name="poutprimitiveMV"/>
- <parameter type="const QSet&lt;QtUnknown::VisibilityKind&gt; &amp;" name="poutenumerationMV"/>
- <parameter type="const QSet&lt;QUsedClass *&gt; " name="poutobjectMV"/>
- <documentation>Testing opParameters.</documentation>
- </operation>
- </class>
- <enumeration name="VisibilityKind">
- <documentation>VisibilityKind is an enumeration type that defines literals to determine the visibility of elements in a model.</documentation>
- <literal name="VisibilityPublic" documentation="A public element is visible to all elements that can access the contents of the namespace that owns it."/>
- <literal name="VisibilityPrivate" documentation="A private element is only visible inside the namespace that owns it."/>
- <literal name="VisibilityProtected" documentation="A protected element is visible to elements that have a generalization relationship to the namespace that owns it."/>
- <literal name="VisibilityPackage" documentation="A package element is owned by a namespace that is not a package, and is visible to elements that are in the same package as its owning namespace. Only named elements that are not owned by packages can be marked as having package visibility. Any element marked as having package visibility is visible to all elements within the nearest enclosing package (given that other owning elements have proper visibility). Outside the nearest enclosing package, an element marked as having package visibility is not visible."/>
- </enumeration>
- </namespace>
-</qtxmi:XMI>
diff --git a/scripts/normative-xmi/xmi2qt.xq b/scripts/normative-xmi/xmi2qt.xq
deleted file mode 100644
index 1d718d99..00000000
--- a/scripts/normative-xmi/xmi2qt.xq
+++ /dev/null
@@ -1,436 +0,0 @@
-declare namespace xmi="http://www.omg.org/spec/XMI/20110701";
-declare namespace qtxmi="http://www.qt-project.org";
-
-declare function qtxmi:typeStringFromProperty ($properties as node()*) as xs:string* {
- for $property in $properties
- return tokenize(
- if ($property/@type) then xs:string($property/@type)
- else if ($property/type/@xmi:idref) then xs:string($property/type/@xmi:idref)
- else if ($property/type/@href) then xs:string($property/type/@href)
- else "qtxmi:unknownType",
- "/")[last()]
-};
-
-declare function qtxmi:mappedBaseNamespace($xmiFile as xs:string*) as xs:string* {
- if ($xmiFile = "PrimitiveTypes.xmi") then ""
- else if ($xmiFile = "Superstructure.xmi") then "QtUml"
- else if ($xmiFile = "UML.xmi") then "QtUml"
- else if ($xmiFile = "MOF.xmi") then "QtMof"
- else if ($xmiFile = "MOF-merged.xmi") then "QtMof"
- else if ($xmiFile = "DuSE.xmi") then "QtDuse"
- else if ($xmiFile = "SADuSEProfile.xmi") then "QtSADuse"
- else "QtUnknown"
-};
-
-declare function qtxmi:namespaceFromTypeString ($types as xs:string*) as xs:string* {
- for $type in $types
- let $baseNamespace := qtxmi:mappedBaseNamespace(
- if (tokenize(tokenize($type, "/")[last()], "#")[1]
- = tokenize(tokenize($type, "/")[last()], "#")[last()]) then
- $xmiFile
- else
- tokenize(tokenize($type, "/")[last()], "#")[1])
- let $namespaceArray := tokenize(tokenize(tokenize($type, "/")[last()], "#")[last()], "-")
- return concat(concat($baseNamespace,
- string-join(remove($namespaceArray, count($namespaceArray)), "::")),
- "::")
-};
-
-declare function qtxmi:namespaceFromProperty ($properties as node()*) as xs:string* {
- qtxmi:namespaceFromTypeString(qtxmi:typeStringFromProperty($properties))
-};
-
-declare function qtxmi:unqualifiedTypeFromTypeString ($types as xs:string*) as xs:string* {
- for $type in $types
- let $unqualifiedType := tokenize(tokenize(tokenize($type, "/")[last()], "#")[last()], "-")[last()]
- return $unqualifiedType
-};
-
-declare function qtxmi:unqualifiedTypeFromProperty ($properties as node()*) as xs:string* {
- qtxmi:unqualifiedTypeFromTypeString(qtxmi:typeStringFromProperty($properties))
-};
-
-declare function qtxmi:qualifiedTypeFromTypeString ($types as xs:string*) as xs:string* {
- concat(qtxmi:namespaceFromTypeString($types), qtxmi:unqualifiedTypeFromTypeString($types))
-};
-
-declare function qtxmi:qualifiedTypeFromProperty ($properties as node()*) as xs:string* {
- qtxmi:qualifiedTypeFromTypeString(qtxmi:typeStringFromProperty($properties))
-};
-
-declare function qtxmi:elementFromTypeString ($types as xs:string*) as node()* {
- for $type in $types
- let $unqualifiedType := tokenize(tokenize($type, "/")[last()], "#")[last()]
- let $file := if (tokenize(tokenize($type, "/")[last()], "#")[last()]
- = tokenize(tokenize($type, "/")[last()], "#")[1]) then
- $xmiFile
- else
- tokenize(tokenize($type, "/")[last()], "#")[1]
- return
- doc($file)//*[@xmi:id = $unqualifiedType]
-};
-
-declare function qtxmi:elementFromProperty ($properties as node()*) as node()* {
- qtxmi:elementFromTypeString(qtxmi:typeStringFromProperty($properties))
-};
-
-declare function qtxmi:mappedPrimitiveType ($primitiveType as xs:string*) as xs:string* {
- if ($primitiveType = "Boolean") then "bool"
- else if ($primitiveType = "Integer" or $primitiveType = "UnlimitedNatural") then "qint32"
- else if ($primitiveType = "Real") then "qreal"
- else if ($primitiveType = "String") then "QString"
- else "qtxmi:unknownPrimitiveType"
-};
-
-declare function qtxmi:mappedFunctionName ($name as xs:string*) as xs:string* {
- if ($name = "namespace") then "namespace_"
- else if ($name = "interface") then "interface_"
- else if ($name = "class") then "class_"
- else if ($name = "default") then "default_"
- else if ($name = "template") then "template_"
- else if ($name = "slot") then "slot_"
- else if ($name = "delete") then "delete_"
- else $name
-};
-
-declare function qtxmi:modifiedFunctionName ($property as node()*) as xs:string* {
- let $mappedFunctionName := qtxmi:mappedFunctionName($property/@name)
- let $functionName := if ($property/upperValue/@value != "1"
- and not((starts-with($property/@name, "in") or starts-with($property/@name, "to")) and
- substring($property/@name, 3, 1) = upper-case(substring($property/@name, 3, 1)))
- and $property/@name != "provided"
- and $property/@name != "required"
- and $property/@name != "endData"
- and $property/@name != "conveyed"
- and $property/@name != "covered"
- and $property/@name != "coveredBy"
- and $property/@name != "conformance"
- and $property/@name != "referred"
- and $property/@name != "represented"
- ) then
- concat(replace(replace(replace(replace(replace(qtxmi:mappedFunctionName($property/@name), "_$", ""), "y$", "ie"), "ss$", "sse"), "ex$", "ice"), "x$", "ce"), "s")
- else qtxmi:mappedFunctionName($property/@name)
- let $functionName := if(ends-with($mappedFunctionName, "_") and not(ends-with($functionName, "_"))) then concat($functionName, "_") else $functionName
- return $functionName
-};
-
-declare function qtxmi:typeFromNamespacedTypeString ($string as xs:string, $namespace as xs:string) as xs:string {
- let $type := qtxmi:unqualifiedTypeFromTypeString($string)
- let $element := qtxmi:elementFromTypeString($string)
- let $propertyNamespace := replace(qtxmi:namespaceFromTypeString($string), $namespace, "")
- let $type := if ($type = "Object" and $propertyNamespace != "") then
- concat(substring(tokenize($propertyNamespace, "::")[1], 3), $type)
- else
- $type
- let $type := if ($element/@xmi:type = "uml:Class") then
- concat(replace(replace($namespace, "^Qt", "Q"), "::", ""), $type)
- else if ($element/@xmi:type = "uml:Enumeration") then
- concat($namespace, $type)
- else
- qtxmi:mappedPrimitiveType($type)
- return $type
-};
-
-declare function qtxmi:typeFromNamespacedProperty ($property as node(), $namespace as xs:string) as xs:string {
- qtxmi:typeFromNamespacedTypeString(qtxmi:typeStringFromProperty($property), $namespace)
-};
-
-declare function qtxmi:collectionFromProperty ($property as node()) as xs:string {
- let $isUnique := if (not($property/@isUnique) or $property/@isUnique = "true") then "true" else "false"
- let $isOrdered := if (not($property/@isOrdered) or $property/@isOrdered = "false") then "false" else "true"
- return if ($isUnique = "true" and $isOrdered = "false") then "QSet<" else "QList<"
-};
-
-declare function qtxmi:modifiedTypeFromNamespacedProperty ($property as node(), $namespace as xs:string, $collection as xs:boolean) as xs:string {
- let $type := qtxmi:typeFromNamespacedProperty($property, $namespace)
- let $element := qtxmi:elementFromProperty($property)
- let $type := if ($property/upperValue/@value != "1" and $collection) then
- concat(qtxmi:collectionFromProperty($property), $type)
- else
- $type
- let $type := if (($property/upperValue/@value != "1" or ($element/@xmi:type = "uml:Class" and not($collection))) and $element/@xmi:type = "uml:Class") then
- concat($type, " *")
- else
- $type
- let $type := if ($property/upperValue/@value != "1" and $collection) then
- concat($type, ">")
- else
- $type
- let $type := if (($property/@direction = "inout" or $property/@direction = "out") and $property/upperValue/@value != "1") then
- concat ("const ", $type)
- else
- $type
- let $type := if ($collection and $element/@xmi:type = "uml:Class") then
- if ($property/upperValue/@value != "1") then
- $type
- else
- concat ($type, " *")
- else if ($element/@xmi:type != "uml:Class" and ($property/@direction = "inout" or $property/@direction = "out")) then
- concat ($type, " &amp;")
- else
- $type
- return $type
-};
-
-declare function qtxmi:capitalizedNameFromTypeString ($unqualifiedType as xs:string, $name as xs:string) as xs:string {
- let $capitalizedName := $name
- let $capitalizedName := if ($unqualifiedType = "bool " and starts-with($name, "is")
- and substring($name, 3, 1) = upper-case(substring($name, 3, 1))) then
- substring($name, 3)
- else
- $capitalizedName
- return concat(upper-case(substring($capitalizedName, 1, 1)), substring($capitalizedName, 2))
-};
-
-declare function qtxmi:defaultValue ($property as node(), $namespace) as xs:string {
- let $namespace := replace ($namespace, "::::$", "::")
- let $defaultValue := if ($property/defaultValue) then
- if ($property/defaultValue/@xmi:type = "uml:LiteralBoolean") then
- if ($property/defaultValue/@value) then xs:string($property/defaultValue/@value) else "false"
- else if ($property/defaultValue/@xmi:type = "uml:LiteralUnlimitedNatural") then
- if ($property/defaultValue/@value) then replace($property/defaultValue/@value, "\*", "-1") else "0"
- else if ($property/defaultValue/@xmi:type = "uml:InstanceValue" and
- qtxmi:elementFromTypeString($property/defaultValue/@type)/@xmi:type = "uml:Enumeration") then
- if ($property/defaultValue/@instance) then
- concat($namespace,
- concat(replace(replace(tokenize($property/defaultValue/@instance, "-")[1], "Kind", ""), "Sort", ""),
- concat(upper-case(substring(tokenize($property/defaultValue/@instance, "-")[2], 1, 1)),
- substring(tokenize($property/defaultValue/@instance, "-")[2], 2))))
- else ""
- else ""
- else ""
- return $defaultValue
-};
-
-declare function qtxmi:oppositeEnd($property as node()) as xs:string {
- let $memberEnd := if ($property/@association) then
- xs:string(doc($xmiFile)//packagedElement[@xmi:id = $property/@association]/@memberEnd)
- else ""
- let $oppositeEnd := if ($memberEnd != "") then
- tokenize($memberEnd, " ")[1]
- else ""
- let $oppositeEnd := if ($oppositeEnd != "" and $oppositeEnd = $property/@xmi:id) then
- tokenize($memberEnd, " ")[2]
- else $oppositeEnd
- return if (starts-with($oppositeEnd, "A_")) then "" else $oppositeEnd
-};
-
-declare function qtxmi:allSubsettedProperties($packagedElements as node()*) as xs:string* {
- for $packagedElement in $packagedElements
- return if ($packagedElement/@subsettedProperty) then
- distinct-values((
- for $item in tokenize(xs:string($packagedElement/@subsettedProperty), " ")
- where not(starts-with($item, "A_"))
- return $item,
- qtxmi:allSubsettedProperties(qtxmi:elementFromTypeString(
- for $item in tokenize(xs:string($packagedElement/@subsettedProperty), " ")
- where starts-with($item, "A_")
- return $item
- ))
- ))
- else ()
-};
-
-declare function qtxmi:subsettedBy($property as node()) as xs:string {
- string-join(doc($xmiFile)//ownedAttribute[contains(@subsettedProperty, $property/@xmi:id)]/@xmi:id, " ")
-};
-
-<qtxmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701" xmlns:qtxmi="http://www.qt-project.org">
-{
-for $namespace in distinct-values((doc($xmiFile)//packagedElement[@xmi:type="uml:Package" or @xmi:type="uml:Profile"] | doc($xmiFile)//uml:Package | doc($xmiFile)//uml:Profile)/@xmi:id)
-return
-<namespace path="{replace(replace(replace(concat(qtxmi:mappedBaseNamespace($xmiFile), $namespace), "-", "/"), "::", "/"), "/$", "")}">
-{
-for $class in doc($xmiFile)//*[@xmi:id=$namespace]/packagedElement[@xmi:type="uml:Class" or @xmi:type="uml:Stereotype"]
-let $namespace := concat(replace(concat(qtxmi:mappedBaseNamespace($xmiFile), $namespace), "-", "::"), "::")
-let $superClasses := $class/generalization/@general | $class/generalization/general/@xmi:idref | $class/generalization/general/@href
-let $isAbstract := if ($class/@isAbstract) then $class/@isAbstract else "false"
-return
- <class name="{replace(replace($namespace, '^Qt', 'Q'), '::', '')}{qtxmi:unqualifiedTypeFromTypeString($class/@xmi:id)}" isAbstract="{$isAbstract}">
- {
- if ($class/ownedComment/body) then
- <documentation>{$class/ownedComment/body/text()}</documentation>
- else ""
- }
- {
- for $id in qtxmi:elementFromProperty($class/ownedAttribute | $class/ownedOperation/ownedParameter)/@xmi:type
- where $id = "uml:Enumeration"
- return
- <qtumlinclude>{replace(qtxmi:mappedBaseNamespace($xmiFile), "::", "")}/{tokenize($namespace, "::")[1]}Namespace</qtumlinclude>
- }
- {
- for $superClass in $superClasses
- return
- <superclass include="{tokenize(qtxmi:namespaceFromTypeString($superClass), "::")[1]}/{replace(replace($namespace, '^Qt', 'Q'), '::', '')}{qtxmi:unqualifiedTypeFromTypeString($superClass)}" name="{qtxmi:typeFromNamespacedTypeString($superClass, $namespace)}"/>
- }
- {
- for $type in distinct-values($class/ownedAttribute/type/@href | $class/ownedOperation/ownedParameter/type/@href)
- where tokenize($type, "#")[last()] = "String"
- return
- <qtinclude>QtCore/QString</qtinclude>
- }
- {
- for $value in distinct-values($class/ownedAttribute[not((not(@isUnique) or @isUnique = "true")
- and (not(@isOrdered) or @isOrdered = "false"))]/upperValue/@value
- | $class/ownedOperation/ownedParameter[not((not(@isUnique) or @isUnique = "true")
- and (not(@isOrdered) or @isOrdered = "false"))]/upperValue/@value)
- where $value != "1"
- return
- <qtinclude>QtCore/QList</qtinclude>
- }
- {
- for $value in distinct-values($class/ownedAttribute[(not(@isUnique) or @isUnique = "true")
- and (not(@isOrdered) or @isOrdered = "false")]/upperValue/@value
- | $class/ownedOperation/ownedParameter[(not(@isUnique) or @isUnique = "true")
- and (not(@isOrdered) or @isOrdered = "false")]/upperValue/@value)
- where $value != "1"
- return
- <qtinclude>QtCore/QSet</qtinclude>
- }
- {
- for $id in distinct-values($class/ownedAttribute/@type | $class/ownedOperation/ownedParameter/@type
- | $class/ownedAttribute/type/@xmi:idref | $class/ownedOperation/ownedParameter/type/@xmi:idref
- | $class/ownedAttribute/type/@href | $class/ownedOperation/ownedParameter/type/@href)
- let $forwardNamespace := tokenize(qtxmi:namespaceFromTypeString($id), "::")
- where qtxmi:elementFromTypeString($id)/@xmi:type = "uml:Class"
- and empty(distinct-values($id[.=$superClasses]))
- order by $forwardNamespace
- return
- <forwarddecl namespace="{$forwardNamespace}" class="{replace(replace($namespace, '^Qt', 'Q'), '::', '')}{qtxmi:unqualifiedTypeFromTypeString($id)}"/>
- }
- {
- for $attribute in $class/ownedAttribute
- let $unqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("true"))
- let $unqualifiedType := if (ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&amp;")) then $unqualifiedType else concat($unqualifiedType, " ")
- let $singleUnqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("false"))
- let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*") or ends-with($singleUnqualifiedType, "&amp;")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ")
- let $isDerived := if (not($attribute/@isDerived) or $attribute/@isDerived = "false") then "false" else "true"
- let $isDerivedUnion := if (not($attribute/@isDerivedUnion) or $attribute/@isDerivedUnion = "false") then "false" else "true"
- let $isReadOnly := if (not($attribute/@isReadOnly) or $attribute/@isReadOnly = "false") then "false" else "true"
- let $defaultValue := qtxmi:defaultValue($attribute, $namespace)
- where $attribute[not(@association)]
- return
- <attribute isDerived="{$isDerived}" isDerivedUnion="{$isDerivedUnion}" isReadOnly="{$isReadOnly}" subsettedProperty="{string-join(qtxmi:allSubsettedProperties($attribute), " ")}" redefinedProperty="{$attribute/@redefinedProperty}" id="{$attribute/@xmi:id}" defaultValue="{$defaultValue}" aggregation="{if (not($attribute/@aggregation)) then "none" else $attribute/@aggregation}" subsettedBy="{qtxmi:subsettedBy($attribute)}">
- <accessor return="{$unqualifiedType}" name="{qtxmi:modifiedFunctionName($attribute)}" constness=" const"/>
- {
- if (not($attribute/upperValue/@value) or $attribute/upperValue/@value = "1") then
- <accessor return="void " name="set{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/upperValue/@value and ($attribute/upperValue/@value != "0" or $attribute/upperValue/@value != "1")) then
- <accessor return="void " name="add{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/upperValue/@value and ($attribute/upperValue/@value != "0" or $attribute/upperValue/@value != "1")) then
- <accessor return="void " name="remove{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/ownedComment/body) then
- <documentation>{$attribute/ownedComment/body/text()}</documentation>
- else ""
- }
- </attribute>
- }
- {
- for $attribute in $class/ownedAttribute
- let $unqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("true"))
- let $unqualifiedType := if (ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&amp;")) then $unqualifiedType else concat($unqualifiedType, " ")
- let $singleUnqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($attribute, $namespace, xs:boolean("false"))
- let $singleUnqualifiedType := if (ends-with($singleUnqualifiedType, "*") or ends-with($singleUnqualifiedType, "&amp;")) then $singleUnqualifiedType else concat($singleUnqualifiedType, " ")
- let $isDerived := if (not($attribute/@isDerived) or $attribute/@isDerived = "false") then "false" else "true"
- let $isDerivedUnion := if (not($attribute/@isDerivedUnion) or $attribute/@isDerivedUnion = "false") then "false" else "true"
- let $isReadOnly := if (not($attribute/@isReadOnly) or $attribute/@isReadOnly = "false") then "false" else "true"
- let $defaultValue := qtxmi:defaultValue($attribute, $namespace)
- where $attribute[@association]
- return
- <associationend isDerived="{$isDerived}" isDerivedUnion="{$isDerivedUnion}" isReadOnly="{$isReadOnly}" subsettedProperty="{string-join(qtxmi:allSubsettedProperties($attribute), " ")}" redefinedProperty="{$attribute/@redefinedProperty}" id="{$attribute/@xmi:id}" defaultValue="{$defaultValue}" aggregation="{if (not($attribute/@aggregation)) then "none" else $attribute/@aggregation}" oppositeEnd="{qtxmi:oppositeEnd($attribute)}" subsettedBy="{qtxmi:subsettedBy($attribute)}">
- <accessor return="{$unqualifiedType}" name="{qtxmi:modifiedFunctionName($attribute)}" constness=" const"/>
- {
- if (not($attribute/upperValue/@value) or $attribute/upperValue/@value = "1") then
- <accessor return="void " name="set{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/upperValue/@value and ($attribute/upperValue/@value != "0" or $attribute/upperValue/@value != "1")) then
- <accessor return="void " name="add{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/upperValue/@value and ($attribute/upperValue/@value != "0" or $attribute/upperValue/@value != "1")) then
- <accessor return="void " name="remove{qtxmi:capitalizedNameFromTypeString($unqualifiedType, qtxmi:mappedFunctionName($attribute/@name))}" constness="">
- <parameter type="{$singleUnqualifiedType}" name="{qtxmi:mappedFunctionName($attribute/@name)}"/>
- </accessor>
- else ""
- }
- {
- if ($attribute/ownedComment/body) then
- <documentation>{$attribute/ownedComment/body/text()}</documentation>
- else ""
- }
- </associationend>
- }
- {
- for $operation in $class/ownedOperation
- let $constness := if ($operation/@isQuery = "true") then " const" else ""
- let $return := if ($operation/ownedParameter[@direction = "return"]) then
- qtxmi:modifiedTypeFromNamespacedProperty($operation/ownedParameter[@direction = "return"], $namespace, xs:boolean("true"))
- else
- "void"
- let $return := if (ends-with($return, "*") or ends-with($return, "&amp;")) then $return else concat($return, " ")
- where empty($class/ownedAttribute[@name = $operation/@name])
- return
- <operation return="{$return}" name="{qtxmi:mappedFunctionName($operation/@name)}" constness="{$constness}">
- {
- for $parameter in $operation/ownedParameter[not(@direction) or @direction != "return"]
- let $unqualifiedType := qtxmi:modifiedTypeFromNamespacedProperty($parameter, $namespace, xs:boolean("true"))
- let $unqualifiedType := if (ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&amp;")) then $unqualifiedType else concat($unqualifiedType, " ")
- let $unqualifiedType := if ((ends-with($unqualifiedType, "*") or ends-with($unqualifiedType, "&amp;"))
- and not(starts-with($unqualifiedType, "const ")) and (not($parameter/@direction)
- or $parameter/@direction = "in")) then
- concat("const ", $unqualifiedType)
- else
- $unqualifiedType
- return
- <parameter type="{$unqualifiedType}" name="{qtxmi:mappedFunctionName($parameter/@name)}"/>
- }
- {
- if ($operation/ownedComment/body) then
- <documentation>{$operation/ownedComment/body/text()}</documentation>
- else ""
- }
- </operation>
- }
- </class>
-}
-{
-for $enumeration in doc($xmiFile)//*[@xmi:id=$namespace]/packagedElement[@xmi:type="uml:Enumeration"]
-return
- <enumeration name="{$enumeration/@name}">
- {
- if ($enumeration/ownedComment/body) then
- <documentation>{$enumeration/ownedComment/body/text()}</documentation>
- else ""
- }
- {
- for $literal in $enumeration/ownedLiteral
- return
- <literal name="{concat(replace(replace($enumeration/@name, "Kind", ""), "Sort", ""), concat(upper-case(substring($literal/@name, 1, 1)), substring($literal/@name, 2)))}" documentation="{$literal/ownedComment/body/text()}"/>
- }
- </enumeration>
-}
-</namespace>
-}
-</qtxmi:XMI>
diff --git a/scripts/normative-xmi/xmi2qt2.xq b/scripts/normative-xmi/xmi2qt2.xq
deleted file mode 100644
index b86b02d4..00000000
--- a/scripts/normative-xmi/xmi2qt2.xq
+++ /dev/null
@@ -1,160 +0,0 @@
-declare namespace xmi="http://www.omg.org/spec/XMI/20110701";
-declare namespace qtxmi="http://www.qt-project.org";
-
-(: Provide a mapping between XMI primity types and Qt types :)
-declare function qtxmi:mappedPrimitiveType($primitiveType as xs:string+) as xs:string+
-{
- if ($primitiveType = "Boolean") then "bool"
- else if ($primitiveType = "Integer" or
- $primitiveType = "UnlimitedNatural") then "qint32"
- else if ($primitiveType = "Real") then "qreal"
- else if ($primitiveType = "String") then "QString"
- else "qtxmi:unknownPrimitiveType"
-};
-
-(: Handle XMI attributes with C++ prohibitive names :)
-declare function qtxmi:mappedFunctionName($name as xs:string) as xs:string
-{
- if ($name = "namespace") then "namespace_"
- else if ($name = "interface") then "interface_"
- else if ($name = "class") then "class_"
- else if ($name = "default") then "default_"
- else if ($name = "template") then "template_"
- else if ($name = "slots") then "slots_"
- else if ($name = "delete") then "delete_"
- else $name
-};
-
-(: Return a new attribute names regarding its multiplicity :)
-declare function qtxmi:modifiedFunctionName($attribute as node()) as xs:string
-{
- let $functionName := qtxmi:mappedFunctionName(
- if ($attribute/upperValue/@value != "1"
- and not((starts-with($attribute/@name, "in") or
- starts-with($attribute/@name, "to")) and
- substring($attribute/@name, 3, 1) =
- upper-case(substring($attribute/@name, 3, 1)))
- and $attribute/@name != "provided"
- and $attribute/@name != "required"
- and $attribute/@name != "endData"
- and $attribute/@name != "conveyed"
- and $attribute/@name != "covered"
- and $attribute/@name != "coveredBy"
- and $attribute/@name != "conformance"
- and $attribute/@name != "referred"
- and $attribute/@name != "represented"
- ) then
- concat(replace(replace(replace(replace(
- $attribute/@name,
- "y$", "ie"),
- "ss$", "sse"),
- "ex$", "ice"),
- "x$", "ce"),
- "s")
- else qtxmi:mappedFunctionName($attribute/@name)
- )
- return $functionName
-};
-
-(: Receives a Qt-mapped basic type and returns a new type regarding type multiplicity :)
-declare function qtxmi:handleType($attribute as node()+, $basicType as xs:string+) as xs:string+
-{
- let $type := doc($xmiFile)//packagedElement[@xmi:id=$attribute/@type]/@xmi:type
- let $isUnique := if (not($attribute/@isUnique) or $attribute/@isUnique = "true") then "true"
- else "false"
- let $isOrdered := if (not($attribute/@isOrdered) or $attribute/@isOrdered = "false") then "false"
- else "true"
- let $collectionBegin := if ($attribute/upperValue/@value != "1") then
- if ($isUnique = "true" and $isOrdered = "false") then "QSet<"
- else "QList<"
- else ""
- let $collectionEnd := if ($attribute/upperValue/@value != "1") then
- ">"
- else ""
- let $pointer := if ($type = "uml:Class") then " *" else ""
- return concat(concat(concat($collectionBegin, $basicType), $pointer), $collectionEnd)
-};
-
-declare function qtxmi:defaultValue($attribute as node()+, $moduleName as xs:string+) as xs:string+
-{
- if ($attribute/defaultValue) then
- if ($attribute/defaultValue/@xmi:type = "uml:LiteralBoolean") then
- if ($attribute/defaultValue/@value) then
- xs:string($attribute/defaultValue/@value)
- else "false"
- else
- if ($attribute/defaultValue/@xmi:type = "uml:LiteralUnlimitedNatural") then
- if ($attribute/defaultValue/@value) then
- replace($attribute/defaultValue/@value, "\*", "-1")
- else "0"
- else
- if ($attribute/defaultValue/@xmi:type = "uml:InstanceValue" and
- doc($xmiFile)//packagedElement[@xmi:id=$attribute/defaultValue/@type]/@xmi:type
- = "uml:Enumeration") then
- if ($attribute/defaultValue/@instance) then
- concat(concat($moduleName, "::"),
- concat(replace(replace(tokenize(
- $attribute/defaultValue/@instance, "-")[1], "Kind", ""), "Sort", ""),
- concat(upper-case(substring(tokenize($attribute/defaultValue/@instance, "-")[2], 1, 1)),
- substring(tokenize($attribute/defaultValue/@instance, "-")[2], 2))))
- else ""
- else ""
- else ""
-};
-
-<qtxmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701"
- xmlns:uml="http://www.omg.org/spec/UML/20110701"
- xmlns:qtxmi="http://www.qt-project.org">
-{
-for $namespace in doc($xmiFile)//(packagedElement[@xmi:type="uml:Package"] | uml:Package)
-let $modulePrefix := concat("Q", $namespace/@name)
-let $moduleName := replace($modulePrefix, "^Q", "Qt")
-return
-for $class in doc($xmiFile)//*[@xmi:id=$namespace/@xmi:id]/packagedElement[@xmi:type="uml:Class"]
-let $isAbstract := if ($class/@isAbstract) then $class/@isAbstract else "false"
-return
-<class name="{$modulePrefix}{$class/@name}" module="{$moduleName}" isAbstract="{$isAbstract}">
- <documentation>{$class/ownedComment/body/text()}</documentation>
- {
- for $superclass in $class/generalization/@general |
- $class/generalization/general/@xmi:idref |
- $class/generalization/general/@href
- let $superclassName := concat($modulePrefix, $superclass)
- return
- <superclass include="{$moduleName}/{$superclassName}" name="{$superclassName}"/>
- }
- {
- for $attribute in $class/ownedAttribute
- let $isDerived := if (not($attribute/@isDerived) or $attribute/@isDerived = "false") then "false"
- else "true"
- let $isDerivedUnion := if (not($attribute/@isDerivedUnion) or $attribute/@isDerivedUnion = "false") then "false"
- else "true"
- let $isReadOnly := if (not($attribute/@isReadOnly) or $attribute/@isReadOnly = "false") then "false"
- else "true"
- let $isAssociationEnd := if ($attribute[@association]) then "true"
- else "false"
- let $isMultivalued := if ($attribute/upperValue/@value != "1") then "true"
- else "false"
- let $basicType := if ($attribute/@type) then concat($modulePrefix, xs:string($attribute/@type))
- else qtxmi:mappedPrimitiveType(tokenize($attribute/type/@href, "#")[last()])
- return
- <attribute name="{qtxmi:modifiedFunctionName($attribute)}" type="{qtxmi:handleType($attribute, $basicType)}"
- isMultivalued="{$isMultivalued}" isDerived="{$isDerived}" isDerivedUnion="{$isDerivedUnion}"
- isReadOnly="{$isReadOnly}" isAssociationEnd="{$isAssociationEnd}" defaultValue="{qtxmi:defaultValue($attribute, $moduleName)}">
- {
- for $subsettedPropertyName in tokenize($attribute/@subsettedProperty, " ")
- let $subsettedProperty := doc($xmiFile)//ownedAttribute[@xmi:id=$subsettedPropertyName]
- return
- <subsettedProperty name="{$modulePrefix}{tokenize($subsettedPropertyName, '-')[1]}::{qtxmi:modifiedFunctionName($subsettedProperty)}"/>
- }
- {
- for $redefinedPropertyName in tokenize($attribute/@redefinedProperty, " ")
- let $redefinedProperty := doc($xmiFile)//ownedAttribute[@xmi:id=$redefinedPropertyName]
- return
- <redefinedProperty name="{$modulePrefix}{tokenize($redefinedPropertyName, '-')[1]}::{qtxmi:modifiedFunctionName($redefinedProperty)}"/>
- }
- </attribute>
- }
-</class>
-}
-</qtxmi:XMI>
diff --git a/scripts/templates/class.cpp b/scripts/templates/class.cpp
index 4099137f..001f9bf1 100644
--- a/scripts/templates/class.cpp
+++ b/scripts/templates/class.cpp
@@ -42,7 +42,8 @@
#include "q${namespace.lower}${className.lower}.h"
#include "q${namespace.lower}${className.lower}_p.h"
[%- superclasses = [] -%]
-[%- FOREACH superclass = class.findnodes("generalization") -%]
+[%- SET generalization = class.findnodes("generalization") -%]
+[%- FOREACH superclass IN generalization -%]
[%- superclasses.push("Q${namespace}${superclass.findvalue('@general')}") -%]
[%- END -%]
[%- forwards = [] -%]
@@ -110,8 +111,18 @@ Q${namespace}${className}Private::Q${namespace}${className}Private()
\brief ${class.findvalue("ownedComment/body/text()")}
*/
-Q${namespace}${className}::Q${namespace}${className}()
+Q${namespace}${className}::Q${namespace}${className}(bool create_d_ptr) :
+[%- FOREACH superclass IN generalization %]
+ Q${namespace}${superclass.findvalue("@general")}(false)
+[%- IF !loop.last %],
+[%- END -%]
+[%- END -%]
+[%- IF superclasses.size == 0 %]
+ QModelingObject(false)
+[%- END %]
{
+ if (create_d_ptr)
+ set_d_ptr(new Q${namespace}${className}Private);
}
[%- FOREACH attribute = class.findnodes("ownedAttribute") %]
[%- IF loop.first %]
@@ -162,6 +173,7 @@ void Q${namespace}${className}::set${attributeName.remove("^Is")}([% QT_TYPE(nam
[%- SET operationName = operation.findvalue("@name") -%]
[%- SET returnType = QT_TYPE(namespace, operation.findnodes("ownedParameter[@direction='return']")) %]
+
/*!
${operation.findvalue("ownedComment/body/text()")}
*/
diff --git a/scripts/templates/class.h b/scripts/templates/class.h
index 02becbaa..4315ad97 100644
--- a/scripts/templates/class.h
+++ b/scripts/templates/class.h
@@ -43,17 +43,18 @@
#define Q${namespace.upper}${className.upper}_H
#include <Qt${namespace}/Qt${namespace}Global>
-[%- superclasses = [] -%]
+[% superclasses = [] -%]
[%- SET generalization = class.findnodes("generalization") -%]
[% FOREACH superclass IN generalization -%]
-[%- IF loop.first %]
-[% END -%]
[% SET superclassName = superclass.findvalue("@general") %]
#include <Qt${namespace}/Q${namespace}${superclassName}>
[%- superclasses.push("Q${namespace}${superclassName}") -%]
[%- IF loop.last %]
[% END -%]
[%- END -%]
+[%- IF superclasses.size == 0 -%]
+#include <QtModeling/QModelingObject>
+[% END -%]
[%- SET useNamespace = 'false' -%]
[%- forwards = [] -%]
@@ -81,15 +82,18 @@ class ${forward};
[% END %]
[%- END -%]
-class Q_${namespace.upper}_EXPORT Q${namespace}${className}
+class Q${namespace}${className}Private;
+class Q_${namespace.upper}_EXPORT Q${namespace}${className} :
[%- FOREACH superclass IN generalization -%]
-[%- IF loop.first %] :[% END -%]
- public Q${namespace}${superclass.findvalue("@general")}
-[%- IF !loop.last %],[% END -%]
+public Q${namespace}${superclass.findvalue("@general")}
+[%- IF !loop.last %], [% END -%]
+[%- END %]
+[%- IF superclasses.size == 0 -%]
+public QModelingObject
[%- END %]
{
public:
- [% IF class.findvalue("@isAbstract") == "true" %]Q_DECL_HIDDEN [% END %]Q${namespace}${className}();
+ [% IF class.findvalue("@isAbstract") == "true" %]Q_DECL_HIDDEN [% END %]Q${namespace}${className}(bool create_d_ptr = true);
[%- FOREACH attribute = class.findnodes("ownedAttribute") -%]
[%- IF loop.first %]
diff --git a/scripts/templates/class_p.h b/scripts/templates/class_p.h
index d68c8930..ec2a5015 100644
--- a/scripts/templates/class_p.h
+++ b/scripts/templates/class_p.h
@@ -44,22 +44,30 @@
#include "Qt${namespace}/Q${namespace}${className}"
-[%- SET superclasses = class.findnodes('generalization') -%]
-[%- FOREACH superclass IN superclasses %]
+[%- SET generalization = class.findnodes('generalization') -%]
+[% superclasses = [] -%]
+[%- FOREACH superclass IN generalization %]
#include "private/q${namespace.lower}${superclass.findvalue('@general').lower}_p.h"
+[%- superclasses.push("Q${namespace}${superclassName}") -%]
+[%- IF loop.last %]
+[% END -%]
[%- END %]
-
+[%- IF superclasses.size == 0 %]
+#include "private/qmodelingobject_p.h"
+[% END %]
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Qt${namespace})
-class Q_${namespace.upper}_EXPORT Q${namespace}${className}Private
-[%- FOREACH superclass IN superclasses -%]
-[%- IF loop.first %] :[% END -%]
- public Q${namespace}${superclass.findvalue('@general')}Private
-[%- IF !loop.last %],[% END -%]
+class Q_${namespace.upper}_EXPORT Q${namespace}${className}Private :
+[%- FOREACH superclass IN generalization -%]
+public Q${namespace}${superclass.findvalue('@general')}Private
+[%- IF !loop.last %], [% END -%]
+[%- END %]
+[%- IF superclasses.size == 0 -%]
+public QModelingObjectPrivate
[%- END %]
{
public:
diff --git a/scripts/templates/module.pro b/scripts/templates/module.pro
index 4b39de97..b2f2eea0 100644
--- a/scripts/templates/module.pro
+++ b/scripts/templates/module.pro
@@ -1,7 +1,7 @@
load(qt_build_config)
TARGET = Qt${namespace}
-QT = core
+QT = core modeling-private
QMAKE_DOCS = [%- GET '$$PWD' -%]/doc/qt${namespace.lower}.qdocconf
diff --git a/scripts/xmiclassinheritance2png.sh b/scripts/xmiclassinheritance2png.sh
new file mode 100755
index 00000000..33c8c5ab
--- /dev/null
+++ b/scripts/xmiclassinheritance2png.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if [ "$#" -ne 3 ] || ! [ -f "$2" ]; then
+ echo "Usage: $0 <uml-class> <xmi-file> <output.png>" >&2
+ exit 1
+fi
+
+printf "Analyzing xmi file: "
+exec 1> $3.g
+
+parentsof() {
+printf "." > /dev/stderr
+/usr/bin/vendor_perl/xpath $2 "//packagedElement[@name=\"$1\"]/generalization/@general" 2> /dev/null | tr ' ' '\n' | cut -d"\"" -f2 | while read PARENT; do if [ $PARENT ]; then echo "$1 -> $PARENT;"; parentsof $PARENT $2; fi; done;
+/usr/bin/vendor_perl/xpath $2 "//packagedElement[@name=\"$1\"]/generalization/general/@xmi:idref" 2> /dev/null | tr ' ' '\n' | cut -d"\"" -f2 | while read PARENT; do if [ $PARENT ]; then echo "$1 -> $PARENT;"; parentsof $PARENT $2; fi; done;
+}
+
+echo "strict digraph G {";
+echo "graph[ranksep=1.5, rankdir=BT];";
+echo "$1;"
+parentsof $1 $2
+echo "}"
+
+dot -Tpng -o $3 $3.g
+rm -rf $3.g
+printf "\n" > /dev/stderr
diff --git a/scripts/xmiinheritance2png.sh b/scripts/xmiinheritance2png.sh
new file mode 100755
index 00000000..62f6cf2e
--- /dev/null
+++ b/scripts/xmiinheritance2png.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ "$#" -ne 2 ] || ! [ -f "$1" ]; then
+ echo "Usage: $0 <xmi-file> <output-directory>" >&2
+ exit 1
+fi
+
+mkdir -p $2
+
+/usr/bin/vendor_perl/xpath $1 "//packagedElement[@xmi:type=\"uml:Class\"]/@name" 2> /dev/null | tr ' ' '\n' | cut -d"\"" -f2 | while read CLASS; do if [ $CLASS ]; then echo "Generating inheritance diagram for $CLASS"; ./xmiclassinheritance2png.sh $CLASS $1 "$2/${CLASS}Inheritance.png"; fi; done