summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlartifact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlartifact.cpp')
-rw-r--r--src/uml/qumlartifact.cpp939
1 files changed, 123 insertions, 816 deletions
diff --git a/src/uml/qumlartifact.cpp b/src/uml/qumlartifact.cpp
index 493ca132..4394a900 100644
--- a/src/uml/qumlartifact.cpp
+++ b/src/uml/qumlartifact.cpp
@@ -40,911 +40,218 @@
****************************************************************************/
#include "qumlartifact.h"
-#include <QtUml/QUmlClassifier>
-#include <QtUml/QUmlClassifierTemplateParameter>
-#include <QtUml/QUmlCollaborationUse>
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlConstraint>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlElementImport>
-#include <QtUml/QUmlFeature>
-#include <QtUml/QUmlGeneralization>
-#include <QtUml/QUmlGeneralizationSet>
+#include "private/qumlartifactobject_p.h"
+
#include <QtUml/QUmlManifestation>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlPackageableElement>
-#include <QtUml/QUmlPackageImport>
-#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlRedefinableTemplateSignature>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlSubstitution>
-#include <QtUml/QUmlTemplateBinding>
-#include <QtUml/QUmlTemplateParameter>
-#include <QtUml/QUmlTemplateSignature>
-#include <QtUml/QUmlType>
-#include <QtUml/QUmlUseCase>
-
-QT_BEGIN_NAMESPACE
/*!
- \class UmlArtifact
+ \class QUmlArtifact
\inmodule QtUml
\brief An artifact is the source of a deployment to a node.An artifact is the specification of a physical piece of information that is used or produced by a software development process, or by deployment and operation of a system. Examples of artifacts include model files, source files, scripts, and binary executable files, a table in a database system, a development deliverable, or a word-processing document, a mail message.
*/
-
-QUmlArtifact::QUmlArtifact(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlArtifact::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlArtifact::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlArtifact::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlArtifact::clientDependency() const
+QUmlArtifact::QUmlArtifact(bool createQObject)
{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
+ if (createQObject)
+ _qObject = new QUmlArtifactObject(this);
}
-/*!
- The name of the NamedElement.
- */
-QString QUmlArtifact::name() const
+QUmlArtifact::~QUmlArtifact()
{
- return _name;
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlArtifact::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlArtifact::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 QUmlArtifact::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-// OWNED ATTRIBUTES [Namespace]
-
-/*!
- References the ElementImports owned by the Namespace.
- */
-const QSet<QUmlElementImport *> QUmlArtifact::elementImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlElementImport *> *>(&_elementImport));
-}
-
-/*!
- References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports.
- */
-const QSet<QUmlPackageableElement *> QUmlArtifact::importedMember() const
-{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::importedMember())
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
-}
-
-/*!
- A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.
- */
-const QSet<QUmlNamedElement *> QUmlArtifact::member() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_member));
-}
-
-/*!
- A collection of NamedElements owned by the Namespace.
- */
-const QSet<QUmlNamedElement *> QUmlArtifact::ownedMember() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_ownedMember));
-}
-
-/*!
- Specifies a set of Constraints owned by this Namespace.
- */
-const QSet<QUmlConstraint *> QUmlArtifact::ownedRule() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_ownedRule));
-}
-
-/*!
- References the PackageImports owned by the Namespace.
- */
-const QSet<QUmlPackageImport *> QUmlArtifact::packageImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlPackageImport *> *>(&_packageImport));
-}
-
-// OWNED ATTRIBUTES [ParameterableElement]
-
-/*!
- The formal template parameter that owns this element.
- */
-QUmlTemplateParameter *QUmlArtifact::owningTemplateParameter() const
-{
- return reinterpret_cast<QUmlTemplateParameter *>(_owningTemplateParameter);
-}
-// OWNED ATTRIBUTES [PackageableElement]
-
-/*!
- Indicates that packageable elements must always have a visibility, i.e., visibility is not optional.
- */
-QtUml::VisibilityKind QUmlArtifact::visibility() const
-{
- return _visibility;
-}
-
-// OWNED ATTRIBUTES [Type]
-
-/*!
- Specifies the owning package of this classifier, if any.
- */
-QUmlPackage *QUmlArtifact::package() const
-{
- return reinterpret_cast<QUmlPackage *>(_package);
-}
-
-// OWNED ATTRIBUTES [RedefinableElement]
-
-/*!
- Indicates whether it is possible to further redefine a RedefinableElement. If the value is true, then it is not possible to further redefine the RedefinableElement. Note that this property is preserved through package merge operations; that is, the capability to redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in the resulting RedefinableElement of a package merge operation where a RedefinableElement with isLeaf=false is merged with a matching RedefinableElement with isLeaf=true: the resulting RedefinableElement will have isLeaf=false. Default value is false.
- */
-bool QUmlArtifact::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlArtifact::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlArtifact::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [TemplateableElement]
-
-/*!
- The optional bindings from this element to templates.
- */
-const QSet<QUmlTemplateBinding *> QUmlArtifact::templateBinding() const
-{
- return *(reinterpret_cast<const QSet<QUmlTemplateBinding *> *>(&_templateBinding));
-}
-
-// OWNED ATTRIBUTES [Classifier]
-
-/*!
- Refers to all of the Properties that are direct (i.e. not inherited or imported) attributes of the classifier.
- */
-const QSet<QUmlProperty *> QUmlArtifact::attribute() const
-{
- return *(reinterpret_cast<const QSet<QUmlProperty *> *>(&_attribute));
-}
-
-/*!
- References the collaboration uses owned by the classifier.
- */
-const QSet<QUmlCollaborationUse *> QUmlArtifact::collaborationUse() const
-{
- return *(reinterpret_cast<const QSet<QUmlCollaborationUse *> *>(&_collaborationUse));
-}
-
-/*!
- Specifies each feature defined in the classifier.Note that there may be members of the Classifier that are of the type Feature but are not included in this association, e.g. inherited features.
- */
-const QSet<QUmlFeature *> QUmlArtifact::feature() const
-{
- return *(reinterpret_cast<const QSet<QUmlFeature *> *>(&_feature));
-}
-
-/*!
- Specifies the general Classifiers for this Classifier.References the general classifier in the Generalization relationship.
- */
-const QSet<QUmlClassifier *> QUmlArtifact::general() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::general())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
-}
-
-/*!
- Specifies the Generalization relationships for this Classifier. These Generalizations navigaten to more general classifiers in the generalization hierarchy.
- */
-const QSet<QUmlGeneralization *> QUmlArtifact::generalization() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralization *> *>(&_generalization));
-}
-
-/*!
- Specifies all elements inherited by this classifier from the general classifiers.
- */
-const QSet<QUmlNamedElement *> QUmlArtifact::inheritedMember() const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inheritedMember())
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
-}
-
-/*!
- If true, the Classifier does not provide a complete declaration and can typically not be instantiated. An abstract classifier is intended to be used by other classifiers e.g. as the target of general metarelationships or generalization relationships.
- */
-bool QUmlArtifact::isAbstract() const
-{
- return _isAbstract;
-}
-
-/*!
- If true, the Classifier cannot be specialized by generalization. Note that this property is preserved through package merge operations; that is, the capability to specialize a Classifier (i.e., isFinalSpecialization =false) must be preserved in the resulting Classifier of a package merge operation where a Classifier with isFinalSpecialization =false is merged with a matching Classifier with isFinalSpecialization =true: the resulting Classifier will have isFinalSpecialization =false.
- */
-bool QUmlArtifact::isFinalSpecialization() const
-{
- return _isFinalSpecialization;
-}
-
-/*!
- The optional template signature specifying the formal template parameters.
- */
-QUmlRedefinableTemplateSignature *QUmlArtifact::ownedTemplateSignature() const
-{
- return reinterpret_cast<QUmlRedefinableTemplateSignature *>(_ownedTemplateSignature);
-}
-
-/*!
- References the use cases owned by this classifier.
- */
-const QSet<QUmlUseCase *> QUmlArtifact::ownedUseCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_ownedUseCase));
-}
-
-/*!
- Designates the GeneralizationSet of which the associated Classifier is a power type.
- */
-const QSet<QUmlGeneralizationSet *> QUmlArtifact::powertypeExtent() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralizationSet *> *>(&_powertypeExtent));
-}
-
-/*!
- References the Classifiers that are redefined by this Classifier.
- */
-const QSet<QUmlClassifier *> QUmlArtifact::redefinedClassifier() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinedClassifier));
-}
-
-/*!
- References a collaboration use which indicates the collaboration that represents this classifier.
- */
-QUmlCollaborationUse *QUmlArtifact::representation() const
-{
- return reinterpret_cast<QUmlCollaborationUse *>(_representation);
-}
-
-/*!
- References the substitutions that are owned by this Classifier.
- */
-const QSet<QUmlSubstitution *> QUmlArtifact::substitution() const
-{
- return *(reinterpret_cast<const QSet<QUmlSubstitution *> *>(&_substitution));
-}
-
-/*!
- The template parameter that exposes this element as a formal parameter.
- */
-QUmlClassifierTemplateParameter *QUmlArtifact::templateParameter() const
-{
- return reinterpret_cast<QUmlClassifierTemplateParameter *>(_templateParameter);
-}
-
-/*!
- The set of use cases for which this Classifier is the subject.
- */
-const QSet<QUmlUseCase *> QUmlArtifact::useCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_useCase));
-}
-
-// OWNED ATTRIBUTES [Artifact]
+// OWNED ATTRIBUTES
/*!
A concrete name that is used to refer to the Artifact in a physical context. Example: file system name, universal resource locator.
*/
-QString QUmlArtifact::fileName() const
-{
- return _fileName;
-}
-
-/*!
- The set of model elements that are manifested in the Artifact. That is, these model elements are utilized in the construction (or generation) of the artifact.
- */
-const QSet<QUmlManifestation *> QUmlArtifact::manifestation() const
+QString
+QUmlArtifact::fileName() const
{
- return *(reinterpret_cast<const QSet<QUmlManifestation *> *>(&_manifestation));
-}
+ // This is a read-write property
-/*!
- The Artifacts that are defined (nested) within the Artifact. The association is a specialization of the ownedMember association from Namespace to NamedElement.
- */
-const QSet<QUmlArtifact *> QUmlArtifact::nestedArtifact() const
-{
- return *(reinterpret_cast<const QSet<QUmlArtifact *> *>(&_nestedArtifact));
-}
-
-/*!
- The attributes or association ends defined for the Artifact. The association is a specialization of the ownedMember association.
- */
-const QList<QUmlProperty *> QUmlArtifact::ownedAttribute() const
-{
- return *(reinterpret_cast<const QList<QUmlProperty *> *>(&_ownedAttribute));
+ return _fileName;
}
-/*!
- The Operations defined for the Artifact. The association is a specialization of the ownedMember association.
- */
-const QList<QUmlOperation *> QUmlArtifact::ownedOperation() const
+void QUmlArtifact::setFileName(QString fileName)
{
- return *(reinterpret_cast<const QList<QUmlOperation *> *>(&_ownedOperation));
-}
-
-// OPERATIONS [Element]
+ // This is a read-write property
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlArtifact::allOwnedElements() const
-{
- QSet<QUmlElement *> r;
- foreach (UmlElement *element, UmlElement::allOwnedElements())
- r.insert(reinterpret_cast<QUmlElement *>(element));
- return r;
+ if (_fileName != fileName) {
+ _fileName = fileName;
+ }
}
/*!
- 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.
+ The set of model elements that are manifested in the Artifact. That is, these model elements are utilized in the construction (or generation) of the artifact.
*/
-bool QUmlArtifact::mustBeOwned() const
+const QSet<QUmlManifestation *>
+QUmlArtifact::manifestation() const
{
- return UmlElement::mustBeOwned();
-}
+ // This is a read-write association end
-// OPERATIONS [NamedElement]
-
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlArtifact::allNamespaces() const
-{
- QList<QUmlNamespace *> r;
- foreach (UmlNamespace *element, UmlNamedElement::allNamespaces())
- r.append(reinterpret_cast<QUmlNamespace *>(element));
- return r;
+ return _manifestation;
}
-/*!
- The query allOwningPackages() returns all the directly or indirectly owning packages.
- */
-QSet<QUmlPackage *> QUmlArtifact::allOwningPackages() const
+void QUmlArtifact::addManifestation(QUmlManifestation *manifestation)
{
- QSet<QUmlPackage *> r;
- foreach (UmlPackage *element, UmlNamedElement::allOwningPackages())
- r.insert(reinterpret_cast<QUmlPackage *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- 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 QUmlArtifact::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
-}
+ if (!_manifestation.contains(manifestation)) {
+ _manifestation.insert(manifestation);
+ if (manifestation->asQObject() && this->asQObject())
+ QObject::connect(manifestation->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeManifestation(QObject *)));
+ manifestation->asQObject()->setParent(this->asQObject());
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlArtifact::separator() const
-{
- return UmlNamedElement::separator();
+ // Adjust subsetted properties
+ addOwnedElement(manifestation);
+ addClientDependency(manifestation);
+ }
}
-// OPERATIONS [Namespace]
-
-/*!
- The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this namespace.
- */
-QSet<QUmlPackageableElement *> QUmlArtifact::excludeCollisions(QSet<QUmlPackageableElement *> imps) const
+void QUmlArtifact::removeManifestation(QUmlManifestation *manifestation)
{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::excludeCollisions(*(reinterpret_cast<QSet<UmlPackageableElement *> *>(&imps))))
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. The query takes account of importing. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package.The query getNamesOfMember() takes importing into account. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package.
- */
-QSet<QString> QUmlArtifact::getNamesOfMember(QUmlNamedElement *element) const
-{
- return UmlNamespace::getNamesOfMember(element);
-}
+ if (_manifestation.contains(manifestation)) {
+ _manifestation.remove(manifestation);
+ if (manifestation->asQObject())
+ manifestation->asQObject()->setParent(0);
-/*!
- The query importMembers() defines which of a set of PackageableElements are actually imported into the namespace. This excludes hidden ones, i.e., those which have names that conflict with names of owned members, and also excludes elements which would have the same name when imported.
- */
-QSet<QUmlPackageableElement *> QUmlArtifact::importMembers(QSet<QUmlPackageableElement *> imps) const
-{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::importMembers(*(reinterpret_cast<QSet<UmlPackageableElement *> *>(&imps))))
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
+ // Adjust subsetted properties
+ removeOwnedElement(manifestation);
+ removeClientDependency(manifestation);
+ }
}
/*!
- The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it.
+ The Artifacts that are defined (nested) within the Artifact. The association is a specialization of the ownedMember association from Namespace to NamedElement.
*/
-bool QUmlArtifact::membersAreDistinguishable() const
+const QSet<QUmlArtifact *>
+QUmlArtifact::nestedArtifact() const
{
- return UmlNamespace::membersAreDistinguishable();
-}
-
-// OPERATIONS [ParameterableElement]
+ // This is a read-write association end
-/*!
- 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 QUmlArtifact::isCompatibleWith(QUmlParameterableElement *p) const
-{
- return UmlParameterableElement::isCompatibleWith(p);
+ return _nestedArtifact;
}
-/*!
- The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter.
- */
-bool QUmlArtifact::isTemplateParameter() const
+void QUmlArtifact::addNestedArtifact(QUmlArtifact *nestedArtifact)
{
- return UmlParameterableElement::isTemplateParameter();
-}
+ // This is a read-write association end
-// OPERATIONS [Type]
-// OPERATIONS [RedefinableElement]
+ if (!_nestedArtifact.contains(nestedArtifact)) {
+ _nestedArtifact.insert(nestedArtifact);
+ if (nestedArtifact->asQObject() && this->asQObject())
+ QObject::connect(nestedArtifact->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeNestedArtifact(QObject *)));
+ nestedArtifact->asQObject()->setParent(this->asQObject());
-/*!
- The query isConsistentWith() specifies, for any two RedefinableElements in a context in which redefinition is possible, whether redefinition would be logically consistent. By default, this is false; this operation must be overridden for subclasses of RedefinableElement to define the consistency conditions.
- */
-bool QUmlArtifact::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
+ // Adjust subsetted properties
+ addOwnedMember(nestedArtifact);
+ }
}
-/*!
- The query isRedefinitionContextValid() specifies whether the redefinition contexts of this RedefinableElement are properly related to the redefinition contexts of the specified RedefinableElement to allow this element to redefine the other. By default at least one of the redefinition contexts of this element must be a specialization of at least one of the redefinition contexts of the specified element.
- */
-bool QUmlArtifact::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
+void QUmlArtifact::removeNestedArtifact(QUmlArtifact *nestedArtifact)
{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
+ // This is a read-write association end
-// OPERATIONS [TemplateableElement]
+ if (_nestedArtifact.contains(nestedArtifact)) {
+ _nestedArtifact.remove(nestedArtifact);
+ if (nestedArtifact->asQObject())
+ nestedArtifact->asQObject()->setParent(0);
-/*!
- The query parameterableElements() returns the set of elements that may be used as the parametered elements for a template parameter of this templateable element. By default, this set includes all the owned elements. Subclasses may override this operation if they choose to restrict the set of parameterable elements.
- */
-QSet<QUmlParameterableElement *> QUmlArtifact::parameterableElements() const
-{
- QSet<QUmlParameterableElement *> r;
- foreach (UmlParameterableElement *element, UmlTemplateableElement::parameterableElements())
- r.insert(reinterpret_cast<QUmlParameterableElement *>(element));
- return r;
+ // Adjust subsetted properties
+ removeOwnedMember(nestedArtifact);
+ }
}
-// OPERATIONS [Classifier]
-
/*!
- The query allFeatures() gives all of the features in the namespace of the classifier. In general, through mechanisms such as inheritance, this will be a larger set than feature.
+ The attributes or association ends defined for the Artifact. The association is a specialization of the ownedMember association.
*/
-QSet<QUmlFeature *> QUmlArtifact::allFeatures() const
+const QList<QUmlProperty *>
+QUmlArtifact::ownedAttribute() const
{
- QSet<QUmlFeature *> r;
- foreach (UmlFeature *element, UmlClassifier::allFeatures())
- r.insert(reinterpret_cast<QUmlFeature *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- The query allParents() gives all of the direct and indirect ancestors of a generalized Classifier.
- */
-QSet<QUmlClassifier *> QUmlArtifact::allParents() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::allParents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
+ return _ownedAttribute;
}
-/*!
- The query conformsTo() gives true for a classifier that defines a type that conforms to another. This is used, for example, in the specification of signature conformance for operations.
- */
-bool QUmlArtifact::conformsTo(QUmlClassifier *other) const
+void QUmlArtifact::addOwnedAttribute(QUmlProperty *ownedAttribute)
{
- return UmlClassifier::conformsTo(other);
-}
+ // This is a read-write association end
-/*!
- The query hasVisibilityOf() determines whether a named element is visible in the classifier. By default all are visible. It is only called when the argument is something owned by a parent.
- */
-bool QUmlArtifact::hasVisibilityOf(QUmlNamedElement *n) const
-{
- return UmlClassifier::hasVisibilityOf(n);
-}
+ if (!_ownedAttribute.contains(ownedAttribute)) {
+ _ownedAttribute.append(ownedAttribute);
+ if (ownedAttribute->asQObject() && this->asQObject())
+ QObject::connect(ownedAttribute->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeOwnedAttribute(QObject *)));
+ ownedAttribute->asQObject()->setParent(this->asQObject());
-/*!
- The inherit operation is overridden to exclude redefined properties.The query inherit() defines how to inherit a set of elements. Here the operation is defined to inherit them all. It is intended to be redefined in circumstances where inheritance is affected by redefinition.
- */
-QSet<QUmlNamedElement *> QUmlArtifact::inherit(QSet<QUmlNamedElement *> inhs) const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inherit(*(reinterpret_cast<QSet<UmlNamedElement *> *>(&inhs))))
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
+ // Adjust subsetted properties
+ addOwnedMember(ownedAttribute);
+ addAttribute(ownedAttribute);
+ }
}
-/*!
- The query inheritableMembers() gives all of the members of a classifier that may be inherited in one of its descendants, subject to whatever visibility restrictions apply.
- */
-QSet<QUmlNamedElement *> QUmlArtifact::inheritableMembers(QUmlClassifier *c) const
+void QUmlArtifact::removeOwnedAttribute(QUmlProperty *ownedAttribute)
{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inheritableMembers(c))
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- The query isTemplate() returns whether this templateable element is actually a template.
- */
-bool QUmlArtifact::isTemplate() const
-{
- return UmlClassifier::isTemplate();
-}
+ if (_ownedAttribute.contains(ownedAttribute)) {
+ _ownedAttribute.removeAll(ownedAttribute);
+ if (ownedAttribute->asQObject())
+ ownedAttribute->asQObject()->setParent(0);
-/*!
- The query maySpecializeType() determines whether this classifier may have a generalization relationship to classifiers of the specified type. By default a classifier may specialize classifiers of the same or a more general type. It is intended to be redefined by classifiers that have different specialization constraints.
- */
-bool QUmlArtifact::maySpecializeType(QUmlClassifier *c) const
-{
- return UmlClassifier::maySpecializeType(c);
+ // Adjust subsetted properties
+ removeOwnedMember(ownedAttribute);
+ removeAttribute(ownedAttribute);
+ }
}
/*!
- The query parents() gives all of the immediate ancestors of a generalized Classifier.
+ The Operations defined for the Artifact. The association is a specialization of the ownedMember association.
*/
-QSet<QUmlClassifier *> QUmlArtifact::parents() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::parents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlArtifact::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlArtifact::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlArtifact::addClientDependency(UmlDependency *clientDependency)
+const QList<QUmlOperation *>
+QUmlArtifact::ownedOperation() const
{
- UmlNamedElement::addClientDependency(clientDependency);
-}
+ // This is a read-write association end
-void QUmlArtifact::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
+ return _ownedOperation;
}
-void QUmlArtifact::setName(QString name)
+void QUmlArtifact::addOwnedOperation(QUmlOperation *ownedOperation)
{
- UmlNamedElement::setName(name);
-}
+ // This is a read-write association end
-void QUmlArtifact::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-// SLOTS FOR OWNED ATTRIBUTES [Namespace]
+ if (!_ownedOperation.contains(ownedOperation)) {
+ _ownedOperation.append(ownedOperation);
+ if (ownedOperation->asQObject() && this->asQObject())
+ QObject::connect(ownedOperation->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeOwnedOperation(QObject *)));
+ ownedOperation->asQObject()->setParent(this->asQObject());
-void QUmlArtifact::addElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::addElementImport(elementImport);
+ // Adjust subsetted properties
+ addFeature(ownedOperation);
+ addOwnedMember(ownedOperation);
+ }
}
-void QUmlArtifact::removeElementImport(UmlElementImport *elementImport)
+void QUmlArtifact::removeOwnedOperation(QUmlOperation *ownedOperation)
{
- UmlNamespace::removeElementImport(elementImport);
-}
+ // This is a read-write association end
-void QUmlArtifact::addOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::addOwnedRule(ownedRule);
-}
+ if (_ownedOperation.contains(ownedOperation)) {
+ _ownedOperation.removeAll(ownedOperation);
+ if (ownedOperation->asQObject())
+ ownedOperation->asQObject()->setParent(0);
-void QUmlArtifact::removeOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::removeOwnedRule(ownedRule);
+ // Adjust subsetted properties
+ removeFeature(ownedOperation);
+ removeOwnedMember(ownedOperation);
+ }
}
-void QUmlArtifact::addPackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::addPackageImport(packageImport);
-}
-
-void QUmlArtifact::removePackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::removePackageImport(packageImport);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ParameterableElement]
-
-void QUmlArtifact::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter)
-{
- UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter);
-}
-// SLOTS FOR OWNED ATTRIBUTES [PackageableElement]
-
-void QUmlArtifact::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlPackageableElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Type]
-
-void QUmlArtifact::setPackage(QUmlPackage *package)
-{
- UmlType::setPackage(package);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlArtifact::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [TemplateableElement]
-
-void QUmlArtifact::addTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::addTemplateBinding(templateBinding);
-}
-
-void QUmlArtifact::removeTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::removeTemplateBinding(templateBinding);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Classifier]
-
-void QUmlArtifact::addCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::addCollaborationUse(collaborationUse);
-}
-
-void QUmlArtifact::removeCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::removeCollaborationUse(collaborationUse);
-}
-
-void QUmlArtifact::addGeneral(UmlClassifier *general)
-{
- UmlClassifier::addGeneral(general);
-}
-
-void QUmlArtifact::removeGeneral(UmlClassifier *general)
-{
- UmlClassifier::removeGeneral(general);
-}
-
-void QUmlArtifact::addGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::addGeneralization(generalization);
-}
-
-void QUmlArtifact::removeGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::removeGeneralization(generalization);
-}
-
-void QUmlArtifact::setAbstract(bool isAbstract)
-{
- UmlClassifier::setAbstract(isAbstract);
-}
-
-void QUmlArtifact::setFinalSpecialization(bool isFinalSpecialization)
-{
- UmlClassifier::setFinalSpecialization(isFinalSpecialization);
-}
-
-void QUmlArtifact::setOwnedTemplateSignature(QUmlRedefinableTemplateSignature *ownedTemplateSignature)
-{
- UmlClassifier::setOwnedTemplateSignature(ownedTemplateSignature);
-}
-
-void QUmlArtifact::addOwnedUseCase(UmlUseCase *ownedUseCase)
-{
- UmlClassifier::addOwnedUseCase(ownedUseCase);
-}
-
-void QUmlArtifact::removeOwnedUseCase(UmlUseCase *ownedUseCase)
-{
- UmlClassifier::removeOwnedUseCase(ownedUseCase);
-}
-
-void QUmlArtifact::addPowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::addPowertypeExtent(powertypeExtent);
-}
-
-void QUmlArtifact::removePowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::removePowertypeExtent(powertypeExtent);
-}
-
-void QUmlArtifact::addRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::addRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlArtifact::removeRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::removeRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlArtifact::setRepresentation(QUmlCollaborationUse *representation)
-{
- UmlClassifier::setRepresentation(representation);
-}
-
-void QUmlArtifact::addSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::addSubstitution(substitution);
-}
-
-void QUmlArtifact::removeSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::removeSubstitution(substitution);
-}
-
-void QUmlArtifact::setTemplateParameter(QUmlClassifierTemplateParameter *templateParameter)
-{
- UmlClassifier::setTemplateParameter(templateParameter);
-}
-
-void QUmlArtifact::addUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::addUseCase(useCase);
-}
-
-void QUmlArtifact::removeUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::removeUseCase(useCase);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Artifact]
-
-void QUmlArtifact::setFileName(QString fileName)
-{
- UmlArtifact::setFileName(fileName);
-}
-
-void QUmlArtifact::addManifestation(UmlManifestation *manifestation)
-{
- UmlArtifact::addManifestation(manifestation);
-}
-
-void QUmlArtifact::removeManifestation(UmlManifestation *manifestation)
-{
- UmlArtifact::removeManifestation(manifestation);
-}
-
-void QUmlArtifact::addNestedArtifact(UmlArtifact *nestedArtifact)
-{
- UmlArtifact::addNestedArtifact(nestedArtifact);
-}
-
-void QUmlArtifact::removeNestedArtifact(UmlArtifact *nestedArtifact)
-{
- UmlArtifact::removeNestedArtifact(nestedArtifact);
-}
-
-void QUmlArtifact::addOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlArtifact::addOwnedAttribute(ownedAttribute);
-}
-
-void QUmlArtifact::removeOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlArtifact::removeOwnedAttribute(ownedAttribute);
-}
-
-void QUmlArtifact::addOwnedOperation(UmlOperation *ownedOperation)
-{
- UmlArtifact::addOwnedOperation(ownedOperation);
-}
-
-void QUmlArtifact::removeOwnedOperation(UmlOperation *ownedOperation)
-{
- UmlArtifact::removeOwnedOperation(ownedOperation);
-}
-
-QT_END_NAMESPACE
-