summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlcollaboration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlcollaboration.cpp')
-rw-r--r--src/uml/qumlcollaboration.cpp955
1 files changed, 32 insertions, 923 deletions
diff --git a/src/uml/qumlcollaboration.cpp b/src/uml/qumlcollaboration.cpp
index d3031acf..af95049e 100644
--- a/src/uml/qumlcollaboration.cpp
+++ b/src/uml/qumlcollaboration.cpp
@@ -40,958 +40,67 @@
****************************************************************************/
#include "qumlcollaboration.h"
-#include <QtUml/QUmlBehavior>
-#include <QtUml/QUmlClassifier>
-#include <QtUml/QUmlClassifierTemplateParameter>
-#include <QtUml/QUmlCollaborationUse>
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlConnectableElement>
-#include <QtUml/QUmlConnector>
-#include <QtUml/QUmlConstraint>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlElementImport>
-#include <QtUml/QUmlFeature>
-#include <QtUml/QUmlGeneralization>
-#include <QtUml/QUmlGeneralizationSet>
-#include <QtUml/QUmlInterfaceRealization>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
-#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>
+#include "private/qumlcollaborationobject_p.h"
-QT_BEGIN_NAMESPACE
+#include <QtUml/QUmlConnectableElement>
/*!
- \class UmlCollaboration
+ \class QUmlCollaboration
\inmodule QtUml
\brief A collaboration use represents the application of the pattern described by a collaboration to a specific situation involving specific classes or instances playing the roles of the collaboration.
*/
-
-QUmlCollaboration::QUmlCollaboration(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlCollaboration::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlCollaboration::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlCollaboration::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlCollaboration::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlCollaboration::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlCollaboration::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlCollaboration::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 QUmlCollaboration::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-// OWNED ATTRIBUTES [Namespace]
-
-/*!
- References the ElementImports owned by the Namespace.
- */
-const QSet<QUmlElementImport *> QUmlCollaboration::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 *> QUmlCollaboration::importedMember() const
+QUmlCollaboration::QUmlCollaboration(bool createQObject)
{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::importedMember())
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
+ if (createQObject)
+ _qObject = new QUmlCollaborationObject(this);
}
-/*!
- A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.
- */
-const QSet<QUmlNamedElement *> QUmlCollaboration::member() const
+QUmlCollaboration::~QUmlCollaboration()
{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_member));
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-/*!
- A collection of NamedElements owned by the Namespace.
- */
-const QSet<QUmlNamedElement *> QUmlCollaboration::ownedMember() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_ownedMember));
-}
-
-/*!
- Specifies a set of Constraints owned by this Namespace.
- */
-const QSet<QUmlConstraint *> QUmlCollaboration::ownedRule() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_ownedRule));
-}
-
-/*!
- References the PackageImports owned by the Namespace.
- */
-const QSet<QUmlPackageImport *> QUmlCollaboration::packageImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlPackageImport *> *>(&_packageImport));
-}
-
-// OWNED ATTRIBUTES [ParameterableElement]
-
-/*!
- The formal template parameter that owns this element.
- */
-QUmlTemplateParameter *QUmlCollaboration::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 QUmlCollaboration::visibility() const
-{
- return _visibility;
-}
-
-// OWNED ATTRIBUTES [Type]
-
-/*!
- Specifies the owning package of this classifier, if any.
- */
-QUmlPackage *QUmlCollaboration::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 QUmlCollaboration::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlCollaboration::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlCollaboration::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [TemplateableElement]
-
-/*!
- The optional bindings from this element to templates.
- */
-const QSet<QUmlTemplateBinding *> QUmlCollaboration::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 *> QUmlCollaboration::attribute() const
-{
- return *(reinterpret_cast<const QSet<QUmlProperty *> *>(&_attribute));
-}
-
-/*!
- References the collaboration uses owned by the classifier.
- */
-const QSet<QUmlCollaborationUse *> QUmlCollaboration::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 *> QUmlCollaboration::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 *> QUmlCollaboration::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 *> QUmlCollaboration::generalization() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralization *> *>(&_generalization));
-}
-
-/*!
- Specifies all elements inherited by this classifier from the general classifiers.
- */
-const QSet<QUmlNamedElement *> QUmlCollaboration::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 QUmlCollaboration::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 QUmlCollaboration::isFinalSpecialization() const
-{
- return _isFinalSpecialization;
-}
-
-/*!
- The optional template signature specifying the formal template parameters.
- */
-QUmlRedefinableTemplateSignature *QUmlCollaboration::ownedTemplateSignature() const
-{
- return reinterpret_cast<QUmlRedefinableTemplateSignature *>(_ownedTemplateSignature);
-}
-
-/*!
- References the use cases owned by this classifier.
- */
-const QSet<QUmlUseCase *> QUmlCollaboration::ownedUseCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_ownedUseCase));
-}
-
-/*!
- Designates the GeneralizationSet of which the associated Classifier is a power type.
- */
-const QSet<QUmlGeneralizationSet *> QUmlCollaboration::powertypeExtent() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralizationSet *> *>(&_powertypeExtent));
-}
-
-/*!
- References the Classifiers that are redefined by this Classifier.
- */
-const QSet<QUmlClassifier *> QUmlCollaboration::redefinedClassifier() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinedClassifier));
-}
-
-/*!
- References a collaboration use which indicates the collaboration that represents this classifier.
- */
-QUmlCollaborationUse *QUmlCollaboration::representation() const
-{
- return reinterpret_cast<QUmlCollaborationUse *>(_representation);
-}
-
-/*!
- References the substitutions that are owned by this Classifier.
- */
-const QSet<QUmlSubstitution *> QUmlCollaboration::substitution() const
-{
- return *(reinterpret_cast<const QSet<QUmlSubstitution *> *>(&_substitution));
-}
-
-/*!
- The template parameter that exposes this element as a formal parameter.
- */
-QUmlClassifierTemplateParameter *QUmlCollaboration::templateParameter() const
-{
- return reinterpret_cast<QUmlClassifierTemplateParameter *>(_templateParameter);
-}
-
-/*!
- The set of use cases for which this Classifier is the subject.
- */
-const QSet<QUmlUseCase *> QUmlCollaboration::useCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_useCase));
-}
-
-// OWNED ATTRIBUTES [StructuredClassifier]
-
-/*!
- References the properties owned by the classifier.
- */
-const QList<QUmlProperty *> QUmlCollaboration::ownedAttribute() const
-{
- return *(reinterpret_cast<const QList<QUmlProperty *> *>(&_ownedAttribute));
-}
-
-/*!
- References the connectors owned by the classifier.
- */
-const QSet<QUmlConnector *> QUmlCollaboration::ownedConnector() const
-{
- return *(reinterpret_cast<const QSet<QUmlConnector *> *>(&_ownedConnector));
-}
-
-/*!
- References the properties specifying instances that the classifier owns by composition. This association is derived, selecting those owned properties where isComposite is true.
- */
-const QSet<QUmlProperty *> QUmlCollaboration::part() const
-{
- QSet<QUmlProperty *> r;
- foreach (UmlProperty *element, UmlStructuredClassifier::part())
- r.insert(reinterpret_cast<QUmlProperty *>(element));
- return r;
-}
-
-/*!
- References the roles that instances may play in this classifier.
- */
-const QSet<QUmlConnectableElement *> QUmlCollaboration::role() const
-{
- return *(reinterpret_cast<const QSet<QUmlConnectableElement *> *>(&_role));
-}
-
-// OWNED ATTRIBUTES [BehavioredClassifier]
-
-/*!
- A behavior specification that specifies the behavior of the classifier itself.
- */
-QUmlBehavior *QUmlCollaboration::classifierBehavior() const
-{
- return reinterpret_cast<QUmlBehavior *>(_classifierBehavior);
-}
-
-/*!
- The set of InterfaceRealizations owned by the BehavioredClassifier. Interface realizations reference the Interfaces of which the BehavioredClassifier is an implementation.
- */
-const QSet<QUmlInterfaceRealization *> QUmlCollaboration::interfaceRealization() const
-{
- return *(reinterpret_cast<const QSet<QUmlInterfaceRealization *> *>(&_interfaceRealization));
-}
-
-/*!
- References behavior specifications owned by a classifier.
- */
-const QSet<QUmlBehavior *> QUmlCollaboration::ownedBehavior() const
-{
- return *(reinterpret_cast<const QSet<QUmlBehavior *> *>(&_ownedBehavior));
-}
-
-// OWNED ATTRIBUTES [Collaboration]
+// OWNED ATTRIBUTES
/*!
References connectable elements (possibly owned by other classifiers) which represent roles that instances may play in this collaboration.
*/
-const QSet<QUmlConnectableElement *> QUmlCollaboration::collaborationRole() const
-{
- return *(reinterpret_cast<const QSet<QUmlConnectableElement *> *>(&_collaborationRole));
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlCollaboration::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 QUmlCollaboration::mustBeOwned() const
-{
- return UmlElement::mustBeOwned();
-}
-
-// OPERATIONS [NamedElement]
-
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlCollaboration::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 *> QUmlCollaboration::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 QUmlCollaboration::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 QUmlCollaboration::separator() const
-{
- return UmlNamedElement::separator();
-}
-
-// 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 *> QUmlCollaboration::excludeCollisions(QSet<QUmlPackageableElement *> imps) const
-{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::excludeCollisions(*(reinterpret_cast<QSet<UmlPackageableElement *> *>(&imps))))
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
-}
-
-/*!
- 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> QUmlCollaboration::getNamesOfMember(QUmlNamedElement *element) const
-{
- return UmlNamespace::getNamesOfMember(element);
-}
-
-/*!
- 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 *> QUmlCollaboration::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;
-}
-
-/*!
- The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it.
- */
-bool QUmlCollaboration::membersAreDistinguishable() const
-{
- return UmlNamespace::membersAreDistinguishable();
-}
-
-// OPERATIONS [ParameterableElement]
-
-/*!
- 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 QUmlCollaboration::isCompatibleWith(QUmlParameterableElement *p) const
-{
- return UmlParameterableElement::isCompatibleWith(p);
-}
-
-/*!
- The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter.
- */
-bool QUmlCollaboration::isTemplateParameter() const
+const QSet<QUmlConnectableElement *>
+QUmlCollaboration::collaborationRole() const
{
- return UmlParameterableElement::isTemplateParameter();
-}
-
-// OPERATIONS [Type]
-// OPERATIONS [RedefinableElement]
-
-/*!
- 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 QUmlCollaboration::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
-}
+ // This is a read-write association end
-/*!
- 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 QUmlCollaboration::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
-{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
+ return _collaborationRole;
}
-// OPERATIONS [TemplateableElement]
-
-/*!
- 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 *> QUmlCollaboration::parameterableElements() const
+void QUmlCollaboration::addCollaborationRole(QUmlConnectableElement *collaborationRole)
{
- QSet<QUmlParameterableElement *> r;
- foreach (UmlParameterableElement *element, UmlTemplateableElement::parameterableElements())
- r.insert(reinterpret_cast<QUmlParameterableElement *>(element));
- return r;
-}
+ // This is a read-write association end
-// OPERATIONS [Classifier]
+ if (!_collaborationRole.contains(collaborationRole)) {
+ _collaborationRole.insert(collaborationRole);
+ if (collaborationRole->asQObject() && this->asQObject())
+ QObject::connect(collaborationRole->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeCollaborationRole(QObject *)));
-/*!
- 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.
- */
-QSet<QUmlFeature *> QUmlCollaboration::allFeatures() const
-{
- QSet<QUmlFeature *> r;
- foreach (UmlFeature *element, UmlClassifier::allFeatures())
- r.insert(reinterpret_cast<QUmlFeature *>(element));
- return r;
+ // Adjust subsetted properties
+ addRole(collaborationRole);
+ }
}
-/*!
- The query allParents() gives all of the direct and indirect ancestors of a generalized Classifier.
- */
-QSet<QUmlClassifier *> QUmlCollaboration::allParents() const
+void QUmlCollaboration::removeCollaborationRole(QUmlConnectableElement *collaborationRole)
{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::allParents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- 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 QUmlCollaboration::conformsTo(QUmlClassifier *other) const
-{
- return UmlClassifier::conformsTo(other);
-}
+ if (_collaborationRole.contains(collaborationRole)) {
+ _collaborationRole.remove(collaborationRole);
-/*!
- 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 QUmlCollaboration::hasVisibilityOf(QUmlNamedElement *n) const
-{
- return UmlClassifier::hasVisibilityOf(n);
-}
-
-/*!
- 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 *> QUmlCollaboration::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;
-}
-
-/*!
- 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 *> QUmlCollaboration::inheritableMembers(QUmlClassifier *c) const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inheritableMembers(c))
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
-}
-
-/*!
- The query isTemplate() returns whether this templateable element is actually a template.
- */
-bool QUmlCollaboration::isTemplate() const
-{
- return UmlClassifier::isTemplate();
-}
-
-/*!
- 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 QUmlCollaboration::maySpecializeType(QUmlClassifier *c) const
-{
- return UmlClassifier::maySpecializeType(c);
-}
-
-/*!
- The query parents() gives all of the immediate ancestors of a generalized Classifier.
- */
-QSet<QUmlClassifier *> QUmlCollaboration::parents() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::parents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlCollaboration::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlCollaboration::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlCollaboration::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlCollaboration::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlCollaboration::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlCollaboration::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-// SLOTS FOR OWNED ATTRIBUTES [Namespace]
-
-void QUmlCollaboration::addElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::addElementImport(elementImport);
-}
-
-void QUmlCollaboration::removeElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::removeElementImport(elementImport);
-}
-
-void QUmlCollaboration::addOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::addOwnedRule(ownedRule);
-}
-
-void QUmlCollaboration::removeOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::removeOwnedRule(ownedRule);
-}
-
-void QUmlCollaboration::addPackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::addPackageImport(packageImport);
+ // Adjust subsetted properties
+ removeRole(collaborationRole);
+ }
}
-void QUmlCollaboration::removePackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::removePackageImport(packageImport);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ParameterableElement]
-
-void QUmlCollaboration::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter)
-{
- UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter);
-}
-// SLOTS FOR OWNED ATTRIBUTES [PackageableElement]
-
-void QUmlCollaboration::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlPackageableElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Type]
-
-void QUmlCollaboration::setPackage(QUmlPackage *package)
-{
- UmlType::setPackage(package);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlCollaboration::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [TemplateableElement]
-
-void QUmlCollaboration::addTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::addTemplateBinding(templateBinding);
-}
-
-void QUmlCollaboration::removeTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::removeTemplateBinding(templateBinding);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Classifier]
-
-void QUmlCollaboration::addCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::addCollaborationUse(collaborationUse);
-}
-
-void QUmlCollaboration::removeCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::removeCollaborationUse(collaborationUse);
-}
-
-void QUmlCollaboration::addGeneral(UmlClassifier *general)
-{
- UmlClassifier::addGeneral(general);
-}
-
-void QUmlCollaboration::removeGeneral(UmlClassifier *general)
-{
- UmlClassifier::removeGeneral(general);
-}
-
-void QUmlCollaboration::addGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::addGeneralization(generalization);
-}
-
-void QUmlCollaboration::removeGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::removeGeneralization(generalization);
-}
-
-void QUmlCollaboration::setAbstract(bool isAbstract)
-{
- UmlClassifier::setAbstract(isAbstract);
-}
-
-void QUmlCollaboration::setFinalSpecialization(bool isFinalSpecialization)
-{
- UmlClassifier::setFinalSpecialization(isFinalSpecialization);
-}
-
-void QUmlCollaboration::setOwnedTemplateSignature(QUmlRedefinableTemplateSignature *ownedTemplateSignature)
-{
- UmlClassifier::setOwnedTemplateSignature(ownedTemplateSignature);
-}
-
-void QUmlCollaboration::addOwnedUseCase(UmlUseCase *ownedUseCase)
-{
- UmlClassifier::addOwnedUseCase(ownedUseCase);
-}
-
-void QUmlCollaboration::removeOwnedUseCase(UmlUseCase *ownedUseCase)
-{
- UmlClassifier::removeOwnedUseCase(ownedUseCase);
-}
-
-void QUmlCollaboration::addPowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::addPowertypeExtent(powertypeExtent);
-}
-
-void QUmlCollaboration::removePowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::removePowertypeExtent(powertypeExtent);
-}
-
-void QUmlCollaboration::addRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::addRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlCollaboration::removeRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::removeRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlCollaboration::setRepresentation(QUmlCollaborationUse *representation)
-{
- UmlClassifier::setRepresentation(representation);
-}
-
-void QUmlCollaboration::addSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::addSubstitution(substitution);
-}
-
-void QUmlCollaboration::removeSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::removeSubstitution(substitution);
-}
-
-void QUmlCollaboration::setTemplateParameter(QUmlClassifierTemplateParameter *templateParameter)
-{
- UmlClassifier::setTemplateParameter(templateParameter);
-}
-
-void QUmlCollaboration::addUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::addUseCase(useCase);
-}
-
-void QUmlCollaboration::removeUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::removeUseCase(useCase);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [StructuredClassifier]
-
-void QUmlCollaboration::addOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlStructuredClassifier::addOwnedAttribute(ownedAttribute);
-}
-
-void QUmlCollaboration::removeOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlStructuredClassifier::removeOwnedAttribute(ownedAttribute);
-}
-
-void QUmlCollaboration::addOwnedConnector(UmlConnector *ownedConnector)
-{
- UmlStructuredClassifier::addOwnedConnector(ownedConnector);
-}
-
-void QUmlCollaboration::removeOwnedConnector(UmlConnector *ownedConnector)
-{
- UmlStructuredClassifier::removeOwnedConnector(ownedConnector);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [BehavioredClassifier]
-
-void QUmlCollaboration::setClassifierBehavior(QUmlBehavior *classifierBehavior)
-{
- UmlBehavioredClassifier::setClassifierBehavior(classifierBehavior);
-}
-
-void QUmlCollaboration::addInterfaceRealization(UmlInterfaceRealization *interfaceRealization)
-{
- UmlBehavioredClassifier::addInterfaceRealization(interfaceRealization);
-}
-
-void QUmlCollaboration::removeInterfaceRealization(UmlInterfaceRealization *interfaceRealization)
-{
- UmlBehavioredClassifier::removeInterfaceRealization(interfaceRealization);
-}
-
-void QUmlCollaboration::addOwnedBehavior(UmlBehavior *ownedBehavior)
-{
- UmlBehavioredClassifier::addOwnedBehavior(ownedBehavior);
-}
-
-void QUmlCollaboration::removeOwnedBehavior(UmlBehavior *ownedBehavior)
-{
- UmlBehavioredClassifier::removeOwnedBehavior(ownedBehavior);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Collaboration]
-
-void QUmlCollaboration::addCollaborationRole(UmlConnectableElement *collaborationRole)
-{
- UmlCollaboration::addCollaborationRole(collaborationRole);
-}
-
-void QUmlCollaboration::removeCollaborationRole(UmlConnectableElement *collaborationRole)
-{
- UmlCollaboration::removeCollaborationRole(collaborationRole);
-}
-
-QT_END_NAMESPACE
-