diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-25 16:07:06 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-25 21:06:07 +0200 |
commit | 1c770ad764a39ce0ad40913c1c4bd72bd43710a9 (patch) | |
tree | e6f7789ee1b007e081c7f45e385135b6e8e37bd2 /src/uml/qumlconstraint.cpp | |
parent | ea1a2ed03ac0880ef969e01598016de0581fbd41 (diff) |
Add handling of derived properties in artifact generation from xmi
Change-Id: I3764f41fd6a727f1a09daed9fc82c9fedf8ba5af
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlconstraint.cpp')
-rw-r--r-- | src/uml/qumlconstraint.cpp | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/src/uml/qumlconstraint.cpp b/src/uml/qumlconstraint.cpp index 46519d30..fe157f25 100644 --- a/src/uml/qumlconstraint.cpp +++ b/src/uml/qumlconstraint.cpp @@ -68,24 +68,37 @@ QUmlConstraint::QUmlConstraint(bool create_d_ptr) : set_d_ptr(new QUmlConstraintPrivate); } -// Owned attributes +// OWNED ATTRIBUTES /*! The ordered set of Elements referenced by this Constraint. */ QList<QUmlElement *> QUmlConstraint::constrainedElement() const { - return QList<QUmlElement *>(); + // This is a read-write association end + + QM_D(const QUmlConstraint); + return d->constrainedElement; } -void QUmlConstraint::addConstrainedElement(QList<QUmlElement *> constrainedElement) +void QUmlConstraint::addConstrainedElement(QUmlElement *constrainedElement) { - Q_UNUSED(constrainedElement); + // This is a read-write association end + + QM_D(QUmlConstraint); + if (!d->constrainedElement.contains(constrainedElement)) { + d->constrainedElement.append(constrainedElement); + } } -void QUmlConstraint::removeConstrainedElement(QList<QUmlElement *> constrainedElement) +void QUmlConstraint::removeConstrainedElement(QUmlElement *constrainedElement) { - Q_UNUSED(constrainedElement); + // This is a read-write association end + + QM_D(QUmlConstraint); + if (d->constrainedElement.contains(constrainedElement)) { + d->constrainedElement.removeAll(constrainedElement); + } } /*! @@ -93,12 +106,20 @@ void QUmlConstraint::removeConstrainedElement(QList<QUmlElement *> constrainedEl */ QUmlNamespace *QUmlConstraint::context() const { - return 0; + // This is a read-write association end + + QM_D(const QUmlConstraint); + return d->context; } void QUmlConstraint::setContext(QUmlNamespace *context) { - Q_UNUSED(context); + // This is a read-write association end + + QM_D(QUmlConstraint); + if (d->context != context) { + d->context = context; + } } /*! @@ -106,12 +127,20 @@ void QUmlConstraint::setContext(QUmlNamespace *context) */ QUmlValueSpecification *QUmlConstraint::specification() const { - return 0; + // This is a read-write association end + + QM_D(const QUmlConstraint); + return d->specification; } void QUmlConstraint::setSpecification(QUmlValueSpecification *specification) { - Q_UNUSED(specification); + // This is a read-write association end + + QM_D(QUmlConstraint); + if (d->specification != specification) { + d->specification = specification; + } } QT_END_NAMESPACE |