summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-11-26 05:52:45 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-11-26 09:48:20 +0100
commit0f13b4f396ac21dee5ba1df2cc4cd482b3b41f88 (patch)
treece6707d69337130a755f17449761f88ac7376ac2
parentcb4567f68fde059f014546eff434fa40d164a4e0 (diff)
Update metamodel implementation. UML update coming soon ...
Change-Id: Ie5c42361c8fdae602134c9bdd8ce19416b2c7f40 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp6
-rw-r--r--scripts/templates/common.tmpl2
-rw-r--r--scripts/templates/qclass.cpp2
-rw-r--r--src/duse/qdusedesigndimension.cpp10
-rw-r--r--src/duse/qdusedesigndimension.h1
-rw-r--r--src/duse/qdusedesigndimensioninstance.cpp10
-rw-r--r--src/duse/qdusedesigndimensioninstance.h1
-rw-r--r--src/duse/qdusedesignspace.cpp8
-rw-r--r--src/duse/qdusedesignspace.h1
-rw-r--r--src/duse/qdusemodelchange.cpp10
-rw-r--r--src/duse/qdusemodelchange.h1
-rw-r--r--src/duse/qdusequalitymetric.cpp8
-rw-r--r--src/duse/qdusequalitymetric.h1
-rw-r--r--src/duse/qdusevariationpoint.cpp10
-rw-r--r--src/duse/qdusevariationpoint.h1
-rw-r--r--src/mof/qmofargument.cpp10
-rw-r--r--src/mof/qmofargument.h1
-rw-r--r--src/mof/qmofassociation.cpp16
-rw-r--r--src/mof/qmofassociation.h1
-rw-r--r--src/mof/qmofbehavioralfeature.cpp10
-rw-r--r--src/mof/qmofbehavioralfeature.h2
-rw-r--r--src/mof/qmofclass.cpp12
-rw-r--r--src/mof/qmofclass.h1
-rw-r--r--src/mof/qmofclassifier.cpp12
-rw-r--r--src/mof/qmofclassifier.h2
-rw-r--r--src/mof/qmofcomment.cpp10
-rw-r--r--src/mof/qmofcomment.h1
-rw-r--r--src/mof/qmofconstraint.cpp12
-rw-r--r--src/mof/qmofconstraint.h1
-rw-r--r--src/mof/qmofdatatype.cpp12
-rw-r--r--src/mof/qmofdatatype.h1
-rw-r--r--src/mof/qmofdirectedrelationship.cpp8
-rw-r--r--src/mof/qmofdirectedrelationship.h2
-rw-r--r--src/mof/qmofelement.cpp8
-rw-r--r--src/mof/qmofelement.h2
-rw-r--r--src/mof/qmofelementimport.cpp12
-rw-r--r--src/mof/qmofelementimport.h1
-rw-r--r--src/mof/qmofenumeration.cpp12
-rw-r--r--src/mof/qmofenumeration.h1
-rw-r--r--src/mof/qmofenumerationliteral.cpp10
-rw-r--r--src/mof/qmofenumerationliteral.h1
-rw-r--r--src/mof/qmofexception.cpp12
-rw-r--r--src/mof/qmofexception.h1
-rw-r--r--src/mof/qmofexpression.cpp10
-rw-r--r--src/mof/qmofexpression.h1
-rw-r--r--src/mof/qmofextent.cpp8
-rw-r--r--src/mof/qmofextent.h1
-rw-r--r--src/mof/qmoffactory.cpp10
-rw-r--r--src/mof/qmoffactory.h1
-rw-r--r--src/mof/qmoffeature.cpp8
-rw-r--r--src/mof/qmoffeature.h2
-rw-r--r--src/mof/qmofgeneralization.cpp12
-rw-r--r--src/mof/qmofgeneralization.h1
-rw-r--r--src/mof/qmofinstancespecification.cpp10
-rw-r--r--src/mof/qmofinstancespecification.h1
-rw-r--r--src/mof/qmofinstancevalue.cpp12
-rw-r--r--src/mof/qmofinstancevalue.h1
-rw-r--r--src/mof/qmoflink.cpp14
-rw-r--r--src/mof/qmoflink.h1
-rw-r--r--src/mof/qmofliteralboolean.cpp10
-rw-r--r--src/mof/qmofliteralboolean.h1
-rw-r--r--src/mof/qmofliteralinteger.cpp10
-rw-r--r--src/mof/qmofliteralinteger.h1
-rw-r--r--src/mof/qmofliteralnull.cpp10
-rw-r--r--src/mof/qmofliteralnull.h1
-rw-r--r--src/mof/qmofliteralreal.cpp10
-rw-r--r--src/mof/qmofliteralreal.h1
-rw-r--r--src/mof/qmofliteralspecification.cpp10
-rw-r--r--src/mof/qmofliteralspecification.h2
-rw-r--r--src/mof/qmofliteralstring.cpp10
-rw-r--r--src/mof/qmofliteralstring.h1
-rw-r--r--src/mof/qmofliteralunlimitednatural.cpp10
-rw-r--r--src/mof/qmofliteralunlimitednatural.h1
-rw-r--r--src/mof/qmofmultiplicityelement.cpp8
-rw-r--r--src/mof/qmofmultiplicityelement.h2
-rw-r--r--src/mof/qmofnamedelement.cpp8
-rw-r--r--src/mof/qmofnamedelement.h2
-rw-r--r--src/mof/qmofnamespace.cpp8
-rw-r--r--src/mof/qmofnamespace.h2
-rw-r--r--src/mof/qmofobject.cpp8
-rw-r--r--src/mof/qmofobject.h1
-rw-r--r--src/mof/qmofopaqueexpression.cpp10
-rw-r--r--src/mof/qmofopaqueexpression.h1
-rw-r--r--src/mof/qmofoperation.cpp16
-rw-r--r--src/mof/qmofoperation.h1
-rw-r--r--src/mof/qmofpackage.cpp10
-rw-r--r--src/mof/qmofpackage.h1
-rw-r--r--src/mof/qmofpackageableelement.cpp8
-rw-r--r--src/mof/qmofpackageableelement.h2
-rw-r--r--src/mof/qmofpackageimport.cpp12
-rw-r--r--src/mof/qmofpackageimport.h1
-rw-r--r--src/mof/qmofpackagemerge.cpp12
-rw-r--r--src/mof/qmofpackagemerge.h1
-rw-r--r--src/mof/qmofparameter.cpp12
-rw-r--r--src/mof/qmofparameter.h1
-rw-r--r--src/mof/qmofprimitivetype.cpp12
-rw-r--r--src/mof/qmofprimitivetype.h1
-rw-r--r--src/mof/qmofproperty.cpp22
-rw-r--r--src/mof/qmofproperty.h1
-rw-r--r--src/mof/qmofredefinableelement.cpp8
-rw-r--r--src/mof/qmofredefinableelement.h2
-rw-r--r--src/mof/qmofreflectivecollection.cpp8
-rw-r--r--src/mof/qmofreflectivecollection.h1
-rw-r--r--src/mof/qmofreflectivesequence.cpp8
-rw-r--r--src/mof/qmofreflectivesequence.h1
-rw-r--r--src/mof/qmofrelationship.cpp8
-rw-r--r--src/mof/qmofrelationship.h2
-rw-r--r--src/mof/qmofslot.cpp12
-rw-r--r--src/mof/qmofslot.h1
-rw-r--r--src/mof/qmofstructuralfeature.cpp10
-rw-r--r--src/mof/qmofstructuralfeature.h2
-rw-r--r--src/mof/qmoftag.cpp12
-rw-r--r--src/mof/qmoftag.h1
-rw-r--r--src/mof/qmoftype.cpp10
-rw-r--r--src/mof/qmoftype.h2
-rw-r--r--src/mof/qmoftypedelement.cpp10
-rw-r--r--src/mof/qmoftypedelement.h2
-rw-r--r--src/mof/qmofuriextent.cpp8
-rw-r--r--src/mof/qmofuriextent.h1
-rw-r--r--src/mof/qmofvaluespecification.cpp10
-rw-r--r--src/mof/qmofvaluespecification.h2
-rw-r--r--src/saduseprofile/qsaduseprofileprocesscomponent.cpp10
-rw-r--r--src/saduseprofile/qsaduseprofileprocesscomponent.h1
-rw-r--r--tests/auto/auto.pro3
-rw-r--r--tests/auto/qtmofguardedcollection/qtmofguardedcollection.pro7
-rw-r--r--tests/auto/qtmofguardedcollection/tst_qtmofguardedcollection.cpp73
126 files changed, 644 insertions, 151 deletions
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
index 3a700b87..e70d218b 100644
--- a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
@@ -42,7 +42,9 @@
#include <QtWidgets/QAction>
#include <QtWidgets/QFileDialog>
+
#include <QtCore/QProcess>
+#include <QtCore/QXmlStreamReader>
#include <duseinterfaces/iuicontroller.h>
@@ -66,8 +68,8 @@ void GccXmlArchitectureRecoveryBackendPlugin::setRootProjectDir(const QDir &root
void GccXmlArchitectureRecoveryBackendPlugin::newArchitectureRecoveryProcess()
{
- QString fileName = QFileDialog::getOpenFileName(this, tr("Open xml file"), "/home", tr("Xml files (*.xml)"));
- _rootProjectDir = new QDir(fileName);
+ QString fileName = QFileDialog::getOpenFileName(0, tr("Open xml file"), "/home", tr("Xml files (*.xml)"));
+ _rootProjectDir = QDir(fileName);
components();
}
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl
index 82e8deb4..86f8bf73 100644
--- a/scripts/templates/common.tmpl
+++ b/scripts/templates/common.tmpl
@@ -535,7 +535,7 @@ void Q${namespace}${originalClassName}Object::unset${qtAttribute.remove("^is").u
[%- SET attributeName = attribute.findvalue("@name") -%]
[%- SET qtAttribute = QT_ATTRIBUTE(attribute) -%]
[%- NEXT IF redefinedProperties.grep("^${className}-${qtAttribute}$").size > 0 -%]
- [%- NEXT IF attribute.findvalue("@aggregation") != "composite" -%]
+ [%- NEXT IF attribute.findvalue("@aggregation") != "composite" && qtType.match('\*') -%]
[%- IF qtType.match("QList|QSet") %]
foreach (${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}element, ${PLURALFORM(qtAttribute, attribute)}())
[%- IF qtType.match('\*') %]
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp
index 687d1805..bc499653 100644
--- a/scripts/templates/qclass.cpp
+++ b/scripts/templates/qclass.cpp
@@ -144,7 +144,7 @@ Q${namespace}${className}::Q${namespace}${className}([%- IF class.findvalue("@is
*/
Q${namespace}${className}::~Q${namespace}${className}()
{
- QUmlElement::deleteQModelingObject();
+ QModelingElement::deleteQModelingObject();
}
[%- IF documentation != "" %]
diff --git a/src/duse/qdusedesigndimension.cpp b/src/duse/qdusedesigndimension.cpp
index 7519ec9e..078775e9 100644
--- a/src/duse/qdusedesigndimension.cpp
+++ b/src/duse/qdusedesigndimension.cpp
@@ -67,6 +67,14 @@ QDuseDesignDimension::QDuseDesignDimension(bool createQModelingObject) :
}
/*!
+ Destroys the QDuseDesignDimension.
+ */
+QDuseDesignDimension::~QDuseDesignDimension()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseDesignDimension.
*/
QModelingElement *QDuseDesignDimension::clone() const
@@ -75,8 +83,6 @@ QModelingElement *QDuseDesignDimension::clone() const
c->setName(name());
if (instanceSelectionRule())
c->setInstanceSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(instanceSelectionRule()->clone()));
- foreach (QDuseDesignDimension *element, requiredPreviousEvaluations())
- c->addRequiredPreviousEvaluation(dynamic_cast<QDuseDesignDimension *>(element->clone()));
foreach (QDuseVariationPoint *element, variationPoints())
c->addVariationPoint(dynamic_cast<QDuseVariationPoint *>(element->clone()));
foreach (QDuseDesignDimensionInstance *element, designDimensionInstances())
diff --git a/src/duse/qdusedesigndimension.h b/src/duse/qdusedesigndimension.h
index 63144779..71cb3d73 100644
--- a/src/duse/qdusedesigndimension.h
+++ b/src/duse/qdusedesigndimension.h
@@ -57,6 +57,7 @@ class Q_DUSE_EXPORT QDuseDesignDimension : public QModelingElement
{
public:
explicit QDuseDesignDimension(bool createQModelingObject = true);
+ virtual ~QDuseDesignDimension();
virtual QModelingElement *clone() const;
diff --git a/src/duse/qdusedesigndimensioninstance.cpp b/src/duse/qdusedesigndimensioninstance.cpp
index 53a12889..e9b4ee55 100644
--- a/src/duse/qdusedesigndimensioninstance.cpp
+++ b/src/duse/qdusedesigndimensioninstance.cpp
@@ -65,13 +65,19 @@ QDuseDesignDimensionInstance::QDuseDesignDimensionInstance(bool createQModelingO
}
/*!
+ Destroys the QDuseDesignDimensionInstance.
+ */
+QDuseDesignDimensionInstance::~QDuseDesignDimensionInstance()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseDesignDimensionInstance.
*/
QModelingElement *QDuseDesignDimensionInstance::clone() const
{
QDuseDesignDimensionInstance *c = new QDuseDesignDimensionInstance;
- if (targetInstance())
- c->setTargetInstance(dynamic_cast<QUmlElement *>(targetInstance()->clone()));
return c;
}
diff --git a/src/duse/qdusedesigndimensioninstance.h b/src/duse/qdusedesigndimensioninstance.h
index 0e9e919d..60a49c13 100644
--- a/src/duse/qdusedesigndimensioninstance.h
+++ b/src/duse/qdusedesigndimensioninstance.h
@@ -55,6 +55,7 @@ class Q_DUSE_EXPORT QDuseDesignDimensionInstance : public QModelingElement
{
public:
explicit QDuseDesignDimensionInstance(bool createQModelingObject = true);
+ virtual ~QDuseDesignDimensionInstance();
virtual QModelingElement *clone() const;
diff --git a/src/duse/qdusedesignspace.cpp b/src/duse/qdusedesignspace.cpp
index 229d4962..80ebaab7 100644
--- a/src/duse/qdusedesignspace.cpp
+++ b/src/duse/qdusedesignspace.cpp
@@ -65,6 +65,14 @@ QDuseDesignSpace::QDuseDesignSpace(bool createQModelingObject)
}
/*!
+ Destroys the QDuseDesignSpace.
+ */
+QDuseDesignSpace::~QDuseDesignSpace()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseDesignSpace.
*/
QModelingElement *QDuseDesignSpace::clone() const
diff --git a/src/duse/qdusedesignspace.h b/src/duse/qdusedesignspace.h
index 87b76b66..b87f8ffe 100644
--- a/src/duse/qdusedesignspace.h
+++ b/src/duse/qdusedesignspace.h
@@ -56,6 +56,7 @@ class Q_DUSE_EXPORT QDuseDesignSpace : public QModelingElement
{
public:
explicit QDuseDesignSpace(bool createQModelingObject = true);
+ virtual ~QDuseDesignSpace();
virtual QModelingElement *clone() const;
diff --git a/src/duse/qdusemodelchange.cpp b/src/duse/qdusemodelchange.cpp
index 91333624..ce859335 100644
--- a/src/duse/qdusemodelchange.cpp
+++ b/src/duse/qdusemodelchange.cpp
@@ -68,6 +68,14 @@ QDuseModelChange::QDuseModelChange(bool createQModelingObject) :
}
/*!
+ Destroys the QDuseModelChange.
+ */
+QDuseModelChange::~QDuseModelChange()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseModelChange.
*/
QModelingElement *QDuseModelChange::clone() const
@@ -77,8 +85,6 @@ QModelingElement *QDuseModelChange::clone() const
c->setTargetSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(targetSelectionRule()->clone()));
if (valueSelectionRule())
c->setValueSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(valueSelectionRule()->clone()));
- if (targetProperty())
- c->setTargetProperty(dynamic_cast<QUmlProperty *>(targetProperty()->clone()));
return c;
}
diff --git a/src/duse/qdusemodelchange.h b/src/duse/qdusemodelchange.h
index 3cd7bf66..1352aaa5 100644
--- a/src/duse/qdusemodelchange.h
+++ b/src/duse/qdusemodelchange.h
@@ -56,6 +56,7 @@ class Q_DUSE_EXPORT QDuseModelChange : public QModelingElement
{
public:
explicit QDuseModelChange(bool createQModelingObject = true);
+ virtual ~QDuseModelChange();
virtual QModelingElement *clone() const;
diff --git a/src/duse/qdusequalitymetric.cpp b/src/duse/qdusequalitymetric.cpp
index e3189a70..180d5812 100644
--- a/src/duse/qdusequalitymetric.cpp
+++ b/src/duse/qdusequalitymetric.cpp
@@ -65,6 +65,14 @@ QDuseQualityMetric::QDuseQualityMetric(bool createQModelingObject) :
}
/*!
+ Destroys the QDuseQualityMetric.
+ */
+QDuseQualityMetric::~QDuseQualityMetric()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseQualityMetric.
*/
QModelingElement *QDuseQualityMetric::clone() const
diff --git a/src/duse/qdusequalitymetric.h b/src/duse/qdusequalitymetric.h
index 21e6dab0..e07fcdf1 100644
--- a/src/duse/qdusequalitymetric.h
+++ b/src/duse/qdusequalitymetric.h
@@ -55,6 +55,7 @@ class Q_DUSE_EXPORT QDuseQualityMetric : public QModelingElement
{
public:
explicit QDuseQualityMetric(bool createQModelingObject = true);
+ virtual ~QDuseQualityMetric();
virtual QModelingElement *clone() const;
diff --git a/src/duse/qdusevariationpoint.cpp b/src/duse/qdusevariationpoint.cpp
index 6335e600..278af18f 100644
--- a/src/duse/qdusevariationpoint.cpp
+++ b/src/duse/qdusevariationpoint.cpp
@@ -67,6 +67,14 @@ QDuseVariationPoint::QDuseVariationPoint(bool createQModelingObject) :
}
/*!
+ Destroys the QDuseVariationPoint.
+ */
+QDuseVariationPoint::~QDuseVariationPoint()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QDuseVariationPoint.
*/
QModelingElement *QDuseVariationPoint::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QDuseVariationPoint::clone() const
c->setPreChangeValidationRule(dynamic_cast<QUmlOpaqueExpression *>(preChangeValidationRule()->clone()));
foreach (QDuseModelChange *element, modelChanges())
c->addModelChange(dynamic_cast<QDuseModelChange *>(element->clone()));
- foreach (QUmlElement *element, addedElements())
- c->addAddedElement(dynamic_cast<QUmlElement *>(element->clone()));
return c;
}
diff --git a/src/duse/qdusevariationpoint.h b/src/duse/qdusevariationpoint.h
index 33536181..a6682416 100644
--- a/src/duse/qdusevariationpoint.h
+++ b/src/duse/qdusevariationpoint.h
@@ -57,6 +57,7 @@ class Q_DUSE_EXPORT QDuseVariationPoint : public QModelingElement
{
public:
explicit QDuseVariationPoint(bool createQModelingObject = true);
+ virtual ~QDuseVariationPoint();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofargument.cpp b/src/mof/qmofargument.cpp
index 75a1ad29..2d3a2702 100644
--- a/src/mof/qmofargument.cpp
+++ b/src/mof/qmofargument.cpp
@@ -53,12 +53,18 @@ QMofArgument::QMofArgument(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofArgumentObject(this));
}
+/*!
+ Destroys the QMofArgument.
+ */
+QMofArgument::~QMofArgument()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofArgument::clone() const
{
QMofArgument *c = new QMofArgument;
c->setName(name());
- if (value())
- c->setValue(dynamic_cast<QMofObject *>(value()->clone()));
return c;
}
diff --git a/src/mof/qmofargument.h b/src/mof/qmofargument.h
index 58dbd727..c909540f 100644
--- a/src/mof/qmofargument.h
+++ b/src/mof/qmofargument.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofArgument : public QModelingElement
{
public:
explicit QMofArgument(bool createQModelingObject = true);
+ virtual ~QMofArgument();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofassociation.cpp b/src/mof/qmofassociation.cpp
index 0312fe0d..3c014f01 100644
--- a/src/mof/qmofassociation.cpp
+++ b/src/mof/qmofassociation.cpp
@@ -80,6 +80,14 @@ QMofAssociation::QMofAssociation(bool createQModelingObject) :
}
/*!
+ Destroys the QMofAssociation.
+ */
+QMofAssociation::~QMofAssociation()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofAssociation.
*/
QModelingElement *QMofAssociation::clone() const
@@ -89,8 +97,6 @@ QModelingElement *QMofAssociation::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -102,13 +108,7 @@ QModelingElement *QMofAssociation::clone() const
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setAbstract(isAbstract());
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
c->setDerived(isDerived());
- foreach (QMofProperty *element, memberEnds())
- c->addMemberEnd(dynamic_cast<QMofProperty *>(element->clone()));
- foreach (QMofProperty *element, navigableOwnedEnds())
- c->addNavigableOwnedEnd(dynamic_cast<QMofProperty *>(element->clone()));
foreach (QMofProperty *element, ownedEnds())
c->addOwnedEnd(dynamic_cast<QMofProperty *>(element->clone()));
return c;
diff --git a/src/mof/qmofassociation.h b/src/mof/qmofassociation.h
index e7214399..299c98e0 100644
--- a/src/mof/qmofassociation.h
+++ b/src/mof/qmofassociation.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofAssociation : public QMofRelationship, public virtual QMo
{
public:
explicit QMofAssociation(bool createQModelingObject = true);
+ virtual ~QMofAssociation();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofbehavioralfeature.cpp b/src/mof/qmofbehavioralfeature.cpp
index 65008d09..5fa53bc7 100644
--- a/src/mof/qmofbehavioralfeature.cpp
+++ b/src/mof/qmofbehavioralfeature.cpp
@@ -73,6 +73,14 @@ QMofBehavioralFeature::QMofBehavioralFeature()
}
/*!
+ Destroys the QMofBehavioralFeature.
+ */
+QMofBehavioralFeature::~QMofBehavioralFeature()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofBehavioralFeature.
*/
QModelingElement *QMofBehavioralFeature::clone() const
@@ -92,8 +100,6 @@ QModelingElement *QMofBehavioralFeature::clone() const
c->addPackageImport(dynamic_cast<QMofPackageImport *>(element->clone()));
foreach (QMofParameter *element, ownedParameters())
c->addOwnedParameter(dynamic_cast<QMofParameter *>(element->clone()));
- foreach (QMofType *element, raisedExceptions())
- c->addRaisedException(dynamic_cast<QMofType *>(element->clone()));
return c;
}
diff --git a/src/mof/qmofbehavioralfeature.h b/src/mof/qmofbehavioralfeature.h
index 76942191..597d2855 100644
--- a/src/mof/qmofbehavioralfeature.h
+++ b/src/mof/qmofbehavioralfeature.h
@@ -57,6 +57,8 @@ class QMofType;
class Q_MOF_EXPORT QMofBehavioralFeature : public QMofFeature, public QMofNamespace
{
public:
+ virtual ~QMofBehavioralFeature();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofclass.cpp b/src/mof/qmofclass.cpp
index 84b16cab..2e806ebd 100644
--- a/src/mof/qmofclass.cpp
+++ b/src/mof/qmofclass.cpp
@@ -80,6 +80,14 @@ QMofClass::QMofClass(bool createQModelingObject) :
}
/*!
+ Destroys the QMofClass.
+ */
+QMofClass::~QMofClass()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofClass.
*/
QModelingElement *QMofClass::clone() const
@@ -89,8 +97,6 @@ QModelingElement *QMofClass::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -101,8 +107,6 @@ QModelingElement *QMofClass::clone() const
foreach (QMofGeneralization *element, generalizations())
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
c->setAbstract(isAbstract());
foreach (QMofClassifier *element, nestedClassifiers())
c->addNestedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
diff --git a/src/mof/qmofclass.h b/src/mof/qmofclass.h
index dcafdbbc..eaa306d6 100644
--- a/src/mof/qmofclass.h
+++ b/src/mof/qmofclass.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofClass : public QMofClassifier
{
public:
explicit QMofClass(bool createQModelingObject = true);
+ virtual ~QMofClass();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofclassifier.cpp b/src/mof/qmofclassifier.cpp
index 7390ec94..6a723605 100644
--- a/src/mof/qmofclassifier.cpp
+++ b/src/mof/qmofclassifier.cpp
@@ -76,6 +76,14 @@ QMofClassifier::QMofClassifier() :
}
/*!
+ Destroys the QMofClassifier.
+ */
+QMofClassifier::~QMofClassifier()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofClassifier.
*/
QModelingElement *QMofClassifier::clone() const
@@ -85,8 +93,6 @@ QModelingElement *QMofClassifier::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -98,8 +104,6 @@ QModelingElement *QMofClassifier::clone() const
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setAbstract(isAbstract());
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
return c;
}
diff --git a/src/mof/qmofclassifier.h b/src/mof/qmofclassifier.h
index a35f47e2..33567b0b 100644
--- a/src/mof/qmofclassifier.h
+++ b/src/mof/qmofclassifier.h
@@ -59,6 +59,8 @@ class QMofProperty;
class Q_MOF_EXPORT QMofClassifier : public QMofType, public QMofRedefinableElement, public QMofNamespace
{
public:
+ virtual ~QMofClassifier();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofcomment.cpp b/src/mof/qmofcomment.cpp
index 513c8cfc..43298a0f 100644
--- a/src/mof/qmofcomment.cpp
+++ b/src/mof/qmofcomment.cpp
@@ -64,6 +64,14 @@ QMofComment::QMofComment(bool createQModelingObject)
}
/*!
+ Destroys the QMofComment.
+ */
+QMofComment::~QMofComment()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofComment.
*/
QModelingElement *QMofComment::clone() const
@@ -71,8 +79,6 @@ QModelingElement *QMofComment::clone() const
QMofComment *c = new QMofComment;
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
- foreach (QMofElement *element, annotatedElements())
- c->addAnnotatedElement(dynamic_cast<QMofElement *>(element->clone()));
c->setBody(body());
return c;
}
diff --git a/src/mof/qmofcomment.h b/src/mof/qmofcomment.h
index a9281413..c33c0520 100644
--- a/src/mof/qmofcomment.h
+++ b/src/mof/qmofcomment.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofComment : public QMofElement
{
public:
explicit QMofComment(bool createQModelingObject = true);
+ virtual ~QMofComment();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofconstraint.cpp b/src/mof/qmofconstraint.cpp
index ec10e079..8b5660ff 100644
--- a/src/mof/qmofconstraint.cpp
+++ b/src/mof/qmofconstraint.cpp
@@ -71,6 +71,14 @@ QMofConstraint::QMofConstraint(bool createQModelingObject) :
}
/*!
+ Destroys the QMofConstraint.
+ */
+QMofConstraint::~QMofConstraint()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofConstraint.
*/
QModelingElement *QMofConstraint::clone() const
@@ -80,10 +88,6 @@ QModelingElement *QMofConstraint::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- foreach (QMofElement *element, constrainedElements())
- c->addConstrainedElement(dynamic_cast<QMofElement *>(element->clone()));
- if (context())
- c->setContext(dynamic_cast<QMofNamespace *>(context()->clone()));
if (specification())
c->setSpecification(dynamic_cast<QMofValueSpecification *>(specification()->clone()));
return c;
diff --git a/src/mof/qmofconstraint.h b/src/mof/qmofconstraint.h
index 21e90605..7d0953cc 100644
--- a/src/mof/qmofconstraint.h
+++ b/src/mof/qmofconstraint.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofConstraint : public QMofPackageableElement
{
public:
explicit QMofConstraint(bool createQModelingObject = true);
+ virtual ~QMofConstraint();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofdatatype.cpp b/src/mof/qmofdatatype.cpp
index 58345801..f2751934 100644
--- a/src/mof/qmofdatatype.cpp
+++ b/src/mof/qmofdatatype.cpp
@@ -80,6 +80,14 @@ QMofDataType::QMofDataType(bool createQModelingObject)
}
/*!
+ Destroys the QMofDataType.
+ */
+QMofDataType::~QMofDataType()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofDataType.
*/
QModelingElement *QMofDataType::clone() const
@@ -89,8 +97,6 @@ QModelingElement *QMofDataType::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -102,8 +108,6 @@ QModelingElement *QMofDataType::clone() const
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setAbstract(isAbstract());
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
foreach (QMofProperty *element, ownedAttributes())
c->addOwnedAttribute(dynamic_cast<QMofProperty *>(element->clone()));
foreach (QMofOperation *element, ownedOperations())
diff --git a/src/mof/qmofdatatype.h b/src/mof/qmofdatatype.h
index 47c84d93..22847e0f 100644
--- a/src/mof/qmofdatatype.h
+++ b/src/mof/qmofdatatype.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofDataType : public QMofClassifier
{
public:
explicit QMofDataType(bool createQModelingObject = true);
+ virtual ~QMofDataType();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofdirectedrelationship.cpp b/src/mof/qmofdirectedrelationship.cpp
index 42935a4b..bb83a245 100644
--- a/src/mof/qmofdirectedrelationship.cpp
+++ b/src/mof/qmofdirectedrelationship.cpp
@@ -64,6 +64,14 @@ QMofDirectedRelationship::QMofDirectedRelationship()
}
/*!
+ Destroys the QMofDirectedRelationship.
+ */
+QMofDirectedRelationship::~QMofDirectedRelationship()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofDirectedRelationship.
*/
QModelingElement *QMofDirectedRelationship::clone() const
diff --git a/src/mof/qmofdirectedrelationship.h b/src/mof/qmofdirectedrelationship.h
index d442e89f..2571fbfd 100644
--- a/src/mof/qmofdirectedrelationship.h
+++ b/src/mof/qmofdirectedrelationship.h
@@ -54,6 +54,8 @@ class QMofElement;
class Q_MOF_EXPORT QMofDirectedRelationship : public QMofRelationship
{
public:
+ virtual ~QMofDirectedRelationship();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofelement.cpp b/src/mof/qmofelement.cpp
index 3ff9bf68..d87dbc43 100644
--- a/src/mof/qmofelement.cpp
+++ b/src/mof/qmofelement.cpp
@@ -65,6 +65,14 @@ QMofElement::QMofElement() :
}
/*!
+ Destroys the QMofElement.
+ */
+QMofElement::~QMofElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofElement.
*/
QModelingElement *QMofElement::clone() const
diff --git a/src/mof/qmofelement.h b/src/mof/qmofelement.h
index 20e1289d..a358bebb 100644
--- a/src/mof/qmofelement.h
+++ b/src/mof/qmofelement.h
@@ -55,6 +55,8 @@ class QMofComment;
class Q_MOF_EXPORT QMofElement : public QMofObject
{
public:
+ virtual ~QMofElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofelementimport.cpp b/src/mof/qmofelementimport.cpp
index 2bd81b1c..6794db0f 100644
--- a/src/mof/qmofelementimport.cpp
+++ b/src/mof/qmofelementimport.cpp
@@ -71,6 +71,14 @@ QMofElementImport::QMofElementImport(bool createQModelingObject) :
}
/*!
+ Destroys the QMofElementImport.
+ */
+QMofElementImport::~QMofElementImport()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofElementImport.
*/
QModelingElement *QMofElementImport::clone() const
@@ -79,10 +87,6 @@ QModelingElement *QMofElementImport::clone() const
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setAlias(alias());
- if (importedElement())
- c->setImportedElement(dynamic_cast<QMofPackageableElement *>(importedElement()->clone()));
- if (importingNamespace())
- c->setImportingNamespace(dynamic_cast<QMofNamespace *>(importingNamespace()->clone()));
c->setVisibility(visibility());
return c;
}
diff --git a/src/mof/qmofelementimport.h b/src/mof/qmofelementimport.h
index 3f8d67f5..e0fabb44 100644
--- a/src/mof/qmofelementimport.h
+++ b/src/mof/qmofelementimport.h
@@ -58,6 +58,7 @@ class Q_MOF_EXPORT QMofElementImport : public QMofDirectedRelationship
{
public:
explicit QMofElementImport(bool createQModelingObject = true);
+ virtual ~QMofElementImport();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofenumeration.cpp b/src/mof/qmofenumeration.cpp
index ea5bbbc6..c8f89d86 100644
--- a/src/mof/qmofenumeration.cpp
+++ b/src/mof/qmofenumeration.cpp
@@ -83,6 +83,14 @@ QMofEnumeration::QMofEnumeration(bool createQModelingObject) :
}
/*!
+ Destroys the QMofEnumeration.
+ */
+QMofEnumeration::~QMofEnumeration()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofEnumeration.
*/
QModelingElement *QMofEnumeration::clone() const
@@ -92,8 +100,6 @@ QModelingElement *QMofEnumeration::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -105,8 +111,6 @@ QModelingElement *QMofEnumeration::clone() const
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setAbstract(isAbstract());
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
foreach (QMofProperty *element, ownedAttributes())
c->addOwnedAttribute(dynamic_cast<QMofProperty *>(element->clone()));
foreach (QMofOperation *element, ownedOperations())
diff --git a/src/mof/qmofenumeration.h b/src/mof/qmofenumeration.h
index d7a498bf..43eadb9d 100644
--- a/src/mof/qmofenumeration.h
+++ b/src/mof/qmofenumeration.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofEnumeration : public QMofDataType
{
public:
explicit QMofEnumeration(bool createQModelingObject = true);
+ virtual ~QMofEnumeration();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofenumerationliteral.cpp b/src/mof/qmofenumerationliteral.cpp
index f7071bfa..505a1b2e 100644
--- a/src/mof/qmofenumerationliteral.cpp
+++ b/src/mof/qmofenumerationliteral.cpp
@@ -74,6 +74,14 @@ QMofEnumerationLiteral::QMofEnumerationLiteral(bool createQModelingObject) :
}
/*!
+ Destroys the QMofEnumerationLiteral.
+ */
+QMofEnumerationLiteral::~QMofEnumerationLiteral()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofEnumerationLiteral.
*/
QModelingElement *QMofEnumerationLiteral::clone() const
@@ -87,8 +95,6 @@ QModelingElement *QMofEnumerationLiteral::clone() const
c->addSlot(dynamic_cast<QMofSlot *>(element->clone()));
if (specification())
c->setSpecification(dynamic_cast<QMofValueSpecification *>(specification()->clone()));
- if (enumeration())
- c->setEnumeration(dynamic_cast<QMofEnumeration *>(enumeration()->clone()));
return c;
}
diff --git a/src/mof/qmofenumerationliteral.h b/src/mof/qmofenumerationliteral.h
index a49a7143..e4907e65 100644
--- a/src/mof/qmofenumerationliteral.h
+++ b/src/mof/qmofenumerationliteral.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofEnumerationLiteral : public QMofInstanceSpecification
{
public:
explicit QMofEnumerationLiteral(bool createQModelingObject = true);
+ virtual ~QMofEnumerationLiteral();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofexception.cpp b/src/mof/qmofexception.cpp
index fa4b990a..720f7015 100644
--- a/src/mof/qmofexception.cpp
+++ b/src/mof/qmofexception.cpp
@@ -54,13 +54,17 @@ QMofException::QMofException(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofExceptionObject(this));
}
+/*!
+ Destroys the QMofException.
+ */
+QMofException::~QMofException()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofException::clone() const
{
QMofException *c = new QMofException;
- if (objectInError())
- c->setObjectInError(dynamic_cast<QMofElement *>(objectInError()->clone()));
- if (elementInError())
- c->setElementInError(dynamic_cast<QMofElement *>(elementInError()->clone()));
c->setDescription(description());
return c;
}
diff --git a/src/mof/qmofexception.h b/src/mof/qmofexception.h
index aa4e03a4..86b2c83b 100644
--- a/src/mof/qmofexception.h
+++ b/src/mof/qmofexception.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofException : public QModelingElement
{
public:
explicit QMofException(bool createQModelingObject = true);
+ virtual ~QMofException();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofexpression.cpp b/src/mof/qmofexpression.cpp
index b1c90f98..97a62089 100644
--- a/src/mof/qmofexpression.cpp
+++ b/src/mof/qmofexpression.cpp
@@ -69,6 +69,14 @@ QMofExpression::QMofExpression(bool createQModelingObject)
}
/*!
+ Destroys the QMofExpression.
+ */
+QMofExpression::~QMofExpression()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofExpression.
*/
QModelingElement *QMofExpression::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofExpression::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
foreach (QMofValueSpecification *element, operands())
c->addOperand(dynamic_cast<QMofValueSpecification *>(element->clone()));
c->setSymbol(symbol());
diff --git a/src/mof/qmofexpression.h b/src/mof/qmofexpression.h
index f9f1a1f1..4c87bba0 100644
--- a/src/mof/qmofexpression.h
+++ b/src/mof/qmofexpression.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofExpression : public QMofValueSpecification
{
public:
explicit QMofExpression(bool createQModelingObject = true);
+ virtual ~QMofExpression();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofextent.cpp b/src/mof/qmofextent.cpp
index 275d0df3..ecf99e43 100644
--- a/src/mof/qmofextent.cpp
+++ b/src/mof/qmofextent.cpp
@@ -57,6 +57,14 @@ QMofExtent::QMofExtent(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofExtentObject(this));
}
+/*!
+ Destroys the QMofExtent.
+ */
+QMofExtent::~QMofExtent()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofExtent::clone() const
{
QMofExtent *c = new QMofExtent;
diff --git a/src/mof/qmofextent.h b/src/mof/qmofextent.h
index 37250bea..a7f600cc 100644
--- a/src/mof/qmofextent.h
+++ b/src/mof/qmofextent.h
@@ -59,6 +59,7 @@ class Q_MOF_EXPORT QMofExtent : public QMofObject
{
public:
explicit QMofExtent(bool createQModelingObject = true);
+ virtual ~QMofExtent();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmoffactory.cpp b/src/mof/qmoffactory.cpp
index c7dea8d9..a0253ea4 100644
--- a/src/mof/qmoffactory.cpp
+++ b/src/mof/qmoffactory.cpp
@@ -59,11 +59,17 @@ QMofFactory::QMofFactory(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofFactoryObject(this));
}
+/*!
+ Destroys the QMofFactory.
+ */
+QMofFactory::~QMofFactory()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofFactory::clone() const
{
QMofFactory *c = new QMofFactory;
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
return c;
}
diff --git a/src/mof/qmoffactory.h b/src/mof/qmoffactory.h
index cc118001..2b7ea4b9 100644
--- a/src/mof/qmoffactory.h
+++ b/src/mof/qmoffactory.h
@@ -61,6 +61,7 @@ class Q_MOF_EXPORT QMofFactory : public QMofElement
{
public:
explicit QMofFactory(bool createQModelingObject = true);
+ virtual ~QMofFactory();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmoffeature.cpp b/src/mof/qmoffeature.cpp
index 5ac824a4..3c47b9f4 100644
--- a/src/mof/qmoffeature.cpp
+++ b/src/mof/qmoffeature.cpp
@@ -68,6 +68,14 @@ QMofFeature::QMofFeature() :
}
/*!
+ Destroys the QMofFeature.
+ */
+QMofFeature::~QMofFeature()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofFeature.
*/
QModelingElement *QMofFeature::clone() const
diff --git a/src/mof/qmoffeature.h b/src/mof/qmoffeature.h
index 7c683ddc..1d5e5c16 100644
--- a/src/mof/qmoffeature.h
+++ b/src/mof/qmoffeature.h
@@ -54,6 +54,8 @@ class QMofClassifier;
class Q_MOF_EXPORT QMofFeature : public QMofRedefinableElement
{
public:
+ virtual ~QMofFeature();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofgeneralization.cpp b/src/mof/qmofgeneralization.cpp
index dedfdb7a..eaefea25 100644
--- a/src/mof/qmofgeneralization.cpp
+++ b/src/mof/qmofgeneralization.cpp
@@ -70,6 +70,14 @@ QMofGeneralization::QMofGeneralization(bool createQModelingObject) :
}
/*!
+ Destroys the QMofGeneralization.
+ */
+QMofGeneralization::~QMofGeneralization()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofGeneralization.
*/
QModelingElement *QMofGeneralization::clone() const
@@ -77,11 +85,7 @@ QModelingElement *QMofGeneralization::clone() const
QMofGeneralization *c = new QMofGeneralization;
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
- if (general())
- c->setGeneral(dynamic_cast<QMofClassifier *>(general()->clone()));
c->setSubstitutable(isSubstitutable());
- if (specific())
- c->setSpecific(dynamic_cast<QMofClassifier *>(specific()->clone()));
return c;
}
diff --git a/src/mof/qmofgeneralization.h b/src/mof/qmofgeneralization.h
index 9198e750..8f9ba12b 100644
--- a/src/mof/qmofgeneralization.h
+++ b/src/mof/qmofgeneralization.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofGeneralization : public QMofDirectedRelationship
{
public:
explicit QMofGeneralization(bool createQModelingObject = true);
+ virtual ~QMofGeneralization();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofinstancespecification.cpp b/src/mof/qmofinstancespecification.cpp
index 847d72bc..f2e100b7 100644
--- a/src/mof/qmofinstancespecification.cpp
+++ b/src/mof/qmofinstancespecification.cpp
@@ -72,6 +72,14 @@ QMofInstanceSpecification::QMofInstanceSpecification(bool createQModelingObject)
}
/*!
+ Destroys the QMofInstanceSpecification.
+ */
+QMofInstanceSpecification::~QMofInstanceSpecification()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofInstanceSpecification.
*/
QModelingElement *QMofInstanceSpecification::clone() const
@@ -81,8 +89,6 @@ QModelingElement *QMofInstanceSpecification::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- foreach (QMofClassifier *element, classifiers())
- c->addClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
foreach (QMofSlot *element, slots_())
c->addSlot(dynamic_cast<QMofSlot *>(element->clone()));
if (specification())
diff --git a/src/mof/qmofinstancespecification.h b/src/mof/qmofinstancespecification.h
index f8256bc6..8793752b 100644
--- a/src/mof/qmofinstancespecification.h
+++ b/src/mof/qmofinstancespecification.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofInstanceSpecification : public QMofPackageableElement
{
public:
explicit QMofInstanceSpecification(bool createQModelingObject = true);
+ virtual ~QMofInstanceSpecification();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofinstancevalue.cpp b/src/mof/qmofinstancevalue.cpp
index c63f5291..5c8d8857 100644
--- a/src/mof/qmofinstancevalue.cpp
+++ b/src/mof/qmofinstancevalue.cpp
@@ -71,6 +71,14 @@ QMofInstanceValue::QMofInstanceValue(bool createQModelingObject) :
}
/*!
+ Destroys the QMofInstanceValue.
+ */
+QMofInstanceValue::~QMofInstanceValue()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofInstanceValue.
*/
QModelingElement *QMofInstanceValue::clone() const
@@ -80,10 +88,6 @@ QModelingElement *QMofInstanceValue::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
- if (instance())
- c->setInstance(dynamic_cast<QMofInstanceSpecification *>(instance()->clone()));
return c;
}
diff --git a/src/mof/qmofinstancevalue.h b/src/mof/qmofinstancevalue.h
index 99f55a71..f15ae709 100644
--- a/src/mof/qmofinstancevalue.h
+++ b/src/mof/qmofinstancevalue.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofInstanceValue : public QMofValueSpecification
{
public:
explicit QMofInstanceValue(bool createQModelingObject = true);
+ virtual ~QMofInstanceValue();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmoflink.cpp b/src/mof/qmoflink.cpp
index bd75558b..86b45fa5 100644
--- a/src/mof/qmoflink.cpp
+++ b/src/mof/qmoflink.cpp
@@ -57,15 +57,17 @@ QMofLink::QMofLink(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofLinkObject(this));
}
+/*!
+ Destroys the QMofLink.
+ */
+QMofLink::~QMofLink()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofLink::clone() const
{
QMofLink *c = new QMofLink;
- if (firstElement())
- c->setFirstElement(dynamic_cast<QMofElement *>(firstElement()->clone()));
- if (secondElement())
- c->setSecondElement(dynamic_cast<QMofElement *>(secondElement()->clone()));
- if (association())
- c->setAssociation(dynamic_cast<QMofAssociation *>(association()->clone()));
return c;
}
diff --git a/src/mof/qmoflink.h b/src/mof/qmoflink.h
index 6c06b1a6..70bdb44e 100644
--- a/src/mof/qmoflink.h
+++ b/src/mof/qmoflink.h
@@ -56,6 +56,7 @@ class Q_MOF_EXPORT QMofLink : public QMofObject
{
public:
explicit QMofLink(bool createQModelingObject = true);
+ virtual ~QMofLink();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralboolean.cpp b/src/mof/qmofliteralboolean.cpp
index 91709c6a..51a08cf5 100644
--- a/src/mof/qmofliteralboolean.cpp
+++ b/src/mof/qmofliteralboolean.cpp
@@ -70,6 +70,14 @@ QMofLiteralBoolean::QMofLiteralBoolean(bool createQModelingObject) :
}
/*!
+ Destroys the QMofLiteralBoolean.
+ */
+QMofLiteralBoolean::~QMofLiteralBoolean()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralBoolean.
*/
QModelingElement *QMofLiteralBoolean::clone() const
@@ -79,8 +87,6 @@ QModelingElement *QMofLiteralBoolean::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setValue(value());
return c;
}
diff --git a/src/mof/qmofliteralboolean.h b/src/mof/qmofliteralboolean.h
index 28e91337..a67567fc 100644
--- a/src/mof/qmofliteralboolean.h
+++ b/src/mof/qmofliteralboolean.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralBoolean : public QMofLiteralSpecification
{
public:
explicit QMofLiteralBoolean(bool createQModelingObject = true);
+ virtual ~QMofLiteralBoolean();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralinteger.cpp b/src/mof/qmofliteralinteger.cpp
index 3702c0ea..3d40f4c4 100644
--- a/src/mof/qmofliteralinteger.cpp
+++ b/src/mof/qmofliteralinteger.cpp
@@ -70,6 +70,14 @@ QMofLiteralInteger::QMofLiteralInteger(bool createQModelingObject) :
}
/*!
+ Destroys the QMofLiteralInteger.
+ */
+QMofLiteralInteger::~QMofLiteralInteger()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralInteger.
*/
QModelingElement *QMofLiteralInteger::clone() const
@@ -79,8 +87,6 @@ QModelingElement *QMofLiteralInteger::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setValue(value());
return c;
}
diff --git a/src/mof/qmofliteralinteger.h b/src/mof/qmofliteralinteger.h
index dd38443b..f10897aa 100644
--- a/src/mof/qmofliteralinteger.h
+++ b/src/mof/qmofliteralinteger.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralInteger : public QMofLiteralSpecification
{
public:
explicit QMofLiteralInteger(bool createQModelingObject = true);
+ virtual ~QMofLiteralInteger();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralnull.cpp b/src/mof/qmofliteralnull.cpp
index 0bf2f69f..62a90a1a 100644
--- a/src/mof/qmofliteralnull.cpp
+++ b/src/mof/qmofliteralnull.cpp
@@ -69,6 +69,14 @@ QMofLiteralNull::QMofLiteralNull(bool createQModelingObject)
}
/*!
+ Destroys the QMofLiteralNull.
+ */
+QMofLiteralNull::~QMofLiteralNull()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralNull.
*/
QModelingElement *QMofLiteralNull::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofLiteralNull::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
return c;
}
diff --git a/src/mof/qmofliteralnull.h b/src/mof/qmofliteralnull.h
index f8916377..e261311d 100644
--- a/src/mof/qmofliteralnull.h
+++ b/src/mof/qmofliteralnull.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralNull : public QMofLiteralSpecification
{
public:
explicit QMofLiteralNull(bool createQModelingObject = true);
+ virtual ~QMofLiteralNull();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralreal.cpp b/src/mof/qmofliteralreal.cpp
index ef90a29b..61a1644b 100644
--- a/src/mof/qmofliteralreal.cpp
+++ b/src/mof/qmofliteralreal.cpp
@@ -69,6 +69,14 @@ QMofLiteralReal::QMofLiteralReal(bool createQModelingObject)
}
/*!
+ Destroys the QMofLiteralReal.
+ */
+QMofLiteralReal::~QMofLiteralReal()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralReal.
*/
QModelingElement *QMofLiteralReal::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofLiteralReal::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setValue(value());
return c;
}
diff --git a/src/mof/qmofliteralreal.h b/src/mof/qmofliteralreal.h
index 3fb88179..1ad13e57 100644
--- a/src/mof/qmofliteralreal.h
+++ b/src/mof/qmofliteralreal.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralReal : public QMofLiteralSpecification
{
public:
explicit QMofLiteralReal(bool createQModelingObject = true);
+ virtual ~QMofLiteralReal();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralspecification.cpp b/src/mof/qmofliteralspecification.cpp
index 17b51f38..4e2d115b 100644
--- a/src/mof/qmofliteralspecification.cpp
+++ b/src/mof/qmofliteralspecification.cpp
@@ -67,6 +67,14 @@ QMofLiteralSpecification::QMofLiteralSpecification()
}
/*!
+ Destroys the QMofLiteralSpecification.
+ */
+QMofLiteralSpecification::~QMofLiteralSpecification()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralSpecification.
*/
QModelingElement *QMofLiteralSpecification::clone() const
@@ -76,8 +84,6 @@ QModelingElement *QMofLiteralSpecification::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
return c;
}
diff --git a/src/mof/qmofliteralspecification.h b/src/mof/qmofliteralspecification.h
index 4cdd3137..94f5bec3 100644
--- a/src/mof/qmofliteralspecification.h
+++ b/src/mof/qmofliteralspecification.h
@@ -52,6 +52,8 @@ QT_MODULE(QtMof)
class Q_MOF_EXPORT QMofLiteralSpecification : public QMofValueSpecification
{
public:
+ virtual ~QMofLiteralSpecification();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralstring.cpp b/src/mof/qmofliteralstring.cpp
index 05b257be..3fce6d94 100644
--- a/src/mof/qmofliteralstring.cpp
+++ b/src/mof/qmofliteralstring.cpp
@@ -69,6 +69,14 @@ QMofLiteralString::QMofLiteralString(bool createQModelingObject)
}
/*!
+ Destroys the QMofLiteralString.
+ */
+QMofLiteralString::~QMofLiteralString()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralString.
*/
QModelingElement *QMofLiteralString::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofLiteralString::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setValue(value());
return c;
}
diff --git a/src/mof/qmofliteralstring.h b/src/mof/qmofliteralstring.h
index 527f0972..94d4b9e1 100644
--- a/src/mof/qmofliteralstring.h
+++ b/src/mof/qmofliteralstring.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralString : public QMofLiteralSpecification
{
public:
explicit QMofLiteralString(bool createQModelingObject = true);
+ virtual ~QMofLiteralString();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofliteralunlimitednatural.cpp b/src/mof/qmofliteralunlimitednatural.cpp
index 4408bae7..c1786e00 100644
--- a/src/mof/qmofliteralunlimitednatural.cpp
+++ b/src/mof/qmofliteralunlimitednatural.cpp
@@ -69,6 +69,14 @@ QMofLiteralUnlimitedNatural::QMofLiteralUnlimitedNatural(bool createQModelingObj
}
/*!
+ Destroys the QMofLiteralUnlimitedNatural.
+ */
+QMofLiteralUnlimitedNatural::~QMofLiteralUnlimitedNatural()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofLiteralUnlimitedNatural.
*/
QModelingElement *QMofLiteralUnlimitedNatural::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofLiteralUnlimitedNatural::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setValue(value());
return c;
}
diff --git a/src/mof/qmofliteralunlimitednatural.h b/src/mof/qmofliteralunlimitednatural.h
index 9fe66e69..32ee82bb 100644
--- a/src/mof/qmofliteralunlimitednatural.h
+++ b/src/mof/qmofliteralunlimitednatural.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofLiteralUnlimitedNatural : public QMofLiteralSpecification
{
public:
explicit QMofLiteralUnlimitedNatural(bool createQModelingObject = true);
+ virtual ~QMofLiteralUnlimitedNatural();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofmultiplicityelement.cpp b/src/mof/qmofmultiplicityelement.cpp
index f93bddae..4481a374 100644
--- a/src/mof/qmofmultiplicityelement.cpp
+++ b/src/mof/qmofmultiplicityelement.cpp
@@ -68,6 +68,14 @@ QMofMultiplicityElement::QMofMultiplicityElement() :
}
/*!
+ Destroys the QMofMultiplicityElement.
+ */
+QMofMultiplicityElement::~QMofMultiplicityElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofMultiplicityElement.
*/
QModelingElement *QMofMultiplicityElement::clone() const
diff --git a/src/mof/qmofmultiplicityelement.h b/src/mof/qmofmultiplicityelement.h
index 8ed4f598..2a5e2b70 100644
--- a/src/mof/qmofmultiplicityelement.h
+++ b/src/mof/qmofmultiplicityelement.h
@@ -54,6 +54,8 @@ class QMofValueSpecification;
class Q_MOF_EXPORT QMofMultiplicityElement : public virtual QMofElement
{
public:
+ virtual ~QMofMultiplicityElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofnamedelement.cpp b/src/mof/qmofnamedelement.cpp
index 07a66529..2513bdc5 100644
--- a/src/mof/qmofnamedelement.cpp
+++ b/src/mof/qmofnamedelement.cpp
@@ -66,6 +66,14 @@ QMofNamedElement::QMofNamedElement() :
}
/*!
+ Destroys the QMofNamedElement.
+ */
+QMofNamedElement::~QMofNamedElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofNamedElement.
*/
QModelingElement *QMofNamedElement::clone() const
diff --git a/src/mof/qmofnamedelement.h b/src/mof/qmofnamedelement.h
index aab155b7..68b04244 100644
--- a/src/mof/qmofnamedelement.h
+++ b/src/mof/qmofnamedelement.h
@@ -56,6 +56,8 @@ class QMofNamespace;
class Q_MOF_EXPORT QMofNamedElement : public virtual QMofElement
{
public:
+ virtual ~QMofNamedElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofnamespace.cpp b/src/mof/qmofnamespace.cpp
index c2dfe0bc..3a7fa758 100644
--- a/src/mof/qmofnamespace.cpp
+++ b/src/mof/qmofnamespace.cpp
@@ -70,6 +70,14 @@ QMofNamespace::QMofNamespace()
}
/*!
+ Destroys the QMofNamespace.
+ */
+QMofNamespace::~QMofNamespace()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofNamespace.
*/
QModelingElement *QMofNamespace::clone() const
diff --git a/src/mof/qmofnamespace.h b/src/mof/qmofnamespace.h
index ce83270e..fb2bbd2f 100644
--- a/src/mof/qmofnamespace.h
+++ b/src/mof/qmofnamespace.h
@@ -57,6 +57,8 @@ class QMofPackageImport;
class Q_MOF_EXPORT QMofNamespace : public virtual QMofNamedElement
{
public:
+ virtual ~QMofNamespace();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofobject.cpp b/src/mof/qmofobject.cpp
index c4086b47..159c7636 100644
--- a/src/mof/qmofobject.cpp
+++ b/src/mof/qmofobject.cpp
@@ -54,6 +54,14 @@ QMofObject::QMofObject(bool createQModelingObject)
_qModelingObject = qobject_cast<QModelingObject *>(new QMofObjectObject(this));
}
+/*!
+ Destroys the QMofObject.
+ */
+QMofObject::~QMofObject()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofObject::clone() const
{
QMofObject *c = new QMofObject;
diff --git a/src/mof/qmofobject.h b/src/mof/qmofobject.h
index f3c57fbd..c2b9c9d3 100644
--- a/src/mof/qmofobject.h
+++ b/src/mof/qmofobject.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofObject : public QModelingElement
{
public:
explicit QMofObject(bool createQModelingObject = true);
+ virtual ~QMofObject();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofopaqueexpression.cpp b/src/mof/qmofopaqueexpression.cpp
index 3a9097f9..5c262dd5 100644
--- a/src/mof/qmofopaqueexpression.cpp
+++ b/src/mof/qmofopaqueexpression.cpp
@@ -69,6 +69,14 @@ QMofOpaqueExpression::QMofOpaqueExpression(bool createQModelingObject)
}
/*!
+ Destroys the QMofOpaqueExpression.
+ */
+QMofOpaqueExpression::~QMofOpaqueExpression()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofOpaqueExpression.
*/
QModelingElement *QMofOpaqueExpression::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofOpaqueExpression::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
foreach (QString element, bodies())
c->addBody(element);
foreach (QString element, languages())
diff --git a/src/mof/qmofopaqueexpression.h b/src/mof/qmofopaqueexpression.h
index 5f4bb7b9..e60b9bee 100644
--- a/src/mof/qmofopaqueexpression.h
+++ b/src/mof/qmofopaqueexpression.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofOpaqueExpression : public QMofValueSpecification
{
public:
explicit QMofOpaqueExpression(bool createQModelingObject = true);
+ virtual ~QMofOpaqueExpression();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofoperation.cpp b/src/mof/qmofoperation.cpp
index e714b994..872d6266 100644
--- a/src/mof/qmofoperation.cpp
+++ b/src/mof/qmofoperation.cpp
@@ -81,6 +81,14 @@ QMofOperation::QMofOperation(bool createQModelingObject) :
}
/*!
+ Destroys the QMofOperation.
+ */
+QMofOperation::~QMofOperation()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofOperation.
*/
QModelingElement *QMofOperation::clone() const
@@ -100,10 +108,6 @@ QModelingElement *QMofOperation::clone() const
c->addPackageImport(dynamic_cast<QMofPackageImport *>(element->clone()));
if (bodyCondition())
c->setBodyCondition(dynamic_cast<QMofConstraint *>(bodyCondition()->clone()));
- if (class_())
- c->setClass(dynamic_cast<QMofClass *>(class_()->clone()));
- if (datatype())
- c->setDatatype(dynamic_cast<QMofDataType *>(datatype()->clone()));
c->setQuery(isQuery());
foreach (QMofParameter *element, ownedParameters())
c->addOwnedParameter(dynamic_cast<QMofParameter *>(element->clone()));
@@ -111,10 +115,6 @@ QModelingElement *QMofOperation::clone() const
c->addPostcondition(dynamic_cast<QMofConstraint *>(element->clone()));
foreach (QMofConstraint *element, preconditions())
c->addPrecondition(dynamic_cast<QMofConstraint *>(element->clone()));
- foreach (QMofType *element, raisedExceptions())
- c->addRaisedException(dynamic_cast<QMofType *>(element->clone()));
- foreach (QMofOperation *element, redefinedOperations())
- c->addRedefinedOperation(dynamic_cast<QMofOperation *>(element->clone()));
return c;
}
diff --git a/src/mof/qmofoperation.h b/src/mof/qmofoperation.h
index 71548022..a6699fd9 100644
--- a/src/mof/qmofoperation.h
+++ b/src/mof/qmofoperation.h
@@ -60,6 +60,7 @@ class Q_MOF_EXPORT QMofOperation : public QMofBehavioralFeature
{
public:
explicit QMofOperation(bool createQModelingObject = true);
+ virtual ~QMofOperation();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofpackage.cpp b/src/mof/qmofpackage.cpp
index 9704e347..4c6a9881 100644
--- a/src/mof/qmofpackage.cpp
+++ b/src/mof/qmofpackage.cpp
@@ -73,6 +73,14 @@ QMofPackage::QMofPackage(bool createQModelingObject) :
}
/*!
+ Destroys the QMofPackage.
+ */
+QMofPackage::~QMofPackage()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofPackage.
*/
QModelingElement *QMofPackage::clone() const
@@ -89,8 +97,6 @@ QModelingElement *QMofPackage::clone() const
c->addPackageImport(dynamic_cast<QMofPackageImport *>(element->clone()));
c->setVisibility(visibility());
c->setURI(URI());
- if (nestingPackage())
- c->setNestingPackage(dynamic_cast<QMofPackage *>(nestingPackage()->clone()));
foreach (QMofPackageMerge *element, packageMerges())
c->addPackageMerge(dynamic_cast<QMofPackageMerge *>(element->clone()));
foreach (QMofPackageableElement *element, packagedElements())
diff --git a/src/mof/qmofpackage.h b/src/mof/qmofpackage.h
index d39fa266..eda7fb16 100644
--- a/src/mof/qmofpackage.h
+++ b/src/mof/qmofpackage.h
@@ -58,6 +58,7 @@ class Q_MOF_EXPORT QMofPackage : public QMofNamespace, public QMofPackageableEle
{
public:
explicit QMofPackage(bool createQModelingObject = true);
+ virtual ~QMofPackage();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofpackageableelement.cpp b/src/mof/qmofpackageableelement.cpp
index 9b576556..56de008a 100644
--- a/src/mof/qmofpackageableelement.cpp
+++ b/src/mof/qmofpackageableelement.cpp
@@ -66,6 +66,14 @@ QMofPackageableElement::QMofPackageableElement() :
}
/*!
+ Destroys the QMofPackageableElement.
+ */
+QMofPackageableElement::~QMofPackageableElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofPackageableElement.
*/
QModelingElement *QMofPackageableElement::clone() const
diff --git a/src/mof/qmofpackageableelement.h b/src/mof/qmofpackageableelement.h
index 5f98bdf0..f0c8680b 100644
--- a/src/mof/qmofpackageableelement.h
+++ b/src/mof/qmofpackageableelement.h
@@ -54,6 +54,8 @@ QT_MODULE(QtMof)
class Q_MOF_EXPORT QMofPackageableElement : public virtual QMofNamedElement
{
public:
+ virtual ~QMofPackageableElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofpackageimport.cpp b/src/mof/qmofpackageimport.cpp
index d0fee64e..7d33cb49 100644
--- a/src/mof/qmofpackageimport.cpp
+++ b/src/mof/qmofpackageimport.cpp
@@ -71,6 +71,14 @@ QMofPackageImport::QMofPackageImport(bool createQModelingObject) :
}
/*!
+ Destroys the QMofPackageImport.
+ */
+QMofPackageImport::~QMofPackageImport()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofPackageImport.
*/
QModelingElement *QMofPackageImport::clone() const
@@ -78,10 +86,6 @@ QModelingElement *QMofPackageImport::clone() const
QMofPackageImport *c = new QMofPackageImport;
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
- if (importedPackage())
- c->setImportedPackage(dynamic_cast<QMofPackage *>(importedPackage()->clone()));
- if (importingNamespace())
- c->setImportingNamespace(dynamic_cast<QMofNamespace *>(importingNamespace()->clone()));
c->setVisibility(visibility());
return c;
}
diff --git a/src/mof/qmofpackageimport.h b/src/mof/qmofpackageimport.h
index 67b05d27..f8dab118 100644
--- a/src/mof/qmofpackageimport.h
+++ b/src/mof/qmofpackageimport.h
@@ -58,6 +58,7 @@ class Q_MOF_EXPORT QMofPackageImport : public QMofDirectedRelationship
{
public:
explicit QMofPackageImport(bool createQModelingObject = true);
+ virtual ~QMofPackageImport();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofpackagemerge.cpp b/src/mof/qmofpackagemerge.cpp
index f2acd3c7..0cc7cce3 100644
--- a/src/mof/qmofpackagemerge.cpp
+++ b/src/mof/qmofpackagemerge.cpp
@@ -69,6 +69,14 @@ QMofPackageMerge::QMofPackageMerge(bool createQModelingObject) :
}
/*!
+ Destroys the QMofPackageMerge.
+ */
+QMofPackageMerge::~QMofPackageMerge()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofPackageMerge.
*/
QModelingElement *QMofPackageMerge::clone() const
@@ -76,10 +84,6 @@ QModelingElement *QMofPackageMerge::clone() const
QMofPackageMerge *c = new QMofPackageMerge;
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
- if (mergedPackage())
- c->setMergedPackage(dynamic_cast<QMofPackage *>(mergedPackage()->clone()));
- if (receivingPackage())
- c->setReceivingPackage(dynamic_cast<QMofPackage *>(receivingPackage()->clone()));
return c;
}
diff --git a/src/mof/qmofpackagemerge.h b/src/mof/qmofpackagemerge.h
index bd3f597b..01e1c97b 100644
--- a/src/mof/qmofpackagemerge.h
+++ b/src/mof/qmofpackagemerge.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofPackageMerge : public QMofDirectedRelationship
{
public:
explicit QMofPackageMerge(bool createQModelingObject = true);
+ virtual ~QMofPackageMerge();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofparameter.cpp b/src/mof/qmofparameter.cpp
index 79947873..6228b25e 100644
--- a/src/mof/qmofparameter.cpp
+++ b/src/mof/qmofparameter.cpp
@@ -74,6 +74,14 @@ QMofParameter::QMofParameter(bool createQModelingObject) :
}
/*!
+ Destroys the QMofParameter.
+ */
+QMofParameter::~QMofParameter()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofParameter.
*/
QModelingElement *QMofParameter::clone() const
@@ -83,8 +91,6 @@ QModelingElement *QMofParameter::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setOrdered(isOrdered());
c->setUnique(isUnique());
if (lowerValue())
@@ -94,8 +100,6 @@ QModelingElement *QMofParameter::clone() const
if (defaultValue())
c->setDefaultValue(dynamic_cast<QMofValueSpecification *>(defaultValue()->clone()));
c->setDirection(direction());
- if (operation())
- c->setOperation(dynamic_cast<QMofOperation *>(operation()->clone()));
return c;
}
diff --git a/src/mof/qmofparameter.h b/src/mof/qmofparameter.h
index b41df3b6..b401c2b6 100644
--- a/src/mof/qmofparameter.h
+++ b/src/mof/qmofparameter.h
@@ -59,6 +59,7 @@ class Q_MOF_EXPORT QMofParameter : public QMofTypedElement, public QMofMultiplic
{
public:
explicit QMofParameter(bool createQModelingObject = true);
+ virtual ~QMofParameter();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofprimitivetype.cpp b/src/mof/qmofprimitivetype.cpp
index fa825b2b..4643cd16 100644
--- a/src/mof/qmofprimitivetype.cpp
+++ b/src/mof/qmofprimitivetype.cpp
@@ -82,6 +82,14 @@ QMofPrimitiveType::QMofPrimitiveType(bool createQModelingObject) :
}
/*!
+ Destroys the QMofPrimitiveType.
+ */
+QMofPrimitiveType::~QMofPrimitiveType()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofPrimitiveType.
*/
QModelingElement *QMofPrimitiveType::clone() const
@@ -91,8 +99,6 @@ QModelingElement *QMofPrimitiveType::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
c->setLeaf(isLeaf());
foreach (QMofElementImport *element, elementImports())
c->addElementImport(dynamic_cast<QMofElementImport *>(element->clone()));
@@ -104,8 +110,6 @@ QModelingElement *QMofPrimitiveType::clone() const
c->addGeneralization(dynamic_cast<QMofGeneralization *>(element->clone()));
c->setAbstract(isAbstract());
c->setFinalSpecialization(isFinalSpecialization());
- foreach (QMofClassifier *element, redefinedClassifiers())
- c->addRedefinedClassifier(dynamic_cast<QMofClassifier *>(element->clone()));
foreach (QMofProperty *element, ownedAttributes())
c->addOwnedAttribute(dynamic_cast<QMofProperty *>(element->clone()));
foreach (QMofOperation *element, ownedOperations())
diff --git a/src/mof/qmofprimitivetype.h b/src/mof/qmofprimitivetype.h
index bdb7da73..61c7c5c7 100644
--- a/src/mof/qmofprimitivetype.h
+++ b/src/mof/qmofprimitivetype.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofPrimitiveType : public QMofDataType
{
public:
explicit QMofPrimitiveType(bool createQModelingObject = true);
+ virtual ~QMofPrimitiveType();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofproperty.cpp b/src/mof/qmofproperty.cpp
index d7690fe4..6dcb5623 100644
--- a/src/mof/qmofproperty.cpp
+++ b/src/mof/qmofproperty.cpp
@@ -85,6 +85,14 @@ QMofProperty::QMofProperty(bool createQModelingObject) :
}
/*!
+ Destroys the QMofProperty.
+ */
+QMofProperty::~QMofProperty()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofProperty.
*/
QModelingElement *QMofProperty::clone() const
@@ -96,8 +104,6 @@ QModelingElement *QMofProperty::clone() const
c->setVisibility(visibility());
c->setLeaf(isLeaf());
c->setStatic(isStatic());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setOrdered(isOrdered());
c->setUnique(isUnique());
if (lowerValue())
@@ -105,24 +111,12 @@ QModelingElement *QMofProperty::clone() const
if (upperValue())
c->setUpperValue(dynamic_cast<QMofValueSpecification *>(upperValue()->clone()));
c->setAggregation(aggregation());
- if (association())
- c->setAssociation(dynamic_cast<QMofAssociation *>(association()->clone()));
- if (class_())
- c->setClass(dynamic_cast<QMofClass *>(class_()->clone()));
- if (datatype())
- c->setDatatype(dynamic_cast<QMofDataType *>(datatype()->clone()));
if (defaultValue())
c->setDefaultValue(dynamic_cast<QMofValueSpecification *>(defaultValue()->clone()));
c->setDerived(isDerived());
c->setDerivedUnion(isDerivedUnion());
c->setID(isID());
c->setReadOnly(isReadOnly());
- if (owningAssociation())
- c->setOwningAssociation(dynamic_cast<QMofAssociation *>(owningAssociation()->clone()));
- foreach (QMofProperty *element, redefinedProperties())
- c->addRedefinedProperty(dynamic_cast<QMofProperty *>(element->clone()));
- foreach (QMofProperty *element, subsettedProperties())
- c->addSubsettedProperty(dynamic_cast<QMofProperty *>(element->clone()));
return c;
}
diff --git a/src/mof/qmofproperty.h b/src/mof/qmofproperty.h
index 9ef42302..bd5fc3c4 100644
--- a/src/mof/qmofproperty.h
+++ b/src/mof/qmofproperty.h
@@ -62,6 +62,7 @@ class Q_MOF_EXPORT QMofProperty : public QMofStructuralFeature
{
public:
explicit QMofProperty(bool createQModelingObject = true);
+ virtual ~QMofProperty();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofredefinableelement.cpp b/src/mof/qmofredefinableelement.cpp
index a6d18de9..5b0187ea 100644
--- a/src/mof/qmofredefinableelement.cpp
+++ b/src/mof/qmofredefinableelement.cpp
@@ -67,6 +67,14 @@ QMofRedefinableElement::QMofRedefinableElement() :
}
/*!
+ Destroys the QMofRedefinableElement.
+ */
+QMofRedefinableElement::~QMofRedefinableElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofRedefinableElement.
*/
QModelingElement *QMofRedefinableElement::clone() const
diff --git a/src/mof/qmofredefinableelement.h b/src/mof/qmofredefinableelement.h
index 2c49ea01..3fc50dbd 100644
--- a/src/mof/qmofredefinableelement.h
+++ b/src/mof/qmofredefinableelement.h
@@ -54,6 +54,8 @@ class QMofClassifier;
class Q_MOF_EXPORT QMofRedefinableElement : public virtual QMofNamedElement
{
public:
+ virtual ~QMofRedefinableElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofreflectivecollection.cpp b/src/mof/qmofreflectivecollection.cpp
index 3bf23d3c..a761d41b 100644
--- a/src/mof/qmofreflectivecollection.cpp
+++ b/src/mof/qmofreflectivecollection.cpp
@@ -51,6 +51,14 @@ QMofReflectiveCollection::QMofReflectiveCollection(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofReflectiveCollectionObject(this));
}
+/*!
+ Destroys the QMofReflectiveCollection.
+ */
+QMofReflectiveCollection::~QMofReflectiveCollection()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofReflectiveCollection::clone() const
{
QMofReflectiveCollection *c = new QMofReflectiveCollection;
diff --git a/src/mof/qmofreflectivecollection.h b/src/mof/qmofreflectivecollection.h
index a923709a..752722d2 100644
--- a/src/mof/qmofreflectivecollection.h
+++ b/src/mof/qmofreflectivecollection.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofReflectiveCollection : public QMofObject
{
public:
explicit QMofReflectiveCollection(bool createQModelingObject = true);
+ virtual ~QMofReflectiveCollection();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofreflectivesequence.cpp b/src/mof/qmofreflectivesequence.cpp
index af8d79ba..23e9eca6 100644
--- a/src/mof/qmofreflectivesequence.cpp
+++ b/src/mof/qmofreflectivesequence.cpp
@@ -53,6 +53,14 @@ QMofReflectiveSequence::QMofReflectiveSequence(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofReflectiveSequenceObject(this));
}
+/*!
+ Destroys the QMofReflectiveSequence.
+ */
+QMofReflectiveSequence::~QMofReflectiveSequence()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofReflectiveSequence::clone() const
{
QMofReflectiveSequence *c = new QMofReflectiveSequence;
diff --git a/src/mof/qmofreflectivesequence.h b/src/mof/qmofreflectivesequence.h
index cfdbcfd5..fd06f463 100644
--- a/src/mof/qmofreflectivesequence.h
+++ b/src/mof/qmofreflectivesequence.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofReflectiveSequence : public QMofReflectiveCollection
{
public:
explicit QMofReflectiveSequence(bool createQModelingObject = true);
+ virtual ~QMofReflectiveSequence();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofrelationship.cpp b/src/mof/qmofrelationship.cpp
index ea95b44c..115bb1ee 100644
--- a/src/mof/qmofrelationship.cpp
+++ b/src/mof/qmofrelationship.cpp
@@ -63,6 +63,14 @@ QMofRelationship::QMofRelationship()
}
/*!
+ Destroys the QMofRelationship.
+ */
+QMofRelationship::~QMofRelationship()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofRelationship.
*/
QModelingElement *QMofRelationship::clone() const
diff --git a/src/mof/qmofrelationship.h b/src/mof/qmofrelationship.h
index dfa57276..93b2253c 100644
--- a/src/mof/qmofrelationship.h
+++ b/src/mof/qmofrelationship.h
@@ -52,6 +52,8 @@ QT_MODULE(QtMof)
class Q_MOF_EXPORT QMofRelationship : public virtual QMofElement
{
public:
+ virtual ~QMofRelationship();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofslot.cpp b/src/mof/qmofslot.cpp
index 90f81525..22ad8f1a 100644
--- a/src/mof/qmofslot.cpp
+++ b/src/mof/qmofslot.cpp
@@ -70,6 +70,14 @@ QMofSlot::QMofSlot(bool createQModelingObject) :
}
/*!
+ Destroys the QMofSlot.
+ */
+QMofSlot::~QMofSlot()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofSlot.
*/
QModelingElement *QMofSlot::clone() const
@@ -77,10 +85,6 @@ QModelingElement *QMofSlot::clone() const
QMofSlot *c = new QMofSlot;
foreach (QMofComment *element, ownedComments())
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
- if (definingFeature())
- c->setDefiningFeature(dynamic_cast<QMofStructuralFeature *>(definingFeature()->clone()));
- if (owningInstance())
- c->setOwningInstance(dynamic_cast<QMofInstanceSpecification *>(owningInstance()->clone()));
foreach (QMofValueSpecification *element, values())
c->addValue(dynamic_cast<QMofValueSpecification *>(element->clone()));
return c;
diff --git a/src/mof/qmofslot.h b/src/mof/qmofslot.h
index 82c08aa2..3ba8376b 100644
--- a/src/mof/qmofslot.h
+++ b/src/mof/qmofslot.h
@@ -57,6 +57,7 @@ class Q_MOF_EXPORT QMofSlot : public QMofElement
{
public:
explicit QMofSlot(bool createQModelingObject = true);
+ virtual ~QMofSlot();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofstructuralfeature.cpp b/src/mof/qmofstructuralfeature.cpp
index 1a3ef007..e056e1a0 100644
--- a/src/mof/qmofstructuralfeature.cpp
+++ b/src/mof/qmofstructuralfeature.cpp
@@ -71,6 +71,14 @@ QMofStructuralFeature::QMofStructuralFeature() :
}
/*!
+ Destroys the QMofStructuralFeature.
+ */
+QMofStructuralFeature::~QMofStructuralFeature()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofStructuralFeature.
*/
QModelingElement *QMofStructuralFeature::clone() const
@@ -82,8 +90,6 @@ QModelingElement *QMofStructuralFeature::clone() const
c->setVisibility(visibility());
c->setLeaf(isLeaf());
c->setStatic(isStatic());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
c->setOrdered(isOrdered());
c->setUnique(isUnique());
if (lowerValue())
diff --git a/src/mof/qmofstructuralfeature.h b/src/mof/qmofstructuralfeature.h
index dfb0adee..527a54f4 100644
--- a/src/mof/qmofstructuralfeature.h
+++ b/src/mof/qmofstructuralfeature.h
@@ -54,6 +54,8 @@ QT_MODULE(QtMof)
class Q_MOF_EXPORT QMofStructuralFeature : public QMofFeature, public virtual QMofTypedElement, public QMofMultiplicityElement
{
public:
+ virtual ~QMofStructuralFeature();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmoftag.cpp b/src/mof/qmoftag.cpp
index 03ddaa0a..9ed8cd5e 100644
--- a/src/mof/qmoftag.cpp
+++ b/src/mof/qmoftag.cpp
@@ -51,15 +51,19 @@ QMofTag::QMofTag(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofTagObject(this));
}
+/*!
+ Destroys the QMofTag.
+ */
+QMofTag::~QMofTag()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofTag::clone() const
{
QMofTag *c = new QMofTag;
c->setName(name());
c->setValue(value());
- foreach (QMofElement *element, elements())
- c->addElement(dynamic_cast<QMofElement *>(element->clone()));
- if (tagOwner())
- c->setTagOwner(dynamic_cast<QMofElement *>(tagOwner()->clone()));
return c;
}
diff --git a/src/mof/qmoftag.h b/src/mof/qmoftag.h
index 76017056..c69b3a79 100644
--- a/src/mof/qmoftag.h
+++ b/src/mof/qmoftag.h
@@ -53,6 +53,7 @@ class Q_MOF_EXPORT QMofTag : public QMofElement
{
public:
explicit QMofTag(bool createQModelingObject = true);
+ virtual ~QMofTag();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmoftype.cpp b/src/mof/qmoftype.cpp
index 99ea1eb1..92740642 100644
--- a/src/mof/qmoftype.cpp
+++ b/src/mof/qmoftype.cpp
@@ -69,6 +69,14 @@ QMofType::QMofType() :
}
/*!
+ Destroys the QMofType.
+ */
+QMofType::~QMofType()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofType.
*/
QModelingElement *QMofType::clone() const
@@ -78,8 +86,6 @@ QModelingElement *QMofType::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (package())
- c->setPackage(dynamic_cast<QMofPackage *>(package()->clone()));
return c;
}
diff --git a/src/mof/qmoftype.h b/src/mof/qmoftype.h
index 34a85445..d5af9509 100644
--- a/src/mof/qmoftype.h
+++ b/src/mof/qmoftype.h
@@ -55,6 +55,8 @@ class QMofPackage;
class Q_MOF_EXPORT QMofType : public QMofPackageableElement
{
public:
+ virtual ~QMofType();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmoftypedelement.cpp b/src/mof/qmoftypedelement.cpp
index 6298452e..637c6ad5 100644
--- a/src/mof/qmoftypedelement.cpp
+++ b/src/mof/qmoftypedelement.cpp
@@ -67,6 +67,14 @@ QMofTypedElement::QMofTypedElement() :
}
/*!
+ Destroys the QMofTypedElement.
+ */
+QMofTypedElement::~QMofTypedElement()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofTypedElement.
*/
QModelingElement *QMofTypedElement::clone() const
@@ -76,8 +84,6 @@ QModelingElement *QMofTypedElement::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
return c;
}
diff --git a/src/mof/qmoftypedelement.h b/src/mof/qmoftypedelement.h
index 3614c82e..61c3c6d9 100644
--- a/src/mof/qmoftypedelement.h
+++ b/src/mof/qmoftypedelement.h
@@ -54,6 +54,8 @@ class QMofType;
class Q_MOF_EXPORT QMofTypedElement : public virtual QMofNamedElement
{
public:
+ virtual ~QMofTypedElement();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
// Owned attributes
diff --git a/src/mof/qmofuriextent.cpp b/src/mof/qmofuriextent.cpp
index ae8787a1..9c15fd09 100644
--- a/src/mof/qmofuriextent.cpp
+++ b/src/mof/qmofuriextent.cpp
@@ -53,6 +53,14 @@ QMofURIExtent::QMofURIExtent(bool createQModelingObject) :
_qModelingObject = qobject_cast<QModelingObject *>(new QMofURIExtentObject(this));
}
+/*!
+ Destroys the QMofURIExtent.
+ */
+QMofURIExtent::~QMofURIExtent()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
QModelingElement *QMofURIExtent::clone() const
{
QMofURIExtent *c = new QMofURIExtent;
diff --git a/src/mof/qmofuriextent.h b/src/mof/qmofuriextent.h
index f7ae8f69..4fc4a11b 100644
--- a/src/mof/qmofuriextent.h
+++ b/src/mof/qmofuriextent.h
@@ -55,6 +55,7 @@ class Q_MOF_EXPORT QMofURIExtent : public QMofExtent
{
public:
explicit QMofURIExtent(bool createQModelingObject = true);
+ virtual ~QMofURIExtent();
virtual QModelingElement *clone() const;
diff --git a/src/mof/qmofvaluespecification.cpp b/src/mof/qmofvaluespecification.cpp
index a9f85815..b7eea522 100644
--- a/src/mof/qmofvaluespecification.cpp
+++ b/src/mof/qmofvaluespecification.cpp
@@ -67,6 +67,14 @@ QMofValueSpecification::QMofValueSpecification()
}
/*!
+ Destroys the QMofValueSpecification.
+ */
+QMofValueSpecification::~QMofValueSpecification()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QMofValueSpecification.
*/
QModelingElement *QMofValueSpecification::clone() const
@@ -76,8 +84,6 @@ QModelingElement *QMofValueSpecification::clone() const
c->addOwnedComment(dynamic_cast<QMofComment *>(element->clone()));
c->setName(name());
c->setVisibility(visibility());
- if (type())
- c->setType(dynamic_cast<QMofType *>(type()->clone()));
return c;
}
diff --git a/src/mof/qmofvaluespecification.h b/src/mof/qmofvaluespecification.h
index a44166b9..b1cfbe79 100644
--- a/src/mof/qmofvaluespecification.h
+++ b/src/mof/qmofvaluespecification.h
@@ -53,6 +53,8 @@ QT_MODULE(QtMof)
class Q_MOF_EXPORT QMofValueSpecification : public QMofPackageableElement, public QMofTypedElement
{
public:
+ virtual ~QMofValueSpecification();
+
Q_DECL_HIDDEN virtual QModelingElement *clone() const;
diff --git a/src/saduseprofile/qsaduseprofileprocesscomponent.cpp b/src/saduseprofile/qsaduseprofileprocesscomponent.cpp
index 28a6ea9e..50e652e7 100644
--- a/src/saduseprofile/qsaduseprofileprocesscomponent.cpp
+++ b/src/saduseprofile/qsaduseprofileprocesscomponent.cpp
@@ -65,13 +65,19 @@ QSADuseProfileProcessComponent::QSADuseProfileProcessComponent(bool createQModel
}
/*!
+ Destroys the QSADuseProfileProcessComponent.
+ */
+QSADuseProfileProcessComponent::~QSADuseProfileProcessComponent()
+{
+ QModelingElement::deleteQModelingObject();
+}
+
+/*!
Returns a deep-copied clone of the QSADuseProfileProcessComponent.
*/
QModelingElement *QSADuseProfileProcessComponent::clone() const
{
QSADuseProfileProcessComponent *c = new QSADuseProfileProcessComponent;
- if (base_Component())
- c->setBase_Component(dynamic_cast<QUmlComponent *>(base_Component()->clone()));
return c;
}
diff --git a/src/saduseprofile/qsaduseprofileprocesscomponent.h b/src/saduseprofile/qsaduseprofileprocesscomponent.h
index 54230bd3..2512f3bf 100644
--- a/src/saduseprofile/qsaduseprofileprocesscomponent.h
+++ b/src/saduseprofile/qsaduseprofileprocesscomponent.h
@@ -55,6 +55,7 @@ class Q_SADUSEPROFILE_EXPORT QSADuseProfileProcessComponent : public QModelingEl
{
public:
explicit QSADuseProfileProcessComponent(bool createQModelingObject = true);
+ virtual ~QSADuseProfileProcessComponent();
virtual QModelingElement *clone() const;
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4197a886..2fa25521 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -4,4 +4,5 @@ SUBDIRS = \
qtumlcontainment \
qtumlprovidedrequiredinterfaces \
qtumlconnectortypeandcomponentparts \
- qtumlguardedcollection
+ qtumlguardedcollection \
+ qtmofguardedcollection
diff --git a/tests/auto/qtmofguardedcollection/qtmofguardedcollection.pro b/tests/auto/qtmofguardedcollection/qtmofguardedcollection.pro
new file mode 100644
index 00000000..24c40c7a
--- /dev/null
+++ b/tests/auto/qtmofguardedcollection/qtmofguardedcollection.pro
@@ -0,0 +1,7 @@
+CONFIG += testcase
+TARGET = tst_qtmofguardedcollection
+
+QT = modeling mof testlib
+
+SOURCES += \
+ tst_qtmofguardedcollection.cpp \
diff --git a/tests/auto/qtmofguardedcollection/tst_qtmofguardedcollection.cpp b/tests/auto/qtmofguardedcollection/tst_qtmofguardedcollection.cpp
new file mode 100644
index 00000000..f5af9b63
--- /dev/null
+++ b/tests/auto/qtmofguardedcollection/tst_qtmofguardedcollection.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtMof module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+
+#include <QtMof/QMofComment>
+
+class TestQtMofGuardedCollection : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void qtmofguardedcollection();
+};
+
+void TestQtMofGuardedCollection::qtmofguardedcollection()
+{
+ QMofComment *c1 = new QMofComment;
+ c1->asQModelingObject()->setObjectName("c1");
+ QMofComment *c2 = new QMofComment;
+ c2->asQModelingObject()->setObjectName("c2");
+
+ c1->addOwnedComment(c2);
+
+ QCOMPARE(c1->ownedComments().size(), 1);
+
+ delete c2;
+
+ QCOMPARE(c1->ownedComments().size(), 0);
+
+ delete c1;
+}
+
+QTEST_MAIN(TestQtMofGuardedCollection)
+#include "tst_qtmofguardedcollection.moc"
+