diff options
| author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-25 09:33:35 -0300 |
|---|---|---|
| committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-25 14:34:42 +0200 |
| commit | ea1a2ed03ac0880ef969e01598016de0581fbd41 (patch) | |
| tree | 57bc0b889a3fbb33f72019759940d945e72d4873 /src/uml/qumlstringexpression.cpp | |
| parent | d1ee48c7b8f3032f4806522417a2bfdcc802bcc3 (diff) | |
Provide new UML metamodel implementation
- QtWrappedObject is going to be replaced by QtModeling
- DuSE-MT broken until refactoring finishes
Change-Id: I628704ea9dac715d672638a2a9fee2071055dd92
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlstringexpression.cpp')
| -rw-r--r-- | src/uml/qumlstringexpression.cpp | 192 |
1 files changed, 17 insertions, 175 deletions
diff --git a/src/uml/qumlstringexpression.cpp b/src/uml/qumlstringexpression.cpp index 3f3aaa39..528bbfcb 100644 --- a/src/uml/qumlstringexpression.cpp +++ b/src/uml/qumlstringexpression.cpp @@ -41,8 +41,6 @@ #include "qumlstringexpression.h" #include "qumlstringexpression_p.h" -#include <QtWrappedObjects/QtWrappedObjectsNamespace> - QT_BEGIN_NAMESPACE QUmlStringExpressionPrivate::QUmlStringExpressionPrivate() : @@ -50,10 +48,6 @@ QUmlStringExpressionPrivate::QUmlStringExpressionPrivate() : { } -QUmlStringExpressionPrivate::~QUmlStringExpressionPrivate() -{ -} - /*! \class QUmlStringExpression @@ -62,208 +56,56 @@ QUmlStringExpressionPrivate::~QUmlStringExpressionPrivate() \brief An expression that specifies a string value that is derived by concatenating a set of sub string expressions, some of which might be template parameters. */ -QUmlStringExpression::QUmlStringExpression(QWrappedObject *wrapper, QWrappedObject *parent) : - QWrappedObject(*new QUmlStringExpressionPrivate, wrapper, parent), - _wrappedUmlExpression(new QUmlExpression(this)), - _wrappedUmlTemplateableElement(new QUmlTemplateableElement(this)) -{ - setPropertyData(); -} - -QUmlStringExpression::QUmlStringExpression(QUmlStringExpressionPrivate &dd, QWrappedObject *wrapper, QWrappedObject *parent) : - QWrappedObject(dd, wrapper, parent), - _wrappedUmlExpression(new QUmlExpression(this)), - _wrappedUmlTemplateableElement(new QUmlTemplateableElement(this)) -{ - setPropertyData(); -} - -QUmlStringExpression::~QUmlStringExpression() -{ -} - -// --------------------------------------------------------------- -// ASSOCIATION ENDS FROM AGGREGATED QUmlElement -// --------------------------------------------------------------- - -/*! - The Elements owned by this element. - */ -QSet<QUmlElement *> QUmlStringExpression::ownedElements() const -{ - return (qwrappedobject_cast<const QUmlElement *>(this))->ownedElements(); -} - -/*! - The Element that owns this element. - */ -QUmlElement *QUmlStringExpression::owner() const -{ - return (qwrappedobject_cast<const QUmlElement *>(this))->owner(); -} - -/*! - The Comments owned by this element. - */ -QSet<QUmlComment *> QUmlStringExpression::ownedComments() const -{ - return (qwrappedobject_cast<const QUmlElement *>(this))->ownedComments(); -} - -void QUmlStringExpression::addOwnedComment(QUmlComment *ownedComment) -{ - (qwrappedobject_cast<QUmlElement *>(this))->addOwnedComment(ownedComment); -} - -void QUmlStringExpression::removeOwnedComment(QUmlComment *ownedComment) -{ - (qwrappedobject_cast<QUmlElement *>(this))->removeOwnedComment(ownedComment); -} - -// --------------------------------------------------------------- -// ASSOCIATION ENDS FROM AGGREGATED QUmlTemplateableElement -// --------------------------------------------------------------- - -/*! - The optional template signature specifying the formal template parameters. - */ -QUmlTemplateSignature *QUmlStringExpression::ownedTemplateSignature() const -{ - return (qwrappedobject_cast<const QUmlTemplateableElement *>(this))->ownedTemplateSignature(); -} - -void QUmlStringExpression::setOwnedTemplateSignature(QUmlTemplateSignature *ownedTemplateSignature) -{ - (qwrappedobject_cast<QUmlTemplateableElement *>(this))->setOwnedTemplateSignature(ownedTemplateSignature); -} - -/*! - The optional bindings from this element to templates. - */ -QSet<QUmlTemplateBinding *> QUmlStringExpression::templateBindings() const -{ - return (qwrappedobject_cast<const QUmlTemplateableElement *>(this))->templateBindings(); -} - -void QUmlStringExpression::addTemplateBinding(QUmlTemplateBinding *templateBinding) +QUmlStringExpression::QUmlStringExpression(bool create_d_ptr) : + QUmlExpression(false), + QUmlTemplateableElement(false) { - (qwrappedobject_cast<QUmlTemplateableElement *>(this))->addTemplateBinding(templateBinding); + if (create_d_ptr) + set_d_ptr(new QUmlStringExpressionPrivate); } -void QUmlStringExpression::removeTemplateBinding(QUmlTemplateBinding *templateBinding) -{ - (qwrappedobject_cast<QUmlTemplateableElement *>(this))->removeTemplateBinding(templateBinding); -} - -// --------------------------------------------------------------- -// ASSOCIATION ENDS FROM QUmlStringExpression -// --------------------------------------------------------------- +// Owned attributes /*! The string expression of which this expression is a substring. */ QUmlStringExpression *QUmlStringExpression::owningExpression() const { - // This is a read-write association end - - Q_D(const QUmlStringExpression); - return d->owningExpression; + return 0; } void QUmlStringExpression::setOwningExpression(QUmlStringExpression *owningExpression) { - // This is a read-write association end - - Q_D(QUmlStringExpression); - if (d->owningExpression != owningExpression) { - // Adjust opposite property - if (d->owningExpression) - d->owningExpression->removeSubExpression(this); - - d->owningExpression = owningExpression; - - // Adjust subsetted property(ies) - (qwrappedobject_cast<QUmlElementPrivate *>(d))->setOwner(qwrappedobject_cast<QUmlElement *>(owningExpression)); - - // Adjust opposite property - if (owningExpression) - owningExpression->addSubExpression(this); - } + Q_UNUSED(owningExpression); } /*! The StringExpressions that constitute this StringExpression. */ -QSet<QUmlStringExpression *> QUmlStringExpression::subExpressions() const +QSet<QUmlStringExpression *> QUmlStringExpression::subExpression() const { - // This is a read-write association end - - Q_D(const QUmlStringExpression); - return d->subExpressions; + return QSet<QUmlStringExpression *>(); } -void QUmlStringExpression::addSubExpression(QUmlStringExpression *subExpression) +void QUmlStringExpression::addSubExpression(QSet<QUmlStringExpression *> subExpression) { - // This is a read-write association end - - Q_D(QUmlStringExpression); - if (!d->subExpressions.contains(subExpression)) { - d->subExpressions.insert(subExpression); - - // Adjust subsetted property(ies) - (qwrappedobject_cast<QUmlElementPrivate *>(d))->addOwnedElement(qwrappedobject_cast<QUmlElement *>(subExpression)); - - // Adjust opposite property - subExpression->setOwningExpression(this); - } + Q_UNUSED(subExpression); } -void QUmlStringExpression::removeSubExpression(QUmlStringExpression *subExpression) +void QUmlStringExpression::removeSubExpression(QSet<QUmlStringExpression *> subExpression) { - // This is a read-write association end - - Q_D(QUmlStringExpression); - if (d->subExpressions.contains(subExpression)) { - d->subExpressions.remove(subExpression); - - // Adjust subsetted property(ies) - (qwrappedobject_cast<QUmlElementPrivate *>(d))->removeOwnedElement(qwrappedobject_cast<QUmlElement *>(subExpression)); - - // Adjust opposite property - subExpression->setOwningExpression(0); - } + Q_UNUSED(subExpression); } +// Operations + /*! The query stringValue() returns the string that concatenates, in order, all the component string literals of all the subexpressions that are part of the StringExpression. */ QString QUmlStringExpression::stringValue() const { - qWarning("QUmlStringExpression::stringValue: operation to be implemented"); - - return QString(); // change here to your derived return -} - -void QUmlStringExpression::setPropertyData() -{ - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::AggregationRole] = QString::fromLatin1("none"); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::IsDerivedUnionRole] = false; - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::DocumentationRole] = QString::fromLatin1("The string expression of which this expression is a substring."); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::RedefinedPropertiesRole] = QString::fromLatin1(""); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::SubsettedPropertiesRole] = QString::fromLatin1("QUmlElement::owner"); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("owningExpression")][QtWrappedObjects::OppositeEndRole] = QString::fromLatin1("QUmlStringExpression::subExpression"); - - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::AggregationRole] = QString::fromLatin1("composite"); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::IsDerivedUnionRole] = false; - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::DocumentationRole] = QString::fromLatin1("The StringExpressions that constitute this StringExpression."); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::RedefinedPropertiesRole] = QString::fromLatin1(""); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::SubsettedPropertiesRole] = QString::fromLatin1("QUmlElement::ownedElements"); - QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlStringExpression")][QString::fromLatin1("subExpressions")][QtWrappedObjects::OppositeEndRole] = QString::fromLatin1("QUmlStringExpression::owningExpression"); - - QWrappedObject::setPropertyData(); + return QString (); } QT_END_NAMESPACE -#include "moc_qumlstringexpression.cpp" - |
