summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlliteralnull.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlliteralnull.cpp')
-rw-r--r--src/uml/qumlliteralnull.cpp318
1 files changed, 16 insertions, 302 deletions
diff --git a/src/uml/qumlliteralnull.cpp b/src/uml/qumlliteralnull.cpp
index 1222b6ba..d8b7edc2 100644
--- a/src/uml/qumlliteralnull.cpp
+++ b/src/uml/qumlliteralnull.cpp
@@ -40,266 +40,39 @@
****************************************************************************/
#include "qumlliteralnull.h"
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlParameterableElement>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlTemplateParameter>
-#include <QtUml/QUmlType>
-
-QT_BEGIN_NAMESPACE
+#include "private/qumlliteralnullobject_p.h"
/*!
- \class UmlLiteralNull
+ \class QUmlLiteralNull
\inmodule QtUml
\brief A literal null specifies the lack of a value.
*/
-
-QUmlLiteralNull::QUmlLiteralNull(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlLiteralNull::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlLiteralNull::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlLiteralNull::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlLiteralNull::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlLiteralNull::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlLiteralNull::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlLiteralNull::namespace_() const
-{
- return reinterpret_cast<QUmlNamespace *>(_namespace_);
-}
-
-/*!
- A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself.
- */
-QString QUmlLiteralNull::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-// OWNED ATTRIBUTES [TypedElement]
-
-/*!
- This information is derived from the return result for this Operation.The type of the TypedElement.
- */
-QUmlType *QUmlLiteralNull::type() const
-{
- return reinterpret_cast<QUmlType *>(_type);
-}
-
-// OWNED ATTRIBUTES [ParameterableElement]
-
-/*!
- The formal template parameter that owns this element.
- */
-QUmlTemplateParameter *QUmlLiteralNull::owningTemplateParameter() const
-{
- return reinterpret_cast<QUmlTemplateParameter *>(_owningTemplateParameter);
-}
-
-/*!
- The template parameter that exposes this element as a formal parameter.
- */
-QUmlTemplateParameter *QUmlLiteralNull::templateParameter() const
-{
- return reinterpret_cast<QUmlTemplateParameter *>(_templateParameter);
-}
-
-// OWNED ATTRIBUTES [PackageableElement]
-
-/*!
- Indicates that packageable elements must always have a visibility, i.e., visibility is not optional.
- */
-QtUml::VisibilityKind QUmlLiteralNull::visibility() const
+QUmlLiteralNull::QUmlLiteralNull(bool createQObject)
{
- return _visibility;
+ if (createQObject)
+ _qObject = new QUmlLiteralNullObject(this);
}
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlLiteralNull::allOwnedElements() const
-{
- QSet<QUmlElement *> r;
- foreach (UmlElement *element, UmlElement::allOwnedElements())
- r.insert(reinterpret_cast<QUmlElement *>(element));
- return r;
-}
-
-/*!
- The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation.
- */
-bool QUmlLiteralNull::mustBeOwned() const
+QUmlLiteralNull::~QUmlLiteralNull()
{
- return UmlElement::mustBeOwned();
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-// OPERATIONS [NamedElement]
-
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlLiteralNull::allNamespaces() const
-{
- QList<QUmlNamespace *> r;
- foreach (UmlNamespace *element, UmlNamedElement::allNamespaces())
- r.append(reinterpret_cast<QUmlNamespace *>(element));
- return r;
-}
-
-/*!
- The query allOwningPackages() returns all the directly or indirectly owning packages.
- */
-QSet<QUmlPackage *> QUmlLiteralNull::allOwningPackages() const
-{
- QSet<QUmlPackage *> r;
- foreach (UmlPackage *element, UmlNamedElement::allOwningPackages())
- r.insert(reinterpret_cast<QUmlPackage *>(element));
- return r;
-}
-
-/*!
- The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have unrelated types or (b) they have related types but different names.
- */
-bool QUmlLiteralNull::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
-}
-
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlLiteralNull::separator() const
-{
- return UmlNamedElement::separator();
-}
-
-// OPERATIONS [ParameterableElement]
-
-/*!
- The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter.
- */
-bool QUmlLiteralNull::isTemplateParameter() const
-{
- return UmlParameterableElement::isTemplateParameter();
-}
-
-// OPERATIONS [ValueSpecification]
-
-/*!
- The query booleanValue() gives a single Boolean value when one can be computed.
- */
-bool QUmlLiteralNull::booleanValue() const
-{
- return UmlValueSpecification::booleanValue();
-}
-
-/*!
- The query integerValue() gives a single Integer value when one can be computed.
- */
-int QUmlLiteralNull::integerValue() const
-{
- return UmlValueSpecification::integerValue();
-}
-
-/*!
- 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. In addition, for ValueSpecification, the type must be conformant with the type of the specified parameterable element.
- */
-bool QUmlLiteralNull::isCompatibleWith(QUmlParameterableElement *p) const
-{
- return UmlValueSpecification::isCompatibleWith(p);
-}
-
-/*!
- The query realValue() gives a single Real value when one can be computed.
- */
-double QUmlLiteralNull::realValue() const
-{
- return UmlValueSpecification::realValue();
-}
-
-/*!
- The query stringValue() gives a single String value when one can be computed.
- */
-QString QUmlLiteralNull::stringValue() const
-{
- return UmlValueSpecification::stringValue();
-}
-
-/*!
- The query unlimitedValue() gives a single UnlimitedNatural value when one can be computed.
- */
-int QUmlLiteralNull::unlimitedValue() const
-{
- return UmlValueSpecification::unlimitedValue();
-}
-
-// OPERATIONS [LiteralNull]
+// OPERATIONS
/*!
The query isComputable() is redefined to be true.
*/
bool QUmlLiteralNull::isComputable() const
{
- return UmlLiteralNull::isComputable();
+ qWarning("UmlLiteralNull::isComputable(): to be implemented (operation)");
+
+ return bool ();
}
/*!
@@ -307,67 +80,8 @@ bool QUmlLiteralNull::isComputable() const
*/
bool QUmlLiteralNull::isNull() const
{
- return UmlLiteralNull::isNull();
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
+ qWarning("UmlLiteralNull::isNull(): to be implemented (operation)");
-void QUmlLiteralNull::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
+ return bool ();
}
-void QUmlLiteralNull::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlLiteralNull::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlLiteralNull::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlLiteralNull::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlLiteralNull::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-// SLOTS FOR OWNED ATTRIBUTES [TypedElement]
-
-void QUmlLiteralNull::setType(QUmlType *type)
-{
- UmlTypedElement::setType(type);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ParameterableElement]
-
-void QUmlLiteralNull::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter)
-{
- UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter);
-}
-
-void QUmlLiteralNull::setTemplateParameter(QUmlTemplateParameter *templateParameter)
-{
- UmlParameterableElement::setTemplateParameter(templateParameter);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [PackageableElement]
-
-void QUmlLiteralNull::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlPackageableElement::setVisibility(visibility);
-}
-
-QT_END_NAMESPACE
-