summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlstructuredactivitynode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlstructuredactivitynode.cpp')
-rw-r--r--src/uml/qumlstructuredactivitynode.cpp817
1 files changed, 182 insertions, 635 deletions
diff --git a/src/uml/qumlstructuredactivitynode.cpp b/src/uml/qumlstructuredactivitynode.cpp
index e45c1069..17c02d07 100644
--- a/src/uml/qumlstructuredactivitynode.cpp
+++ b/src/uml/qumlstructuredactivitynode.cpp
@@ -40,760 +40,307 @@
****************************************************************************/
#include "qumlstructuredactivitynode.h"
+#include "private/qumlstructuredactivitynodeobject_p.h"
+
#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
-#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
-#include <QtUml/QUmlActivityPartition>
-#include <QtUml/QUmlClassifier>
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlConstraint>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlElementImport>
-#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-#include <QtUml/QUmlInterruptibleActivityRegion>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlPackageableElement>
-#include <QtUml/QUmlPackageImport>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlVariable>
-QT_BEGIN_NAMESPACE
-
/*!
- \class UmlStructuredActivityNode
+ \class QUmlStructuredActivityNode
\inmodule QtUml
\brief A structured activity node is an executable activity node that may have an expansion into subordinate nodes as an activity group. The subordinate nodes must belong to only one structured activity node, although they may be nested.Because of the concurrent nature of the execution of actions within and across activities, it can be difficult to guarantee the consistent access and modification of object memory. In order to avoid race conditions or other concurrency-related problems, it is sometimes necessary to isolate the effects of a group of actions from the effects of actions outside the group. This may be indicated by setting the mustIsolate attribute to true on a structured activity node. If a structured activity node is "isolated," then any object used by an action within the node cannot be accessed by any action outside the node until the structured activity node as a whole completes. Any concurrent actions that would result in accessing such objects are required to have their execution deferred until the completion of the node.
*/
-
-QUmlStructuredActivityNode::QUmlStructuredActivityNode(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlStructuredActivityNode::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlStructuredActivityNode::ownedElement() const
+QUmlStructuredActivityNode::QUmlStructuredActivityNode(bool createQObject) :
+ _activity(0),
+ _mustIsolate(false)
{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
+ if (createQObject)
+ _qObject = new QUmlStructuredActivityNodeObject(this);
}
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlStructuredActivityNode::owner() const
+QUmlStructuredActivityNode::~QUmlStructuredActivityNode()
{
- return reinterpret_cast<QUmlElement *>(_owner);
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-// OWNED ATTRIBUTES [NamedElement]
+// OWNED ATTRIBUTES
/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlStructuredActivityNode::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlStructuredActivityNode::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlStructuredActivityNode::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlStructuredActivityNode::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 QUmlStructuredActivityNode::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlStructuredActivityNode::visibility() const
-{
- return _visibility;
-}
-
-// 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 QUmlStructuredActivityNode::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlStructuredActivityNode::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlStructuredActivityNode::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [ActivityNode]
-
-/*!
- Groups containing the node.
- */
-const QSet<QUmlActivityGroup *> QUmlStructuredActivityNode::inGroup() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityGroup *> *>(&_inGroup));
-}
-
-/*!
- Interruptible regions containing the node.
+ Activity immediately containing the node.
*/
-const QSet<QUmlInterruptibleActivityRegion *> QUmlStructuredActivityNode::inInterruptibleRegion() const
+QUmlActivity *
+QUmlStructuredActivityNode::activity() const
{
- return *(reinterpret_cast<const QSet<QUmlInterruptibleActivityRegion *> *>(&_inInterruptibleRegion));
-}
+ // This is a read-write association end
-/*!
- Partitions containing the node.
- */
-const QSet<QUmlActivityPartition *> QUmlStructuredActivityNode::inPartition() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityPartition *> *>(&_inPartition));
+ return _activity;
}
-/*!
- Structured activity node containing the node.
- */
-QUmlStructuredActivityNode *QUmlStructuredActivityNode::inStructuredNode() const
+void QUmlStructuredActivityNode::setActivity(QUmlActivity *activity)
{
- return reinterpret_cast<QUmlStructuredActivityNode *>(_inStructuredNode);
-}
+ // This is a read-write association end
-/*!
- Edges that have the node as target.
- */
-const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::incoming() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_incoming));
+ if (_activity != activity) {
+ _activity = activity;
+ if (activity->asQObject() && this->asQObject())
+ QObject::connect(activity->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setActivity()));
+ }
}
/*!
- Edges that have the node as source.
+ Edges immediately contained in the structured node.
*/
-const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::outgoing() const
+const QSet<QUmlActivityEdge *>
+QUmlStructuredActivityNode::edge() const
{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_outgoing));
-}
+ // This is a read-write association end
-/*!
- Inherited nodes replaced by this node in a specialization of the activity.
- */
-const QSet<QUmlActivityNode *> QUmlStructuredActivityNode::redefinedNode() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_redefinedNode));
+ return _edge;
}
-// OWNED ATTRIBUTES [ExecutableNode]
-
-/*!
- A set of exception handlers that are examined if an uncaught exception propagates to the outer level of the executable node.
- */
-const QSet<QUmlExceptionHandler *> QUmlStructuredActivityNode::handler() const
+void QUmlStructuredActivityNode::addEdge(QUmlActivityEdge *edge)
{
- return *(reinterpret_cast<const QSet<QUmlExceptionHandler *> *>(&_handler));
-}
+ // This is a read-write association end
-// OWNED ATTRIBUTES [Action]
+ if (!_edge.contains(edge)) {
+ _edge.insert(edge);
+ if (edge->asQObject() && this->asQObject())
+ QObject::connect(edge->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeEdge(QObject *)));
+ edge->asQObject()->setParent(this->asQObject());
-/*!
- The classifier that owns the behavior of which this action is a part.
- */
-QUmlClassifier *QUmlStructuredActivityNode::context() const
-{
- return reinterpret_cast<QUmlClassifier *>(UmlAction::context());
-}
+ // Adjust subsetted properties
+ addContainedEdge(edge);
+ addOwnedElement(edge);
-/*!
- The ordered set of input pins connected to the Action. These are among the total set of inputs.
- */
-const QList<QUmlInputPin *> QUmlStructuredActivityNode::input() const
-{
- return *(reinterpret_cast<const QList<QUmlInputPin *> *>(&_input));
+ // Adjust opposite properties
+ if (edge) {
+ edge->setInStructuredNode(this);
+ }
+ }
}
-/*!
- If true, the action can begin a new, concurrent execution, even if there is already another execution of the action ongoing. If false, the action cannot begin a new execution until any previous execution has completed.
- */
-bool QUmlStructuredActivityNode::isLocallyReentrant() const
+void QUmlStructuredActivityNode::removeEdge(QUmlActivityEdge *edge)
{
- return _isLocallyReentrant;
-}
+ // This is a read-write association end
-/*!
- Constraint that must be satisfied when executed is completed.
- */
-const QSet<QUmlConstraint *> QUmlStructuredActivityNode::localPostcondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_localPostcondition));
-}
+ if (_edge.contains(edge)) {
+ _edge.remove(edge);
+ if (edge->asQObject())
+ edge->asQObject()->setParent(0);
-/*!
- Constraint that must be satisfied when execution is started.
- */
-const QSet<QUmlConstraint *> QUmlStructuredActivityNode::localPrecondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_localPrecondition));
-}
+ // Adjust subsetted properties
+ removeContainedEdge(edge);
+ removeOwnedElement(edge);
-/*!
- The ordered set of output pins connected to the Action. The action places its results onto pins in this set.
- */
-const QList<QUmlOutputPin *> QUmlStructuredActivityNode::output() const
-{
- return *(reinterpret_cast<const QList<QUmlOutputPin *> *>(&_output));
+ // Adjust opposite properties
+ if (edge) {
+ edge->setInStructuredNode(0);
+ }
+ }
}
-// OWNED ATTRIBUTES [Namespace]
-
/*!
- References the ElementImports owned by the Namespace.
+ If true, then the actions in the node execute in isolation from actions outside the node.
*/
-const QSet<QUmlElementImport *> QUmlStructuredActivityNode::elementImport() const
+bool
+QUmlStructuredActivityNode::mustIsolate() const
{
- return *(reinterpret_cast<const QSet<QUmlElementImport *> *>(&_elementImport));
-}
+ // This is a read-write property
-/*!
- References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports.
- */
-const QSet<QUmlPackageableElement *> QUmlStructuredActivityNode::importedMember() const
-{
- QSet<QUmlPackageableElement *> r;
- foreach (UmlPackageableElement *element, UmlNamespace::importedMember())
- r.insert(reinterpret_cast<QUmlPackageableElement *>(element));
- return r;
+ return _mustIsolate;
}
-/*!
- A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.
- */
-const QSet<QUmlNamedElement *> QUmlStructuredActivityNode::member() const
+void QUmlStructuredActivityNode::setMustIsolate(bool mustIsolate)
{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_member));
-}
+ // This is a read-write property
-/*!
- A collection of NamedElements owned by the Namespace.
- */
-const QSet<QUmlNamedElement *> QUmlStructuredActivityNode::ownedMember() const
-{
- return *(reinterpret_cast<const QSet<QUmlNamedElement *> *>(&_ownedMember));
+ if (_mustIsolate != mustIsolate) {
+ _mustIsolate = mustIsolate;
+ }
}
/*!
- Specifies a set of Constraints owned by this Namespace.
+ Nodes immediately contained in the group.
*/
-const QSet<QUmlConstraint *> QUmlStructuredActivityNode::ownedRule() const
+const QSet<QUmlActivityNode *>
+QUmlStructuredActivityNode::node() const
{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_ownedRule));
-}
+ // This is a read-write association end
-/*!
- References the PackageImports owned by the Namespace.
- */
-const QSet<QUmlPackageImport *> QUmlStructuredActivityNode::packageImport() const
-{
- return *(reinterpret_cast<const QSet<QUmlPackageImport *> *>(&_packageImport));
+ return _node;
}
-// OWNED ATTRIBUTES [ActivityGroup]
-
-/*!
- Edges immediately contained in the group.
- */
-const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::containedEdge() const
+void QUmlStructuredActivityNode::addNode(QUmlActivityNode *node)
{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_containedEdge));
-}
+ // This is a read-write association end
-/*!
- Nodes immediately contained in the group.
- */
-const QSet<QUmlActivityNode *> QUmlStructuredActivityNode::containedNode() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_containedNode));
-}
+ if (!_node.contains(node)) {
+ _node.insert(node);
+ if (node->asQObject() && this->asQObject())
+ QObject::connect(node->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeNode(QObject *)));
+ node->asQObject()->setParent(this->asQObject());
-/*!
- Groups immediately contained in the group.
- */
-const QSet<QUmlActivityGroup *> QUmlStructuredActivityNode::subgroup() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityGroup *> *>(&_subgroup));
-}
+ // Adjust subsetted properties
+ addContainedNode(node);
+ addOwnedElement(node);
-/*!
- Group immediately containing the group.
- */
-QUmlActivityGroup *QUmlStructuredActivityNode::superGroup() const
-{
- return reinterpret_cast<QUmlActivityGroup *>(_superGroup);
+ // Adjust opposite properties
+ if (node) {
+ node->setInStructuredNode(this);
+ }
+ }
}
-// OWNED ATTRIBUTES [StructuredActivityNode]
-
-/*!
- Activity immediately containing the node.
- */
-QUmlActivity *QUmlStructuredActivityNode::activity() const
+void QUmlStructuredActivityNode::removeNode(QUmlActivityNode *node)
{
- return reinterpret_cast<QUmlActivity *>(_activity);
-}
+ // This is a read-write association end
-/*!
- Edges immediately contained in the structured node.
- */
-const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::edge() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_edge));
-}
+ if (_node.contains(node)) {
+ _node.remove(node);
+ if (node->asQObject())
+ node->asQObject()->setParent(0);
-/*!
- If true, then the actions in the node execute in isolation from actions outside the node.
- */
-bool QUmlStructuredActivityNode::mustIsolate() const
-{
- return _mustIsolate;
-}
+ // Adjust subsetted properties
+ removeContainedNode(node);
+ removeOwnedElement(node);
-/*!
- Nodes immediately contained in the group.
- */
-const QSet<QUmlActivityNode *> QUmlStructuredActivityNode::node() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_node));
+ // Adjust opposite properties
+ if (node) {
+ node->setInStructuredNode(0);
+ }
+ }
}
-const QSet<QUmlInputPin *> QUmlStructuredActivityNode::structuredNodeInput() const
+const QSet<QUmlInputPin *>
+QUmlStructuredActivityNode::structuredNodeInput() const
{
- return *(reinterpret_cast<const QSet<QUmlInputPin *> *>(&_structuredNodeInput));
-}
+ // This is a read-write association end
-const QSet<QUmlOutputPin *> QUmlStructuredActivityNode::structuredNodeOutput() const
-{
- return *(reinterpret_cast<const QSet<QUmlOutputPin *> *>(&_structuredNodeOutput));
+ return _structuredNodeInput;
}
-/*!
- A variable defined in the scope of the structured activity node. It has no value and may not be accessed
- */
-const QSet<QUmlVariable *> QUmlStructuredActivityNode::variable() const
+void QUmlStructuredActivityNode::addStructuredNodeInput(QUmlInputPin *structuredNodeInput)
{
- return *(reinterpret_cast<const QSet<QUmlVariable *> *>(&_variable));
-}
+ // This is a read-write association end
-// OPERATIONS [Element]
+ if (!_structuredNodeInput.contains(structuredNodeInput)) {
+ _structuredNodeInput.insert(structuredNodeInput);
+ if (structuredNodeInput->asQObject() && this->asQObject())
+ QObject::connect(structuredNodeInput->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeStructuredNodeInput(QObject *)));
+ structuredNodeInput->asQObject()->setParent(this->asQObject());
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlStructuredActivityNode::allOwnedElements() const
-{
- QSet<QUmlElement *> r;
- foreach (UmlElement *element, UmlElement::allOwnedElements())
- r.insert(reinterpret_cast<QUmlElement *>(element));
- return r;
+ // Adjust subsetted properties
+ addInput(structuredNodeInput);
+ }
}
-/*!
- 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 QUmlStructuredActivityNode::mustBeOwned() const
+void QUmlStructuredActivityNode::removeStructuredNodeInput(QUmlInputPin *structuredNodeInput)
{
- return UmlElement::mustBeOwned();
-}
+ // This is a read-write association end
-// OPERATIONS [NamedElement]
+ if (_structuredNodeInput.contains(structuredNodeInput)) {
+ _structuredNodeInput.remove(structuredNodeInput);
+ if (structuredNodeInput->asQObject())
+ structuredNodeInput->asQObject()->setParent(0);
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlStructuredActivityNode::allNamespaces() const
-{
- QList<QUmlNamespace *> r;
- foreach (UmlNamespace *element, UmlNamedElement::allNamespaces())
- r.append(reinterpret_cast<QUmlNamespace *>(element));
- return r;
+ // Adjust subsetted properties
+ removeInput(structuredNodeInput);
+ }
}
-/*!
- The query allOwningPackages() returns all the directly or indirectly owning packages.
- */
-QSet<QUmlPackage *> QUmlStructuredActivityNode::allOwningPackages() const
+const QSet<QUmlOutputPin *>
+QUmlStructuredActivityNode::structuredNodeOutput() 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 QUmlStructuredActivityNode::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
+ return _structuredNodeOutput;
}
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlStructuredActivityNode::separator() const
+void QUmlStructuredActivityNode::addStructuredNodeOutput(QUmlOutputPin *structuredNodeOutput)
{
- return UmlNamedElement::separator();
-}
+ // This is a read-write association end
-// OPERATIONS [RedefinableElement]
+ if (!_structuredNodeOutput.contains(structuredNodeOutput)) {
+ _structuredNodeOutput.insert(structuredNodeOutput);
+ if (structuredNodeOutput->asQObject() && this->asQObject())
+ QObject::connect(structuredNodeOutput->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeStructuredNodeOutput(QObject *)));
+ structuredNodeOutput->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 QUmlStructuredActivityNode::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
+ // Adjust subsetted properties
+ addOutput(structuredNodeOutput);
+ }
}
-/*!
- 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 QUmlStructuredActivityNode::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
+void QUmlStructuredActivityNode::removeStructuredNodeOutput(QUmlOutputPin *structuredNodeOutput)
{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
+ // This is a read-write association end
-// OPERATIONS [Namespace]
+ if (_structuredNodeOutput.contains(structuredNodeOutput)) {
+ _structuredNodeOutput.remove(structuredNodeOutput);
+ if (structuredNodeOutput->asQObject())
+ structuredNodeOutput->asQObject()->setParent(0);
-/*!
- The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this namespace.
- */
-QSet<QUmlPackageableElement *> QUmlStructuredActivityNode::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> QUmlStructuredActivityNode::getNamesOfMember(QUmlNamedElement *element) const
-{
- return UmlNamespace::getNamesOfMember(element);
+ // Adjust subsetted properties
+ removeOutput(structuredNodeOutput);
+ }
}
/*!
- 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 *> QUmlStructuredActivityNode::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.
+ A variable defined in the scope of the structured activity node. It has no value and may not be accessed
*/
-bool QUmlStructuredActivityNode::membersAreDistinguishable() const
-{
- return UmlNamespace::membersAreDistinguishable();
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlStructuredActivityNode::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlStructuredActivityNode::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlStructuredActivityNode::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlStructuredActivityNode::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlStructuredActivityNode::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlStructuredActivityNode::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlStructuredActivityNode::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlStructuredActivityNode::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ActivityNode]
-
-void QUmlStructuredActivityNode::addInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::addInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlStructuredActivityNode::removeInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::removeInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlStructuredActivityNode::addInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::addInPartition(inPartition);
-}
-
-void QUmlStructuredActivityNode::removeInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::removeInPartition(inPartition);
-}
-
-void QUmlStructuredActivityNode::setInStructuredNode(QUmlStructuredActivityNode *inStructuredNode)
-{
- UmlActivityNode::setInStructuredNode(inStructuredNode);
-}
-
-void QUmlStructuredActivityNode::addIncoming(UmlActivityEdge *incoming)
+const QSet<QUmlVariable *>
+QUmlStructuredActivityNode::variable() const
{
- UmlActivityNode::addIncoming(incoming);
-}
-
-void QUmlStructuredActivityNode::removeIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::removeIncoming(incoming);
-}
+ // This is a read-write association end
-void QUmlStructuredActivityNode::addOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::addOutgoing(outgoing);
-}
-
-void QUmlStructuredActivityNode::removeOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::removeOutgoing(outgoing);
-}
-
-void QUmlStructuredActivityNode::addRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::addRedefinedNode(redefinedNode);
+ return _variable;
}
-void QUmlStructuredActivityNode::removeRedefinedNode(UmlActivityNode *redefinedNode)
+void QUmlStructuredActivityNode::addVariable(QUmlVariable *variable)
{
- UmlActivityNode::removeRedefinedNode(redefinedNode);
-}
+ // This is a read-write association end
-// SLOTS FOR OWNED ATTRIBUTES [ExecutableNode]
+ if (!_variable.contains(variable)) {
+ _variable.insert(variable);
+ if (variable->asQObject() && this->asQObject())
+ QObject::connect(variable->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeVariable(QObject *)));
+ variable->asQObject()->setParent(this->asQObject());
-void QUmlStructuredActivityNode::addHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::addHandler(handler);
-}
+ // Adjust subsetted properties
+ addOwnedMember(variable);
-void QUmlStructuredActivityNode::removeHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::removeHandler(handler);
+ // Adjust opposite properties
+ if (variable) {
+ variable->setScope(this);
+ }
+ }
}
-// SLOTS FOR OWNED ATTRIBUTES [Action]
-
-void QUmlStructuredActivityNode::setLocallyReentrant(bool isLocallyReentrant)
+void QUmlStructuredActivityNode::removeVariable(QUmlVariable *variable)
{
- UmlAction::setLocallyReentrant(isLocallyReentrant);
-}
+ // This is a read-write association end
-void QUmlStructuredActivityNode::addLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::addLocalPostcondition(localPostcondition);
-}
+ if (_variable.contains(variable)) {
+ _variable.remove(variable);
+ if (variable->asQObject())
+ variable->asQObject()->setParent(0);
-void QUmlStructuredActivityNode::removeLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::removeLocalPostcondition(localPostcondition);
-}
+ // Adjust subsetted properties
+ removeOwnedMember(variable);
-void QUmlStructuredActivityNode::addLocalPrecondition(UmlConstraint *localPrecondition)
-{
- UmlAction::addLocalPrecondition(localPrecondition);
+ // Adjust opposite properties
+ if (variable) {
+ variable->setScope(0);
+ }
+ }
}
-void QUmlStructuredActivityNode::removeLocalPrecondition(UmlConstraint *localPrecondition)
-{
- UmlAction::removeLocalPrecondition(localPrecondition);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Namespace]
-
-void QUmlStructuredActivityNode::addElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::addElementImport(elementImport);
-}
-
-void QUmlStructuredActivityNode::removeElementImport(UmlElementImport *elementImport)
-{
- UmlNamespace::removeElementImport(elementImport);
-}
-
-void QUmlStructuredActivityNode::addOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::addOwnedRule(ownedRule);
-}
-
-void QUmlStructuredActivityNode::removeOwnedRule(UmlConstraint *ownedRule)
-{
- UmlNamespace::removeOwnedRule(ownedRule);
-}
-
-void QUmlStructuredActivityNode::addPackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::addPackageImport(packageImport);
-}
-
-void QUmlStructuredActivityNode::removePackageImport(UmlPackageImport *packageImport)
-{
- UmlNamespace::removePackageImport(packageImport);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ActivityGroup]
-
-// SLOTS FOR OWNED ATTRIBUTES [StructuredActivityNode]
-
-void QUmlStructuredActivityNode::setActivity(QUmlActivity *activity)
-{
- UmlStructuredActivityNode::setActivity(activity);
-}
-
-void QUmlStructuredActivityNode::addEdge(UmlActivityEdge *edge)
-{
- UmlStructuredActivityNode::addEdge(edge);
-}
-
-void QUmlStructuredActivityNode::removeEdge(UmlActivityEdge *edge)
-{
- UmlStructuredActivityNode::removeEdge(edge);
-}
-
-void QUmlStructuredActivityNode::setMustIsolate(bool mustIsolate)
-{
- UmlStructuredActivityNode::setMustIsolate(mustIsolate);
-}
-
-void QUmlStructuredActivityNode::addNode(UmlActivityNode *node)
-{
- UmlStructuredActivityNode::addNode(node);
-}
-
-void QUmlStructuredActivityNode::removeNode(UmlActivityNode *node)
-{
- UmlStructuredActivityNode::removeNode(node);
-}
-
-void QUmlStructuredActivityNode::addStructuredNodeInput(UmlInputPin *structuredNodeInput)
-{
- UmlStructuredActivityNode::addStructuredNodeInput(structuredNodeInput);
-}
-
-void QUmlStructuredActivityNode::removeStructuredNodeInput(UmlInputPin *structuredNodeInput)
-{
- UmlStructuredActivityNode::removeStructuredNodeInput(structuredNodeInput);
-}
-
-void QUmlStructuredActivityNode::addStructuredNodeOutput(UmlOutputPin *structuredNodeOutput)
-{
- UmlStructuredActivityNode::addStructuredNodeOutput(structuredNodeOutput);
-}
-
-void QUmlStructuredActivityNode::removeStructuredNodeOutput(UmlOutputPin *structuredNodeOutput)
-{
- UmlStructuredActivityNode::removeStructuredNodeOutput(structuredNodeOutput);
-}
-
-void QUmlStructuredActivityNode::addVariable(UmlVariable *variable)
-{
- UmlStructuredActivityNode::addVariable(variable);
-}
-
-void QUmlStructuredActivityNode::removeVariable(UmlVariable *variable)
-{
- UmlStructuredActivityNode::removeVariable(variable);
-}
-
-QT_END_NAMESPACE
-