summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlreception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlreception.cpp')
-rw-r--r--src/uml/qumlreception.cpp532
1 files changed, 24 insertions, 508 deletions
diff --git a/src/uml/qumlreception.cpp b/src/uml/qumlreception.cpp
index 5fc3c65a..c5fd77ae 100644
--- a/src/uml/qumlreception.cpp
+++ b/src/uml/qumlreception.cpp
@@ -40,537 +40,53 @@
****************************************************************************/
#include "qumlreception.h"
-#include <QtUml/QUmlBehavior>
-#include <QtUml/QUmlClassifier>
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlConstraint>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlElementImport>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlPackageableElement>
-#include <QtUml/QUmlPackageImport>
-#include <QtUml/QUmlParameter>
-#include <QtUml/QUmlParameterSet>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlSignal>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlType>
+#include "private/qumlreceptionobject_p.h"
-QT_BEGIN_NAMESPACE
+#include <QtUml/QUmlSignal>
/*!
- \class UmlReception
+ \class QUmlReception
\inmodule QtUml
\brief A reception is a declaration stating that a classifier is prepared to react to the receipt of a signal. A reception designates a signal and specifies the expected behavioral response. The details of handling a signal are specified by the behavior associated with the reception or the classifier itself.
*/
-
-QUmlReception::QUmlReception(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlReception::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlReception::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlReception::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlReception::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlReception::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlReception::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlReception::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 QUmlReception::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlReception::visibility() const
-{
- return _visibility;
-}
-
-// OWNED ATTRIBUTES [Namespace]
-
-/*!
- References the ElementImports owned by the Namespace.
- */
-const QSet<QUmlElementImport *> QUmlReception::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 *> QUmlReception::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 *> QUmlReception::member() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_member));
-}
-
-/*!
- A collection of NamedElements owned by the Namespace.
- */
-const QSet<QUmlNamedElement *> QUmlReception::ownedMember() const
+QUmlReception::QUmlReception(bool createQObject) :
+ _signal(0)
{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_ownedMember));
+ if (createQObject)
+ _qObject = new QUmlReceptionObject(this);
}
-/*!
- Specifies a set of Constraints owned by this Namespace.
- */
-const QSet<QUmlConstraint *> QUmlReception::ownedRule() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_ownedRule));
-}
-
-/*!
- References the PackageImports owned by the Namespace.
- */
-const QSet<QUmlPackageImport *> QUmlReception::packageImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlPackageImport *> *>(&_packageImport));
-}
-
-// 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 QUmlReception::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlReception::redefinedElement() const
+QUmlReception::~QUmlReception()
{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlReception::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [Feature]
-
-/*!
- The Classifiers that have this Feature as a feature.
- */
-const QSet<QUmlClassifier *> QUmlReception::featuringClassifier() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_featuringClassifier));
-}
-
-/*!
- Specifies whether this feature characterizes individual instances classified by the classifier (false) or the classifier itself (true).
- */
-bool QUmlReception::isStatic() const
-{
- return _isStatic;
-}
-
-// OWNED ATTRIBUTES [BehavioralFeature]
-
-/*!
- Specifies the semantics of concurrent calls to the same passive instance (i.e., an instance originating from a class with isActive being false). Active instances control access to their own behavioral features.
- */
-QtUml::CallConcurrencyKind QUmlReception::concurrency() const
-{
- return _concurrency;
-}
-
-/*!
- If true, then the behavioral feature does not have an implementation, and one must be supplied by a more specific element. If false, the behavioral feature must have an implementation in the classifier or one must be inherited from a more general element.
- */
-bool QUmlReception::isAbstract() const
-{
- return _isAbstract;
-}
-
-/*!
- A behavioral description that implements the behavioral feature. There may be at most one behavior for a particular pairing of a classifier (as owner of the behavior) and a behavioral feature (as specification of the behavior).
- */
-const QSet<QUmlBehavior *> QUmlReception::method() const
-{
- return *(reinterpret_cast<const QSet<QUmlBehavior *> *>(&_method));
-}
-
-/*!
- Specifies the ordered set of formal parameters of this BehavioralFeature.
- */
-const QList<QUmlParameter *> QUmlReception::ownedParameter() const
-{
- return *(reinterpret_cast<const QList<QUmlParameter *> *>(&_ownedParameter));
-}
-
-/*!
- The ParameterSets owned by this BehavioralFeature.
- */
-const QSet<QUmlParameterSet *> QUmlReception::ownedParameterSet() const
-{
- return *(reinterpret_cast<const QSet<QUmlParameterSet *> *>(&_ownedParameterSet));
-}
-
-/*!
- References the Types representing exceptions that may be raised during an invocation of this feature.
- */
-const QSet<QUmlType *> QUmlReception::raisedException() const
-{
- return *(reinterpret_cast<const QSet<QUmlType *> *>(&_raisedException));
-}
-
-// OWNED ATTRIBUTES [Reception]
+// OWNED ATTRIBUTES
/*!
The signal that this reception handles.
*/
-QUmlSignal *QUmlReception::signal() const
-{
- return reinterpret_cast<QUmlSignal *>(_signal);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlReception::allOwnedElements() const
+QUmlSignal *
+QUmlReception::signal() 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 QUmlReception::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 *> QUmlReception::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 *> QUmlReception::allOwningPackages() const
-{
- QSet<QUmlPackage *> r;
- foreach (UmlPackage *element, UmlNamedElement::allOwningPackages())
- r.insert(reinterpret_cast<QUmlPackage *>(element));
- return r;
-}
-
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlReception::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 *> QUmlReception::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> QUmlReception::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 *> QUmlReception::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 QUmlReception::membersAreDistinguishable() const
-{
- return UmlNamespace::membersAreDistinguishable();
-}
-
-// 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 QUmlReception::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
-}
-
-/*!
- 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 QUmlReception::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
-{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
-
-// OPERATIONS [BehavioralFeature]
-
-/*!
- The query isDistinguishableFrom() determines whether two BehavioralFeatures may coexist in the same Namespace. It specifies that they have to have different signatures.
- */
-bool QUmlReception::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlBehavioralFeature::isDistinguishableFrom(n, ns);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlReception::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlReception::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlReception::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
+ // This is a read-write association end
-void QUmlReception::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlReception::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlReception::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlReception::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Namespace]
-
-void QUmlReception::addElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::addElementImport(elementImport);
-}
-
-void QUmlReception::removeElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::removeElementImport(elementImport);
-}
-
-void QUmlReception::addOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::addOwnedRule(ownedRule);
-}
-
-void QUmlReception::removeOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::removeOwnedRule(ownedRule);
-}
-
-void QUmlReception::addPackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::addPackageImport(packageImport);
-}
-
-void QUmlReception::removePackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::removePackageImport(packageImport);
+ return _signal;
}
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlReception::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Feature]
-
-void QUmlReception::setStatic(bool isStatic)
-{
- UmlFeature::setStatic(isStatic);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [BehavioralFeature]
-
-void QUmlReception::setConcurrency(QtUml::CallConcurrencyKind concurrency)
-{
- UmlBehavioralFeature::setConcurrency(concurrency);
-}
-
-void QUmlReception::setAbstract(bool isAbstract)
-{
- UmlBehavioralFeature::setAbstract(isAbstract);
-}
-
-void QUmlReception::addMethod(UmlBehavior *method)
-{
- UmlBehavioralFeature::addMethod(method);
-}
-
-void QUmlReception::removeMethod(UmlBehavior *method)
-{
- UmlBehavioralFeature::removeMethod(method);
-}
-
-void QUmlReception::addOwnedParameter(UmlParameter *ownedParameter)
-{
- UmlBehavioralFeature::addOwnedParameter(ownedParameter);
-}
-
-void QUmlReception::removeOwnedParameter(UmlParameter *ownedParameter)
-{
- UmlBehavioralFeature::removeOwnedParameter(ownedParameter);
-}
-
-void QUmlReception::addOwnedParameterSet(UmlParameterSet *ownedParameterSet)
-{
- UmlBehavioralFeature::addOwnedParameterSet(ownedParameterSet);
-}
-
-void QUmlReception::removeOwnedParameterSet(UmlParameterSet *ownedParameterSet)
-{
- UmlBehavioralFeature::removeOwnedParameterSet(ownedParameterSet);
-}
-
-void QUmlReception::addRaisedException(UmlType *raisedException)
-{
- UmlBehavioralFeature::addRaisedException(raisedException);
-}
-
-void QUmlReception::removeRaisedException(UmlType *raisedException)
-{
- UmlBehavioralFeature::removeRaisedException(raisedException);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Reception]
-
void QUmlReception::setSignal(QUmlSignal *signal)
{
- UmlReception::setSignal(signal);
-}
+ // This is a read-write association end
-QT_END_NAMESPACE
+ if (_signal != signal) {
+ _signal = signal;
+ if (signal->asQObject() && this->asQObject())
+ QObject::connect(signal->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setSignal()));
+ }
+}