summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlslot.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-08-25 16:07:06 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-08-25 21:06:07 +0200
commit1c770ad764a39ce0ad40913c1c4bd72bd43710a9 (patch)
treee6f7789ee1b007e081c7f45e385135b6e8e37bd2 /src/uml/qumlslot.cpp
parentea1a2ed03ac0880ef969e01598016de0581fbd41 (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/qumlslot.cpp')
-rw-r--r--src/uml/qumlslot.cpp49
1 files changed, 39 insertions, 10 deletions
diff --git a/src/uml/qumlslot.cpp b/src/uml/qumlslot.cpp
index 0de83902..bb8ccc1f 100644
--- a/src/uml/qumlslot.cpp
+++ b/src/uml/qumlslot.cpp
@@ -68,19 +68,27 @@ QUmlSlot::QUmlSlot(bool create_d_ptr) :
set_d_ptr(new QUmlSlotPrivate);
}
-// Owned attributes
+// OWNED ATTRIBUTES
/*!
The structural feature that specifies the values that may be held by the slot.
*/
QUmlStructuralFeature *QUmlSlot::definingFeature() const
{
- return 0;
+ // This is a read-write association end
+
+ QM_D(const QUmlSlot);
+ return d->definingFeature;
}
void QUmlSlot::setDefiningFeature(QUmlStructuralFeature *definingFeature)
{
- Q_UNUSED(definingFeature);
+ // This is a read-write association end
+
+ QM_D(QUmlSlot);
+ if (d->definingFeature != definingFeature) {
+ d->definingFeature = definingFeature;
+ }
}
/*!
@@ -88,12 +96,20 @@ void QUmlSlot::setDefiningFeature(QUmlStructuralFeature *definingFeature)
*/
QUmlInstanceSpecification *QUmlSlot::owningInstance() const
{
- return 0;
+ // This is a read-write association end
+
+ QM_D(const QUmlSlot);
+ return d->owningInstance;
}
void QUmlSlot::setOwningInstance(QUmlInstanceSpecification *owningInstance)
{
- Q_UNUSED(owningInstance);
+ // This is a read-write association end
+
+ QM_D(QUmlSlot);
+ if (d->owningInstance != owningInstance) {
+ d->owningInstance = owningInstance;
+ }
}
/*!
@@ -101,17 +117,30 @@ void QUmlSlot::setOwningInstance(QUmlInstanceSpecification *owningInstance)
*/
QList<QUmlValueSpecification *> QUmlSlot::value() const
{
- return QList<QUmlValueSpecification *>();
+ // This is a read-write association end
+
+ QM_D(const QUmlSlot);
+ return d->value;
}
-void QUmlSlot::addValue(QList<QUmlValueSpecification *> value)
+void QUmlSlot::addValue(QUmlValueSpecification *value)
{
- Q_UNUSED(value);
+ // This is a read-write association end
+
+ QM_D(QUmlSlot);
+ if (!d->value.contains(value)) {
+ d->value.append(value);
+ }
}
-void QUmlSlot::removeValue(QList<QUmlValueSpecification *> value)
+void QUmlSlot::removeValue(QUmlValueSpecification *value)
{
- Q_UNUSED(value);
+ // This is a read-write association end
+
+ QM_D(QUmlSlot);
+ if (d->value.contains(value)) {
+ d->value.removeAll(value);
+ }
}
QT_END_NAMESPACE