summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlbehavior.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-09-02 22:02:41 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-09-03 03:04:37 +0200
commita143fe8c5451493b128b4c6f0750f02b58af8666 (patch)
tree4b74787f6ece9256db04dc65002cae749f6936b3 /src/uml/qumlbehavior.cpp
parent2bfe659e4d30b449747585e18eeb84bfc5d73f43 (diff)
Add initial version of new UML metamodel implementation
Change-Id: Ic29a04dc49fac075d9c736237573b7f4e3da85ef Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlbehavior.cpp')
-rw-r--r--src/uml/qumlbehavior.cpp1198
1 files changed, 164 insertions, 1034 deletions
diff --git a/src/uml/qumlbehavior.cpp b/src/uml/qumlbehavior.cpp
index 9c9cf806..cec9f20c 100644
--- a/src/uml/qumlbehavior.cpp
+++ b/src/uml/qumlbehavior.cpp
@@ -42,1169 +42,299 @@
#include <QtUml/QUmlBehavioralFeature>
#include <QtUml/QUmlBehavioredClassifier>
-#include <QtUml/QUmlClass>
-#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/QUmlExtension>
-#include <QtUml/QUmlFeature>
-#include <QtUml/QUmlGeneralization>
-#include <QtUml/QUmlGeneralizationSet>
-#include <QtUml/QUmlInterfaceRealization>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
-#include <QtUml/QUmlOperation>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlPackageableElement>
-#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlParameter>
-#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlParameterSet>
-#include <QtUml/QUmlPort>
-#include <QtUml/QUmlProperty>
-#include <QtUml/QUmlReception>
-#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 UmlBehavior
+ \class QUmlBehavior
\inmodule QtUml
\brief Behavior is a specification of how its context classifier changes state over time. This specification may be either a definition of possible behavior execution or emergent behavior, or a selective illustration of an interesting subset of possible executions. The latter form is typically used for capturing examples, such as a trace of a particular execution.A behavior owns zero or more parameter sets.
*/
-
-QUmlBehavior::QUmlBehavior(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlBehavior::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlBehavior::ownedElement() const
+QUmlBehavior::QUmlBehavior() :
+ QUmlClass(false),
+ _isReentrant(true),
+ _specification(0)
{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
}
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlBehavior::owner() const
+QUmlBehavior::~QUmlBehavior()
{
- return reinterpret_cast<QUmlElement *>(_owner);
}
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlBehavior::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlBehavior::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlBehavior::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlBehavior::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 QUmlBehavior::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-// OWNED ATTRIBUTES [Namespace]
-
-/*!
- References the ElementImports owned by the Namespace.
- */
-const QSet<QUmlElementImport *> QUmlBehavior::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 *> QUmlBehavior::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 *> QUmlBehavior::member() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_member));
-}
-
-/*!
- A collection of NamedElements owned by the Namespace.
- */
-const QSet<QUmlNamedElement *> QUmlBehavior::ownedMember() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_ownedMember));
-}
-
-/*!
- Specifies a set of Constraints owned by this Namespace.
- */
-const QSet<QUmlConstraint *> QUmlBehavior::ownedRule() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_ownedRule));
-}
-
-/*!
- References the PackageImports owned by the Namespace.
- */
-const QSet<QUmlPackageImport *> QUmlBehavior::packageImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlPackageImport *> *>(&_packageImport));
-}
-
-// OWNED ATTRIBUTES [ParameterableElement]
-
-/*!
- The formal template parameter that owns this element.
- */
-QUmlTemplateParameter *QUmlBehavior::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 QUmlBehavior::visibility() const
-{
- return _visibility;
-}
-
-// OWNED ATTRIBUTES [Type]
-
-/*!
- Specifies the owning package of this classifier, if any.
- */
-QUmlPackage *QUmlBehavior::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 QUmlBehavior::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlBehavior::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlBehavior::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [TemplateableElement]
-
-/*!
- The optional bindings from this element to templates.
- */
-const QSet<QUmlTemplateBinding *> QUmlBehavior::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 *> QUmlBehavior::attribute() const
-{
- return *(reinterpret_cast<const QSet<QUmlProperty *> *>(&_attribute));
-}
-
-/*!
- References the collaboration uses owned by the classifier.
- */
-const QSet<QUmlCollaborationUse *> QUmlBehavior::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 *> QUmlBehavior::feature() const
-{
- return *(reinterpret_cast<const QSet<QUmlFeature *> *>(&_feature));
-}
-
-/*!
- Specifies the Generalization relationships for this Classifier. These Generalizations navigaten to more general classifiers in the generalization hierarchy.
- */
-const QSet<QUmlGeneralization *> QUmlBehavior::generalization() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralization *> *>(&_generalization));
-}
-
-/*!
- Specifies all elements inherited by this classifier from the general classifiers.
- */
-const QSet<QUmlNamedElement *> QUmlBehavior::inheritedMember() const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inheritedMember())
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
-}
-
-/*!
- 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 QUmlBehavior::isFinalSpecialization() const
-{
- return _isFinalSpecialization;
-}
+// OWNED ATTRIBUTES
/*!
- The optional template signature specifying the formal template parameters.
+ The classifier that is the context for the execution of the behavior. If the behavior is owned by a BehavioredClassifier, that classifier is the context. Otherwise, the context is the first BehavioredClassifier reached by following the chain of owner relationships. For example, following this algorithm, the context of an entry action in a state machine is the classifier that owns the state machine. The features of the context classifier as well as the elements visible to the context classifier are visible to the behavior.
*/
-QUmlRedefinableTemplateSignature *QUmlBehavior::ownedTemplateSignature() const
+QUmlBehavioredClassifier *
+QUmlBehavior::context() const
{
- return reinterpret_cast<QUmlRedefinableTemplateSignature *>(_ownedTemplateSignature);
-}
+ // This is a read-only derived association end
-/*!
- References the use cases owned by this classifier.
- */
-const QSet<QUmlUseCase *> QUmlBehavior::ownedUseCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_ownedUseCase));
-}
+ qWarning("UmlBehavior::context(): to be implemented (this is a derived association end)");
-/*!
- Designates the GeneralizationSet of which the associated Classifier is a power type.
- */
-const QSet<QUmlGeneralizationSet *> QUmlBehavior::powertypeExtent() const
-{
- return *(reinterpret_cast<const QSet<QUmlGeneralizationSet *> *>(&_powertypeExtent));
+ return 0;
}
-/*!
- References the Classifiers that are redefined by this Classifier.
- */
-const QSet<QUmlClassifier *> QUmlBehavior::redefinedClassifier() const
+void QUmlBehavior::setContext(QUmlBehavioredClassifier *context)
{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinedClassifier));
-}
+ // This is a read-only derived association end
-/*!
- References a collaboration use which indicates the collaboration that represents this classifier.
- */
-QUmlCollaborationUse *QUmlBehavior::representation() const
-{
- return reinterpret_cast<QUmlCollaborationUse *>(_representation);
-}
+ qWarning("UmlBehavior::context(): to be implemented (this is a derived association end)");
+ Q_UNUSED(context);
-/*!
- References the substitutions that are owned by this Classifier.
- */
-const QSet<QUmlSubstitution *> QUmlBehavior::substitution() const
-{
- return *(reinterpret_cast<const QSet<QUmlSubstitution *> *>(&_substitution));
-}
+ if (false /* <derivedexclusion-criteria> */) {
+ // Adjust subsetted properties
+ // removeRedefinitionContext(/* <derived-code> */);
-/*!
- The template parameter that exposes this element as a formal parameter.
- */
-QUmlClassifierTemplateParameter *QUmlBehavior::templateParameter() const
-{
- return reinterpret_cast<QUmlClassifierTemplateParameter *>(_templateParameter);
-}
+ // <derived-code>
-/*!
- The set of use cases for which this Classifier is the subject.
- */
-const QSet<QUmlUseCase *> QUmlBehavior::useCase() const
-{
- return *(reinterpret_cast<const QSet<QUmlUseCase *> *>(&_useCase));
+ // Adjust subsetted properties
+ if (context) {
+ addRedefinitionContext(context);
+ }
+ }
}
-// OWNED ATTRIBUTES [StructuredClassifier]
-
/*!
- References the connectors owned by the classifier.
+ Tells whether the behavior can be invoked while it is still executing from a previous invocation.
*/
-const QSet<QUmlConnector *> QUmlBehavior::ownedConnector() const
+bool
+QUmlBehavior::isReentrant() const
{
- return *(reinterpret_cast<const QSet<QUmlConnector *> *>(&_ownedConnector));
-}
+ // This is a read-write property
-/*!
- 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 *> QUmlBehavior::part() const
-{
- QSet<QUmlProperty *> r;
- foreach (UmlProperty *element, UmlStructuredClassifier::part())
- r.insert(reinterpret_cast<QUmlProperty *>(element));
- return r;
+ return _isReentrant;
}
-/*!
- References the roles that instances may play in this classifier.
- */
-const QSet<QUmlConnectableElement *> QUmlBehavior::role() const
+void QUmlBehavior::setReentrant(bool isReentrant)
{
- return *(reinterpret_cast<const QSet<QUmlConnectableElement *> *>(&_role));
-}
-
-// OWNED ATTRIBUTES [EncapsulatedClassifier]
+ // This is a read-write property
-/*!
- References a set of ports that an encapsulated classifier owns.
- */
-const QSet<QUmlPort *> QUmlBehavior::ownedPort() const
-{
- QSet<QUmlPort *> r;
- foreach (UmlPort *element, UmlEncapsulatedClassifier::ownedPort())
- r.insert(reinterpret_cast<QUmlPort *>(element));
- return r;
+ if (_isReentrant != isReentrant) {
+ _isReentrant = isReentrant;
+ }
}
-// OWNED ATTRIBUTES [BehavioredClassifier]
-
/*!
- A behavior specification that specifies the behavior of the classifier itself.
+ References a list of parameters to the behavior which describes the order and type of arguments that can be given when the behavior is invoked and of the values which will be returned when the behavior completes its execution.
*/
-QUmlBehavior *QUmlBehavior::classifierBehavior() const
+const QList<QUmlParameter *>
+QUmlBehavior::ownedParameter() const
{
- return reinterpret_cast<QUmlBehavior *>(_classifierBehavior);
-}
+ // This is a read-write association end
-/*!
- The set of InterfaceRealizations owned by the BehavioredClassifier. Interface realizations reference the Interfaces of which the BehavioredClassifier is an implementation.
- */
-const QSet<QUmlInterfaceRealization *> QUmlBehavior::interfaceRealization() const
-{
- return *(reinterpret_cast<const QSet<QUmlInterfaceRealization *> *>(&_interfaceRealization));
+ return _ownedParameter;
}
-/*!
- References behavior specifications owned by a classifier.
- */
-const QSet<QUmlBehavior *> QUmlBehavior::ownedBehavior() const
+void QUmlBehavior::addOwnedParameter(QUmlParameter *ownedParameter)
{
- return *(reinterpret_cast<const QSet<QUmlBehavior *> *>(&_ownedBehavior));
-}
+ // This is a read-write association end
-// OWNED ATTRIBUTES [Class]
+ if (!_ownedParameter.contains(ownedParameter)) {
+ _ownedParameter.append(ownedParameter);
+ if (ownedParameter->asQObject() && this->asQObject())
+ QObject::connect(ownedParameter->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeOwnedParameter(QObject *)));
+ ownedParameter->asQObject()->setParent(this->asQObject());
-/*!
- References the Extensions that specify additional properties of the metaclass. The property is derived from the extensions whose memberEnds are typed by the Class.
- */
-const QSet<QUmlExtension *> QUmlBehavior::extension() const
-{
- QSet<QUmlExtension *> r;
- foreach (UmlExtension *element, UmlClass::extension())
- r.insert(reinterpret_cast<QUmlExtension *>(element));
- return r;
+ // Adjust subsetted properties
+ addOwnedMember(ownedParameter);
+ }
}
-/*!
- 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.True when a class is abstract.
- */
-bool QUmlBehavior::isAbstract() const
+void QUmlBehavior::removeOwnedParameter(QUmlParameter *ownedParameter)
{
- return _isAbstract;
-}
+ // This is a read-write association end
-/*!
- Determines whether an object specified by this class is active or not. If true, then the owning class is referred to as an active class. If false, then such a class is referred to as a passive class.
- */
-bool QUmlBehavior::isActive() const
-{
- return _isActive;
-}
+ if (_ownedParameter.contains(ownedParameter)) {
+ _ownedParameter.removeAll(ownedParameter);
+ if (ownedParameter->asQObject())
+ ownedParameter->asQObject()->setParent(0);
-/*!
- References all the Classifiers that are defined (nested) within the Class.
- */
-const QList<QUmlClassifier *> QUmlBehavior::nestedClassifier() const
-{
- return *(reinterpret_cast<const QList<QUmlClassifier *> *>(&_nestedClassifier));
+ // Adjust subsetted properties
+ removeOwnedMember(ownedParameter);
+ }
}
/*!
- The attributes (i.e. the properties) owned by the class.
- */
-const QList<QUmlProperty *> QUmlBehavior::ownedAttribute() const
-{
- return *(reinterpret_cast<const QList<QUmlProperty *> *>(&_ownedAttribute));
-}
-
-/*!
- The operations owned by the class.
+ The ParameterSets owned by this Behavior.
*/
-const QList<QUmlOperation *> QUmlBehavior::ownedOperation() const
+const QSet<QUmlParameterSet *>
+QUmlBehavior::ownedParameterSet() const
{
- return *(reinterpret_cast<const QList<QUmlOperation *> *>(&_ownedOperation));
-}
+ // This is a read-write association end
-/*!
- Receptions that objects of this class are willing to accept.
- */
-const QSet<QUmlReception *> QUmlBehavior::ownedReception() const
-{
- return *(reinterpret_cast<const QSet<QUmlReception *> *>(&_ownedReception));
+ return _ownedParameterSet;
}
-/*!
- This gives the superclasses of a class.
- */
-const QSet<QUmlClass *> QUmlBehavior::superClass() const
+void QUmlBehavior::addOwnedParameterSet(QUmlParameterSet *ownedParameterSet)
{
- QSet<QUmlClass *> r;
- foreach (UmlClass *element, UmlClass::superClass())
- r.insert(reinterpret_cast<QUmlClass *>(element));
- return r;
-}
+ // This is a read-write association end
-// OWNED ATTRIBUTES [Behavior]
+ if (!_ownedParameterSet.contains(ownedParameterSet)) {
+ _ownedParameterSet.insert(ownedParameterSet);
+ if (ownedParameterSet->asQObject() && this->asQObject())
+ QObject::connect(ownedParameterSet->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeOwnedParameterSet(QObject *)));
+ ownedParameterSet->asQObject()->setParent(this->asQObject());
-/*!
- The classifier that is the context for the execution of the behavior. If the behavior is owned by a BehavioredClassifier, that classifier is the context. Otherwise, the context is the first BehavioredClassifier reached by following the chain of owner relationships. For example, following this algorithm, the context of an entry action in a state machine is the classifier that owns the state machine. The features of the context classifier as well as the elements visible to the context classifier are visible to the behavior.
- */
-QUmlBehavioredClassifier *QUmlBehavior::context() const
-{
- return reinterpret_cast<QUmlBehavioredClassifier *>(UmlBehavior::context());
+ // Adjust subsetted properties
+ addOwnedMember(ownedParameterSet);
+ }
}
-/*!
- Tells whether the behavior can be invoked while it is still executing from a previous invocation.
- */
-bool QUmlBehavior::isReentrant() const
+void QUmlBehavior::removeOwnedParameterSet(QUmlParameterSet *ownedParameterSet)
{
- return _isReentrant;
-}
+ // This is a read-write association end
-/*!
- References a list of parameters to the behavior which describes the order and type of arguments that can be given when the behavior is invoked and of the values which will be returned when the behavior completes its execution.
- */
-const QList<QUmlParameter *> QUmlBehavior::ownedParameter() const
-{
- return *(reinterpret_cast<const QList<QUmlParameter *> *>(&_ownedParameter));
-}
+ if (_ownedParameterSet.contains(ownedParameterSet)) {
+ _ownedParameterSet.remove(ownedParameterSet);
+ if (ownedParameterSet->asQObject())
+ ownedParameterSet->asQObject()->setParent(0);
-/*!
- The ParameterSets owned by this Behavior.
- */
-const QSet<QUmlParameterSet *> QUmlBehavior::ownedParameterSet() const
-{
- return *(reinterpret_cast<const QSet<QUmlParameterSet *> *>(&_ownedParameterSet));
+ // Adjust subsetted properties
+ removeOwnedMember(ownedParameterSet);
+ }
}
/*!
An optional set of Constraints specifying what is fulfilled after the execution of the behavior is completed, if its precondition was fulfilled before its invocation.
*/
-const QSet<QUmlConstraint *> QUmlBehavior::postcondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_postcondition));
-}
-
-/*!
- An optional set of Constraints specifying what must be fulfilled when the behavior is invoked.
- */
-const QSet<QUmlConstraint *> QUmlBehavior::precondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_precondition));
-}
-
-/*!
- References a behavior that this behavior redefines. A subtype of Behavior may redefine any other subtype of Behavior. If the behavior implements a behavioral feature, it replaces the redefined behavior. If the behavior is a classifier behavior, it extends the redefined behavior.
- */
-const QSet<QUmlBehavior *> QUmlBehavior::redefinedBehavior() const
-{
- return *(reinterpret_cast<const QSet<QUmlBehavior *> *>(&_redefinedBehavior));
-}
-
-/*!
- Designates a behavioral feature that the behavior implements. The behavioral feature must be owned by the classifier that owns the behavior or be inherited by it. The parameters of the behavioral feature and the implementing behavior must match. A behavior does not need to have a specification, in which case it either is the classifer behavior of a BehavioredClassifier or it can only be invoked by another behavior of the classifier.
- */
-QUmlBehavioralFeature *QUmlBehavior::specification() const
-{
- return reinterpret_cast<QUmlBehavioralFeature *>(_specification);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlBehavior::allOwnedElements() const
+const QSet<QUmlConstraint *>
+QUmlBehavior::postcondition() const
{
- QSet<QUmlElement *> r;
- foreach (UmlElement *element, UmlElement::allOwnedElements())
- r.insert(reinterpret_cast<QUmlElement *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- 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 QUmlBehavior::mustBeOwned() const
-{
- return UmlElement::mustBeOwned();
+ return _postcondition;
}
-// OPERATIONS [NamedElement]
-
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlBehavior::allNamespaces() const
+void QUmlBehavior::addPostcondition(QUmlConstraint *postcondition)
{
- 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 *> QUmlBehavior::allOwningPackages() const
-{
- 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 QUmlBehavior::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
-}
+ if (!_postcondition.contains(postcondition)) {
+ _postcondition.insert(postcondition);
+ if (postcondition->asQObject() && this->asQObject())
+ QObject::connect(postcondition->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removePostcondition(QObject *)));
+ postcondition->asQObject()->setParent(this->asQObject());
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlBehavior::separator() const
-{
- return UmlNamedElement::separator();
+ // Adjust subsetted properties
+ addOwnedRule(postcondition);
+ }
}
-// 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 *> QUmlBehavior::excludeCollisions(QSet<QUmlPackageableElement *> imps) const
+void QUmlBehavior::removePostcondition(QUmlConstraint *postcondition)
{
- 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> QUmlBehavior::getNamesOfMember(QUmlNamedElement *element) const
-{
- return UmlNamespace::getNamesOfMember(element);
-}
+ if (_postcondition.contains(postcondition)) {
+ _postcondition.remove(postcondition);
+ if (postcondition->asQObject())
+ postcondition->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 *> QUmlBehavior::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
+ removeOwnedRule(postcondition);
+ }
}
/*!
- The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it.
+ An optional set of Constraints specifying what must be fulfilled when the behavior is invoked.
*/
-bool QUmlBehavior::membersAreDistinguishable() const
+const QSet<QUmlConstraint *>
+QUmlBehavior::precondition() const
{
- return UmlNamespace::membersAreDistinguishable();
-}
+ // This is a read-write association end
-// 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 QUmlBehavior::isCompatibleWith(QUmlParameterableElement *p) const
-{
- return UmlParameterableElement::isCompatibleWith(p);
+ return _precondition;
}
-/*!
- The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter.
- */
-bool QUmlBehavior::isTemplateParameter() const
+void QUmlBehavior::addPrecondition(QUmlConstraint *precondition)
{
- return UmlParameterableElement::isTemplateParameter();
-}
+ // This is a read-write association end
-// OPERATIONS [Type]
-// OPERATIONS [RedefinableElement]
+ if (!_precondition.contains(precondition)) {
+ _precondition.insert(precondition);
+ if (precondition->asQObject() && this->asQObject())
+ QObject::connect(precondition->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removePrecondition(QObject *)));
+ precondition->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 QUmlBehavior::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
+ // Adjust subsetted properties
+ addOwnedRule(precondition);
+ }
}
-/*!
- 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 QUmlBehavior::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
+void QUmlBehavior::removePrecondition(QUmlConstraint *precondition)
{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
+ // This is a read-write association end
-// OPERATIONS [TemplateableElement]
+ if (_precondition.contains(precondition)) {
+ _precondition.remove(precondition);
+ if (precondition->asQObject())
+ precondition->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 *> QUmlBehavior::parameterableElements() const
-{
- QSet<QUmlParameterableElement *> r;
- foreach (UmlParameterableElement *element, UmlTemplateableElement::parameterableElements())
- r.insert(reinterpret_cast<QUmlParameterableElement *>(element));
- return r;
+ // Adjust subsetted properties
+ removeOwnedRule(precondition);
+ }
}
-// 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.
+ References a behavior that this behavior redefines. A subtype of Behavior may redefine any other subtype of Behavior. If the behavior implements a behavioral feature, it replaces the redefined behavior. If the behavior is a classifier behavior, it extends the redefined behavior.
*/
-QSet<QUmlFeature *> QUmlBehavior::allFeatures() const
+const QSet<QUmlBehavior *>
+QUmlBehavior::redefinedBehavior() 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 *> QUmlBehavior::allParents() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::allParents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
+ return _redefinedBehavior;
}
-/*!
- 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 QUmlBehavior::conformsTo(QUmlClassifier *other) const
+void QUmlBehavior::addRedefinedBehavior(QUmlBehavior *redefinedBehavior)
{
- 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 QUmlBehavior::hasVisibilityOf(QUmlNamedElement *n) const
-{
- return UmlClassifier::hasVisibilityOf(n);
-}
+ if (!_redefinedBehavior.contains(redefinedBehavior)) {
+ _redefinedBehavior.insert(redefinedBehavior);
+ if (redefinedBehavior->asQObject() && this->asQObject())
+ QObject::connect(redefinedBehavior->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeRedefinedBehavior(QObject *)));
-/*!
- 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 *> QUmlBehavior::inheritableMembers(QUmlClassifier *c) const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClassifier::inheritableMembers(c))
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
+ // Adjust subsetted properties
+ addRedefinedClassifier(redefinedBehavior);
+ }
}
-/*!
- The query isTemplate() returns whether this templateable element is actually a template.
- */
-bool QUmlBehavior::isTemplate() const
+void QUmlBehavior::removeRedefinedBehavior(QUmlBehavior *redefinedBehavior)
{
- return UmlClassifier::isTemplate();
-}
+ // This is a read-write association end
-/*!
- 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 QUmlBehavior::maySpecializeType(QUmlClassifier *c) const
-{
- return UmlClassifier::maySpecializeType(c);
-}
+ if (_redefinedBehavior.contains(redefinedBehavior)) {
+ _redefinedBehavior.remove(redefinedBehavior);
-/*!
- The query parents() gives all of the immediate ancestors of a generalized Classifier.
- */
-QSet<QUmlClassifier *> QUmlBehavior::parents() const
-{
- QSet<QUmlClassifier *> r;
- foreach (UmlClassifier *element, UmlClassifier::parents())
- r.insert(reinterpret_cast<QUmlClassifier *>(element));
- return r;
+ // Adjust subsetted properties
+ removeRedefinedClassifier(redefinedBehavior);
+ }
}
-// OPERATIONS [Class]
-
/*!
- The inherit operation is overridden to exclude redefined properties.
+ Designates a behavioral feature that the behavior implements. The behavioral feature must be owned by the classifier that owns the behavior or be inherited by it. The parameters of the behavioral feature and the implementing behavior must match. A behavior does not need to have a specification, in which case it either is the classifer behavior of a BehavioredClassifier or it can only be invoked by another behavior of the classifier.
*/
-QSet<QUmlNamedElement *> QUmlBehavior::inherit(QSet<QUmlNamedElement *> inhs) const
-{
- QSet<QUmlNamedElement *> r;
- foreach (UmlNamedElement *element, UmlClass::inherit(*(reinterpret_cast<QSet<UmlNamedElement *> *>(&inhs))))
- r.insert(reinterpret_cast<QUmlNamedElement *>(element));
- return r;
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlBehavior::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlBehavior::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlBehavior::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlBehavior::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlBehavior::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlBehavior::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-// SLOTS FOR OWNED ATTRIBUTES [Namespace]
-
-void QUmlBehavior::addElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::addElementImport(elementImport);
-}
-
-void QUmlBehavior::removeElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::removeElementImport(elementImport);
-}
-
-void QUmlBehavior::addOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::addOwnedRule(ownedRule);
-}
-
-void QUmlBehavior::removeOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::removeOwnedRule(ownedRule);
-}
-
-void QUmlBehavior::addPackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::addPackageImport(packageImport);
-}
-
-void QUmlBehavior::removePackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::removePackageImport(packageImport);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ParameterableElement]
-
-void QUmlBehavior::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter)
-{
- UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter);
-}
-// SLOTS FOR OWNED ATTRIBUTES [PackageableElement]
-
-void QUmlBehavior::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlPackageableElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Type]
-
-void QUmlBehavior::setPackage(QUmlPackage *package)
-{
- UmlType::setPackage(package);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlBehavior::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [TemplateableElement]
-
-void QUmlBehavior::addTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::addTemplateBinding(templateBinding);
-}
-
-void QUmlBehavior::removeTemplateBinding(UmlTemplateBinding *templateBinding)
-{
- UmlTemplateableElement::removeTemplateBinding(templateBinding);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Classifier]
-
-void QUmlBehavior::addCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::addCollaborationUse(collaborationUse);
-}
-
-void QUmlBehavior::removeCollaborationUse(UmlCollaborationUse *collaborationUse)
-{
- UmlClassifier::removeCollaborationUse(collaborationUse);
-}
-
-void QUmlBehavior::addGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::addGeneralization(generalization);
-}
-
-void QUmlBehavior::removeGeneralization(UmlGeneralization *generalization)
-{
- UmlClassifier::removeGeneralization(generalization);
-}
-
-void QUmlBehavior::setFinalSpecialization(bool isFinalSpecialization)
-{
- UmlClassifier::setFinalSpecialization(isFinalSpecialization);
-}
-
-void QUmlBehavior::setOwnedTemplateSignature(QUmlRedefinableTemplateSignature *ownedTemplateSignature)
-{
- UmlClassifier::setOwnedTemplateSignature(ownedTemplateSignature);
-}
-
-void QUmlBehavior::addOwnedUseCase(UmlUseCase *ownedUseCase)
-{
- UmlClassifier::addOwnedUseCase(ownedUseCase);
-}
-
-void QUmlBehavior::removeOwnedUseCase(UmlUseCase *ownedUseCase)
+QUmlBehavioralFeature *
+QUmlBehavior::specification() const
{
- UmlClassifier::removeOwnedUseCase(ownedUseCase);
-}
-
-void QUmlBehavior::addPowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::addPowertypeExtent(powertypeExtent);
-}
+ // This is a read-write association end
-void QUmlBehavior::removePowertypeExtent(UmlGeneralizationSet *powertypeExtent)
-{
- UmlClassifier::removePowertypeExtent(powertypeExtent);
-}
-
-void QUmlBehavior::addRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::addRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlBehavior::removeRedefinedClassifier(UmlClassifier *redefinedClassifier)
-{
- UmlClassifier::removeRedefinedClassifier(redefinedClassifier);
-}
-
-void QUmlBehavior::setRepresentation(QUmlCollaborationUse *representation)
-{
- UmlClassifier::setRepresentation(representation);
-}
-
-void QUmlBehavior::addSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::addSubstitution(substitution);
-}
-
-void QUmlBehavior::removeSubstitution(UmlSubstitution *substitution)
-{
- UmlClassifier::removeSubstitution(substitution);
-}
-
-void QUmlBehavior::setTemplateParameter(QUmlClassifierTemplateParameter *templateParameter)
-{
- UmlClassifier::setTemplateParameter(templateParameter);
-}
-
-void QUmlBehavior::addUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::addUseCase(useCase);
-}
-
-void QUmlBehavior::removeUseCase(UmlUseCase *useCase)
-{
- UmlClassifier::removeUseCase(useCase);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [StructuredClassifier]
-
-void QUmlBehavior::addOwnedConnector(UmlConnector *ownedConnector)
-{
- UmlStructuredClassifier::addOwnedConnector(ownedConnector);
-}
-
-void QUmlBehavior::removeOwnedConnector(UmlConnector *ownedConnector)
-{
- UmlStructuredClassifier::removeOwnedConnector(ownedConnector);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [EncapsulatedClassifier]
-
-// SLOTS FOR OWNED ATTRIBUTES [BehavioredClassifier]
-
-void QUmlBehavior::setClassifierBehavior(QUmlBehavior *classifierBehavior)
-{
- UmlBehavioredClassifier::setClassifierBehavior(classifierBehavior);
-}
-
-void QUmlBehavior::addInterfaceRealization(UmlInterfaceRealization *interfaceRealization)
-{
- UmlBehavioredClassifier::addInterfaceRealization(interfaceRealization);
-}
-
-void QUmlBehavior::removeInterfaceRealization(UmlInterfaceRealization *interfaceRealization)
-{
- UmlBehavioredClassifier::removeInterfaceRealization(interfaceRealization);
-}
-
-void QUmlBehavior::addOwnedBehavior(UmlBehavior *ownedBehavior)
-{
- UmlBehavioredClassifier::addOwnedBehavior(ownedBehavior);
-}
-
-void QUmlBehavior::removeOwnedBehavior(UmlBehavior *ownedBehavior)
-{
- UmlBehavioredClassifier::removeOwnedBehavior(ownedBehavior);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Class]
-
-void QUmlBehavior::setAbstract(bool isAbstract)
-{
- UmlClass::setAbstract(isAbstract);
-}
-
-void QUmlBehavior::setActive(bool isActive)
-{
- UmlClass::setActive(isActive);
-}
-
-void QUmlBehavior::addNestedClassifier(UmlClassifier *nestedClassifier)
-{
- UmlClass::addNestedClassifier(nestedClassifier);
-}
-
-void QUmlBehavior::removeNestedClassifier(UmlClassifier *nestedClassifier)
-{
- UmlClass::removeNestedClassifier(nestedClassifier);
-}
-
-void QUmlBehavior::addOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlClass::addOwnedAttribute(ownedAttribute);
-}
-
-void QUmlBehavior::removeOwnedAttribute(UmlProperty *ownedAttribute)
-{
- UmlClass::removeOwnedAttribute(ownedAttribute);
-}
-
-void QUmlBehavior::addOwnedOperation(UmlOperation *ownedOperation)
-{
- UmlClass::addOwnedOperation(ownedOperation);
-}
-
-void QUmlBehavior::removeOwnedOperation(UmlOperation *ownedOperation)
-{
- UmlClass::removeOwnedOperation(ownedOperation);
-}
-
-void QUmlBehavior::addOwnedReception(UmlReception *ownedReception)
-{
- UmlClass::addOwnedReception(ownedReception);
-}
-
-void QUmlBehavior::removeOwnedReception(UmlReception *ownedReception)
-{
- UmlClass::removeOwnedReception(ownedReception);
-}
-
-void QUmlBehavior::addSuperClass(UmlClass *superClass)
-{
- UmlClass::addSuperClass(superClass);
-}
-
-void QUmlBehavior::removeSuperClass(UmlClass *superClass)
-{
- UmlClass::removeSuperClass(superClass);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Behavior]
-
-void QUmlBehavior::setReentrant(bool isReentrant)
-{
- UmlBehavior::setReentrant(isReentrant);
-}
-
-void QUmlBehavior::addOwnedParameter(UmlParameter *ownedParameter)
-{
- UmlBehavior::addOwnedParameter(ownedParameter);
-}
-
-void QUmlBehavior::removeOwnedParameter(UmlParameter *ownedParameter)
-{
- UmlBehavior::removeOwnedParameter(ownedParameter);
-}
-
-void QUmlBehavior::addOwnedParameterSet(UmlParameterSet *ownedParameterSet)
-{
- UmlBehavior::addOwnedParameterSet(ownedParameterSet);
-}
-
-void QUmlBehavior::removeOwnedParameterSet(UmlParameterSet *ownedParameterSet)
-{
- UmlBehavior::removeOwnedParameterSet(ownedParameterSet);
-}
-
-void QUmlBehavior::addPostcondition(UmlConstraint *postcondition)
-{
- UmlBehavior::addPostcondition(postcondition);
-}
-
-void QUmlBehavior::removePostcondition(UmlConstraint *postcondition)
-{
- UmlBehavior::removePostcondition(postcondition);
-}
-
-void QUmlBehavior::addPrecondition(UmlConstraint *precondition)
-{
- UmlBehavior::addPrecondition(precondition);
-}
-
-void QUmlBehavior::removePrecondition(UmlConstraint *precondition)
-{
- UmlBehavior::removePrecondition(precondition);
-}
-
-void QUmlBehavior::addRedefinedBehavior(UmlBehavior *redefinedBehavior)
-{
- UmlBehavior::addRedefinedBehavior(redefinedBehavior);
-}
-
-void QUmlBehavior::removeRedefinedBehavior(UmlBehavior *redefinedBehavior)
-{
- UmlBehavior::removeRedefinedBehavior(redefinedBehavior);
+ return _specification;
}
void QUmlBehavior::setSpecification(QUmlBehavioralFeature *specification)
{
- UmlBehavior::setSpecification(specification);
-}
+ // This is a read-write association end
-QT_END_NAMESPACE
+ if (_specification != specification) {
+ _specification = specification;
+ if (specification->asQObject() && this->asQObject())
+ QObject::connect(specification->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setSpecification()));
+ }
+}