diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-29 00:21:34 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-08-29 15:36:14 +0200 |
commit | 15f1561dff2533d45f513ae885b4ffe748af5e54 (patch) | |
tree | 25ce0de84e2641c427ef27119e4b3a1b2b9163b5 /src/uml/qumlslot.cpp | |
parent | f3f02b513ecc79d1ce7a108664ed772cacc60766 (diff) |
New UML metamodel implementation almost done
Still missing:
- Forward methods for inherited properties and operations
- Auto-removal of deleted composite properties
- Moving documentation from internal do QObject-based classes
Change-Id: I2676e48c53d9ad4cdc6333c28e1a912d4e72cdd0
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlslot.cpp')
-rw-r--r-- | src/uml/qumlslot.cpp | 79 |
1 files changed, 12 insertions, 67 deletions
diff --git a/src/uml/qumlslot.cpp b/src/uml/qumlslot.cpp index 96fcc407..8dd8005b 100644 --- a/src/uml/qumlslot.cpp +++ b/src/uml/qumlslot.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ #include "qumlslot.h" -#include "private/qmodelingobject_p.h" #include <QtUml/QUmlInstanceSpecification> #include <QtUml/QUmlStructuralFeature> @@ -47,100 +46,46 @@ QT_BEGIN_NAMESPACE -/*! - \class QUmlSlot - - \inmodule QtUml - - \brief A slot specifies that an entity modeled by an instance specification has a value or values for a specific structural feature. - */ - -QUmlSlot::QUmlSlot() : - _definingFeature(0), - _owningInstance(0) +QUmlSlot::QUmlSlot(QObject *parent) : + QObject(parent) { - d_ptr->object.setProperty("definingFeature", QVariant::fromValue((QUmlStructuralFeature *)(0))); - d_ptr->object.setProperty("owningInstance", QVariant::fromValue((QUmlInstanceSpecification *)(0))); - d_ptr->object.setProperty("value", QVariant::fromValue(&_value)); } -// OWNED ATTRIBUTES +// Owned attributes -/*! - The structural feature that specifies the values that may be held by the slot. - */ QUmlStructuralFeature *QUmlSlot::definingFeature() const { - // This is a read-write association end - - return _definingFeature; + return reinterpret_cast<QUmlStructuralFeature *>(_definingFeature); } void QUmlSlot::setDefiningFeature(QUmlStructuralFeature *definingFeature) { - // This is a read-write association end - - if (_definingFeature != definingFeature) { - _definingFeature = definingFeature; - } + UmlSlot::setDefiningFeature(definingFeature); } -/*! - The instance specification that owns this slot. - */ QUmlInstanceSpecification *QUmlSlot::owningInstance() const { - // This is a read-write association end - - return _owningInstance; + return reinterpret_cast<QUmlInstanceSpecification *>(_owningInstance); } void QUmlSlot::setOwningInstance(QUmlInstanceSpecification *owningInstance) { - // This is a read-write association end - - if (_owningInstance != owningInstance) { - // Adjust subsetted properties - - _owningInstance = owningInstance; - - // Adjust subsetted properties - setOwner(owningInstance); - } + UmlSlot::setOwningInstance(owningInstance); } -/*! - The value or values corresponding to the defining feature for the owning instance specification. - */ const QList<QUmlValueSpecification *> QUmlSlot::value() const { - // This is a read-write association end - - return _value; + return *(reinterpret_cast<const QList<QUmlValueSpecification *> *>(&_value)); } -void QUmlSlot::addValue(QUmlValueSpecification *value) +void QUmlSlot::addValue(UmlValueSpecification *value) { - // This is a read-write association end - - if (!_value.contains(value)) { - _value.append(value); - - // Adjust subsetted properties - addOwnedElement(value); - } + UmlSlot::addValue(value); } -void QUmlSlot::removeValue(QUmlValueSpecification *value) +void QUmlSlot::removeValue(UmlValueSpecification *value) { - // This is a read-write association end - - if (_value.contains(value)) { - _value.removeAll(value); - - // Adjust subsetted properties - removeOwnedElement(value); - } + UmlSlot::removeValue(value); } QT_END_NAMESPACE |