summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlstructuredactivitynode.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-08-29 00:21:34 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-08-29 15:36:14 +0200
commit15f1561dff2533d45f513ae885b4ffe748af5e54 (patch)
tree25ce0de84e2641c427ef27119e4b3a1b2b9163b5 /src/uml/qumlstructuredactivitynode.cpp
parentf3f02b513ecc79d1ce7a108664ed772cacc60766 (diff)
New UML metamodel implementation almost done
Still missing: - Forward methods for inherited properties and operations - Auto-removal of deleted composite properties - Moving documentation from internal do QObject-based classes Change-Id: I2676e48c53d9ad4cdc6333c28e1a912d4e72cdd0 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlstructuredactivitynode.cpp')
-rw-r--r--src/uml/qumlstructuredactivitynode.cpp220
1 files changed, 31 insertions, 189 deletions
diff --git a/src/uml/qumlstructuredactivitynode.cpp b/src/uml/qumlstructuredactivitynode.cpp
index 1a7720b4..c447315d 100644
--- a/src/uml/qumlstructuredactivitynode.cpp
+++ b/src/uml/qumlstructuredactivitynode.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
#include "qumlstructuredactivitynode.h"
-#include "private/qmodelingobject_p.h"
#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
@@ -50,263 +49,106 @@
QT_BEGIN_NAMESPACE
-/*!
- \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() :
- _activity(0),
- _mustIsolate(false)
+QUmlStructuredActivityNode::QUmlStructuredActivityNode(QObject *parent) :
+ QObject(parent)
{
- d_ptr->object.setProperty("activity", QVariant::fromValue((QUmlActivity *)(0)));
- d_ptr->object.setProperty("edge", QVariant::fromValue(&_edge));
- d_ptr->object.setProperty("mustIsolate", QVariant::fromValue(false));
- d_ptr->object.setProperty("node", QVariant::fromValue(&_node));
- d_ptr->object.setProperty("structuredNodeInput", QVariant::fromValue(&_structuredNodeInput));
- d_ptr->object.setProperty("structuredNodeOutput", QVariant::fromValue(&_structuredNodeOutput));
- d_ptr->object.setProperty("variable", QVariant::fromValue(&_variable));
}
-// OWNED ATTRIBUTES
+// Owned attributes
-/*!
- Activity immediately containing the node.
- */
QUmlActivity *QUmlStructuredActivityNode::activity() const
{
- // This is a read-write association end
-
- return _activity;
+ return reinterpret_cast<QUmlActivity *>(_activity);
}
void QUmlStructuredActivityNode::setActivity(QUmlActivity *activity)
{
- // This is a read-write association end
-
- if (_activity != activity) {
- _activity = activity;
- }
+ UmlStructuredActivityNode::setActivity(activity);
}
-/*!
- Edges immediately contained in the structured node.
- */
const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::edge() const
{
- // This is a read-write association end
-
- return _edge;
+ return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_edge));
}
-void QUmlStructuredActivityNode::addEdge(QUmlActivityEdge *edge)
+void QUmlStructuredActivityNode::addEdge(UmlActivityEdge *edge)
{
- // This is a read-write association end
-
- if (!_edge.contains(edge)) {
- _edge.insert(edge);
-
- // Adjust subsetted properties
- addContainedEdge(edge);
- addOwnedElement(edge);
-
- // Adjust opposite properties
- if (edge) {
- edge->setInStructuredNode(this);
- }
- }
+ UmlStructuredActivityNode::addEdge(edge);
}
-void QUmlStructuredActivityNode::removeEdge(QUmlActivityEdge *edge)
+void QUmlStructuredActivityNode::removeEdge(UmlActivityEdge *edge)
{
- // This is a read-write association end
-
- if (_edge.contains(edge)) {
- _edge.remove(edge);
-
- // Adjust subsetted properties
- removeContainedEdge(edge);
- removeOwnedElement(edge);
-
- // Adjust opposite properties
- if (edge) {
- edge->setInStructuredNode(0);
- }
- }
+ UmlStructuredActivityNode::removeEdge(edge);
}
-/*!
- If true, then the actions in the node execute in isolation from actions outside the node.
- */
bool QUmlStructuredActivityNode::mustIsolate() const
{
- // This is a read-write property
-
return _mustIsolate;
}
void QUmlStructuredActivityNode::setMustIsolate(bool mustIsolate)
{
- // This is a read-write property
-
- if (_mustIsolate != mustIsolate) {
- _mustIsolate = mustIsolate;
- }
+ UmlStructuredActivityNode::setMustIsolate(mustIsolate);
}
-/*!
- Nodes immediately contained in the group.
- */
const QSet<QUmlActivityNode *> QUmlStructuredActivityNode::node() const
{
- // This is a read-write association end
-
- return _node;
+ return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_node));
}
-void QUmlStructuredActivityNode::addNode(QUmlActivityNode *node)
+void QUmlStructuredActivityNode::addNode(UmlActivityNode *node)
{
- // This is a read-write association end
-
- if (!_node.contains(node)) {
- _node.insert(node);
-
- // Adjust subsetted properties
- addContainedNode(node);
- addOwnedElement(node);
-
- // Adjust opposite properties
- if (node) {
- node->setInStructuredNode(this);
- }
- }
+ UmlStructuredActivityNode::addNode(node);
}
-void QUmlStructuredActivityNode::removeNode(QUmlActivityNode *node)
+void QUmlStructuredActivityNode::removeNode(UmlActivityNode *node)
{
- // This is a read-write association end
-
- if (_node.contains(node)) {
- _node.remove(node);
-
- // Adjust subsetted properties
- removeContainedNode(node);
- removeOwnedElement(node);
-
- // Adjust opposite properties
- if (node) {
- node->setInStructuredNode(0);
- }
- }
+ UmlStructuredActivityNode::removeNode(node);
}
const QSet<QUmlInputPin *> QUmlStructuredActivityNode::structuredNodeInput() const
{
- // This is a read-write association end
-
- return _structuredNodeInput;
+ return *(reinterpret_cast<const QSet<QUmlInputPin *> *>(&_structuredNodeInput));
}
-void QUmlStructuredActivityNode::addStructuredNodeInput(QUmlInputPin *structuredNodeInput)
+void QUmlStructuredActivityNode::addStructuredNodeInput(UmlInputPin *structuredNodeInput)
{
- // This is a read-write association end
-
- if (!_structuredNodeInput.contains(structuredNodeInput)) {
- _structuredNodeInput.insert(structuredNodeInput);
-
- // Adjust subsetted properties
- addInput(structuredNodeInput);
- }
+ UmlStructuredActivityNode::addStructuredNodeInput(structuredNodeInput);
}
-void QUmlStructuredActivityNode::removeStructuredNodeInput(QUmlInputPin *structuredNodeInput)
+void QUmlStructuredActivityNode::removeStructuredNodeInput(UmlInputPin *structuredNodeInput)
{
- // This is a read-write association end
-
- if (_structuredNodeInput.contains(structuredNodeInput)) {
- _structuredNodeInput.remove(structuredNodeInput);
-
- // Adjust subsetted properties
- removeInput(structuredNodeInput);
- }
+ UmlStructuredActivityNode::removeStructuredNodeInput(structuredNodeInput);
}
const QSet<QUmlOutputPin *> QUmlStructuredActivityNode::structuredNodeOutput() const
{
- // This is a read-write association end
-
- return _structuredNodeOutput;
+ return *(reinterpret_cast<const QSet<QUmlOutputPin *> *>(&_structuredNodeOutput));
}
-void QUmlStructuredActivityNode::addStructuredNodeOutput(QUmlOutputPin *structuredNodeOutput)
+void QUmlStructuredActivityNode::addStructuredNodeOutput(UmlOutputPin *structuredNodeOutput)
{
- // This is a read-write association end
-
- if (!_structuredNodeOutput.contains(structuredNodeOutput)) {
- _structuredNodeOutput.insert(structuredNodeOutput);
-
- // Adjust subsetted properties
- addOutput(structuredNodeOutput);
- }
+ UmlStructuredActivityNode::addStructuredNodeOutput(structuredNodeOutput);
}
-void QUmlStructuredActivityNode::removeStructuredNodeOutput(QUmlOutputPin *structuredNodeOutput)
+void QUmlStructuredActivityNode::removeStructuredNodeOutput(UmlOutputPin *structuredNodeOutput)
{
- // This is a read-write association end
-
- if (_structuredNodeOutput.contains(structuredNodeOutput)) {
- _structuredNodeOutput.remove(structuredNodeOutput);
-
- // Adjust subsetted properties
- removeOutput(structuredNodeOutput);
- }
+ UmlStructuredActivityNode::removeStructuredNodeOutput(structuredNodeOutput);
}
-/*!
- 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
{
- // This is a read-write association end
-
- return _variable;
+ return *(reinterpret_cast<const QSet<QUmlVariable *> *>(&_variable));
}
-void QUmlStructuredActivityNode::addVariable(QUmlVariable *variable)
+void QUmlStructuredActivityNode::addVariable(UmlVariable *variable)
{
- // This is a read-write association end
-
- if (!_variable.contains(variable)) {
- _variable.insert(variable);
-
- // Adjust subsetted properties
- addOwnedMember(variable);
-
- // Adjust opposite properties
- if (variable) {
- variable->setScope(this);
- }
- }
+ UmlStructuredActivityNode::addVariable(variable);
}
-void QUmlStructuredActivityNode::removeVariable(QUmlVariable *variable)
+void QUmlStructuredActivityNode::removeVariable(UmlVariable *variable)
{
- // This is a read-write association end
-
- if (_variable.contains(variable)) {
- _variable.remove(variable);
-
- // Adjust subsetted properties
- removeOwnedMember(variable);
-
- // Adjust opposite properties
- if (variable) {
- variable->setScope(0);
- }
- }
+ UmlStructuredActivityNode::removeVariable(variable);
}
QT_END_NAMESPACE