summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlparameterableelement.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-08-29 00:21:34 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-08-29 15:36:14 +0200
commit15f1561dff2533d45f513ae885b4ffe748af5e54 (patch)
tree25ce0de84e2641c427ef27119e4b3a1b2b9163b5 /src/uml/qumlparameterableelement.cpp
parentf3f02b513ecc79d1ce7a108664ed772cacc60766 (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/qumlparameterableelement.cpp')
-rw-r--r--src/uml/qumlparameterableelement.cpp73
1 files changed, 12 insertions, 61 deletions
diff --git a/src/uml/qumlparameterableelement.cpp b/src/uml/qumlparameterableelement.cpp
index 30291706..778b4b44 100644
--- a/src/uml/qumlparameterableelement.cpp
+++ b/src/uml/qumlparameterableelement.cpp
@@ -39,97 +39,48 @@
**
****************************************************************************/
#include "qumlparameterableelement.h"
-#include "private/qmodelingobject_p.h"
#include <QtUml/QUmlTemplateParameter>
QT_BEGIN_NAMESPACE
-/*!
- \class QUmlParameterableElement
-
- \inmodule QtUml
-
- \brief A parameterable element is an element that can be exposed as a formal template parameter for a template, or specified as an actual parameter in a binding of a template.
- */
-
-QUmlParameterableElement::QUmlParameterableElement() :
- _owningTemplateParameter(0),
- _templateParameter(0)
+QUmlParameterableElement::QUmlParameterableElement(QObject *parent) :
+ QObject(parent)
{
- d_ptr->object.setProperty("owningTemplateParameter", QVariant::fromValue((QUmlTemplateParameter *)(0)));
- d_ptr->object.setProperty("templateParameter", QVariant::fromValue((QUmlTemplateParameter *)(0)));
}
-// OWNED ATTRIBUTES
+// Owned attributes
-/*!
- The formal template parameter that owns this element.
- */
QUmlTemplateParameter *QUmlParameterableElement::owningTemplateParameter() const
{
- // This is a read-write association end
-
- return _owningTemplateParameter;
+ return reinterpret_cast<QUmlTemplateParameter *>(_owningTemplateParameter);
}
void QUmlParameterableElement::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter)
{
- // This is a read-write association end
-
- if (_owningTemplateParameter != owningTemplateParameter) {
- // Adjust subsetted properties
-
- _owningTemplateParameter = owningTemplateParameter;
-
- // Adjust subsetted properties
- setTemplateParameter(owningTemplateParameter);
- setOwner(owningTemplateParameter);
- }
+ UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter);
}
-/*!
- The template parameter that exposes this element as a formal parameter.
- */
QUmlTemplateParameter *QUmlParameterableElement::templateParameter() const
{
- // This is a read-write association end
-
- return _templateParameter;
+ return reinterpret_cast<QUmlTemplateParameter *>(_templateParameter);
}
void QUmlParameterableElement::setTemplateParameter(QUmlTemplateParameter *templateParameter)
{
- // This is a read-write association end
-
- if (_templateParameter != templateParameter) {
- _templateParameter = templateParameter;
- }
+ UmlParameterableElement::setTemplateParameter(templateParameter);
}
-// OPERATIONS
+// Operations
-/*!
- The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. Subclasses should override this operation to specify different compatibility constraints.
- */
-bool QUmlParameterableElement::isCompatibleWith(
- QUmlParameterableElement *p) const
+bool QUmlParameterableElement::isCompatibleWith(QUmlParameterableElement *p) const
{
- qWarning("QUmlParameterableElement::isCompatibleWith(): to be implemented (operation)");
-
- Q_UNUSED(p);
- return bool ();
+ return UmlParameterableElement::isCompatibleWith(p);
}
-/*!
- The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter.
- */
-bool QUmlParameterableElement::isTemplateParameter(
- ) const
+bool QUmlParameterableElement::isTemplateParameter() const
{
- qWarning("QUmlParameterableElement::isTemplateParameter(): to be implemented (operation)");
-
- return bool ();
+ return UmlParameterableElement::isTemplateParameter();
}
QT_END_NAMESPACE