summaryrefslogtreecommitdiffstats
path: root/src/uml/qumldecisionnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumldecisionnode.cpp')
-rw-r--r--src/uml/qumldecisionnode.cpp421
1 files changed, 37 insertions, 384 deletions
diff --git a/src/uml/qumldecisionnode.cpp b/src/uml/qumldecisionnode.cpp
index 89a46411..cb1d6773 100644
--- a/src/uml/qumldecisionnode.cpp
+++ b/src/uml/qumldecisionnode.cpp
@@ -40,424 +40,77 @@
****************************************************************************/
#include "qumldecisionnode.h"
-#include <QtUml/QUmlActivity>
-#include <QtUml/QUmlActivityEdge>
-#include <QtUml/QUmlActivityGroup>
-#include <QtUml/QUmlActivityNode>
-#include <QtUml/QUmlActivityPartition>
+#include "private/qumldecisionnodeobject_p.h"
+
#include <QtUml/QUmlBehavior>
-#include <QtUml/QUmlClassifier>
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlInterruptibleActivityRegion>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlObjectFlow>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlStructuredActivityNode>
-
-QT_BEGIN_NAMESPACE
/*!
- \class UmlDecisionNode
+ \class QUmlDecisionNode
\inmodule QtUml
\brief A decision node is a control node that chooses between outgoing flows.
*/
-
-QUmlDecisionNode::QUmlDecisionNode(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlDecisionNode::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlDecisionNode::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlDecisionNode::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlDecisionNode::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlDecisionNode::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlDecisionNode::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlDecisionNode::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 QUmlDecisionNode::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlDecisionNode::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 QUmlDecisionNode::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlDecisionNode::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlDecisionNode::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [ActivityNode]
-
-/*!
- Activity containing the node.
- */
-QUmlActivity *QUmlDecisionNode::activity() const
-{
- return reinterpret_cast<QUmlActivity *>(_activity);
-}
-
-/*!
- Groups containing the node.
- */
-const QSet<QUmlActivityGroup *> QUmlDecisionNode::inGroup() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityGroup *> *>(&_inGroup));
-}
-
-/*!
- Interruptible regions containing the node.
- */
-const QSet<QUmlInterruptibleActivityRegion *> QUmlDecisionNode::inInterruptibleRegion() const
+QUmlDecisionNode::QUmlDecisionNode(bool createQObject) :
+ _decisionInput(0),
+ _decisionInputFlow(0)
{
- return *(reinterpret_cast<const QSet<QUmlInterruptibleActivityRegion *> *>(&_inInterruptibleRegion));
+ if (createQObject)
+ _qObject = new QUmlDecisionNodeObject(this);
}
-/*!
- Partitions containing the node.
- */
-const QSet<QUmlActivityPartition *> QUmlDecisionNode::inPartition() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityPartition *> *>(&_inPartition));
-}
-
-/*!
- Structured activity node containing the node.
- */
-QUmlStructuredActivityNode *QUmlDecisionNode::inStructuredNode() const
+QUmlDecisionNode::~QUmlDecisionNode()
{
- return reinterpret_cast<QUmlStructuredActivityNode *>(_inStructuredNode);
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-/*!
- Edges that have the node as target.
- */
-const QSet<QUmlActivityEdge *> QUmlDecisionNode::incoming() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_incoming));
-}
-
-/*!
- Edges that have the node as source.
- */
-const QSet<QUmlActivityEdge *> QUmlDecisionNode::outgoing() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_outgoing));
-}
-
-/*!
- Inherited nodes replaced by this node in a specialization of the activity.
- */
-const QSet<QUmlActivityNode *> QUmlDecisionNode::redefinedNode() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_redefinedNode));
-}
-
-// OWNED ATTRIBUTES [DecisionNode]
+// OWNED ATTRIBUTES
/*!
Provides input to guard specifications on edges outgoing from the decision node.
*/
-QUmlBehavior *QUmlDecisionNode::decisionInput() const
+QUmlBehavior *
+QUmlDecisionNode::decisionInput() const
{
- return reinterpret_cast<QUmlBehavior *>(_decisionInput);
-}
+ // This is a read-write association end
-/*!
- An additional edge incoming to the decision node that provides a decision input value.
- */
-QUmlObjectFlow *QUmlDecisionNode::decisionInputFlow() const
-{
- return reinterpret_cast<QUmlObjectFlow *>(_decisionInputFlow);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlDecisionNode::allOwnedElements() const
-{
- QSet<QUmlElement *> r;
- foreach (UmlElement *element, UmlElement::allOwnedElements())
- r.insert(reinterpret_cast<QUmlElement *>(element));
- return r;
-}
-
-/*!
- The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation.
- */
-bool QUmlDecisionNode::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 *> QUmlDecisionNode::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 *> QUmlDecisionNode::allOwningPackages() const
-{
- QSet<QUmlPackage *> r;
- foreach (UmlPackage *element, UmlNamedElement::allOwningPackages())
- r.insert(reinterpret_cast<QUmlPackage *>(element));
- return r;
-}
-
-/*!
- The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have unrelated types or (b) they have related types but different names.
- */
-bool QUmlDecisionNode::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
+ return _decisionInput;
}
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlDecisionNode::separator() const
+void QUmlDecisionNode::setDecisionInput(QUmlBehavior *decisionInput)
{
- return UmlNamedElement::separator();
-}
-
-// OPERATIONS [RedefinableElement]
+ // This is a read-write association end
-/*!
- 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 QUmlDecisionNode::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
+ if (_decisionInput != decisionInput) {
+ _decisionInput = decisionInput;
+ if (decisionInput->asQObject() && this->asQObject())
+ QObject::connect(decisionInput->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setDecisionInput()));
+ }
}
/*!
- 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.
+ An additional edge incoming to the decision node that provides a decision input value.
*/
-bool QUmlDecisionNode::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
+QUmlObjectFlow *
+QUmlDecisionNode::decisionInputFlow() const
{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
+ // This is a read-write association end
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlDecisionNode::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlDecisionNode::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlDecisionNode::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlDecisionNode::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlDecisionNode::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlDecisionNode::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlDecisionNode::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlDecisionNode::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ActivityNode]
-
-void QUmlDecisionNode::setActivity(QUmlActivity *activity)
-{
- UmlActivityNode::setActivity(activity);
-}
-
-void QUmlDecisionNode::addInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::addInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlDecisionNode::removeInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::removeInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlDecisionNode::addInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::addInPartition(inPartition);
-}
-
-void QUmlDecisionNode::removeInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::removeInPartition(inPartition);
-}
-
-void QUmlDecisionNode::setInStructuredNode(QUmlStructuredActivityNode *inStructuredNode)
-{
- UmlActivityNode::setInStructuredNode(inStructuredNode);
-}
-
-void QUmlDecisionNode::addIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::addIncoming(incoming);
-}
-
-void QUmlDecisionNode::removeIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::removeIncoming(incoming);
-}
-
-void QUmlDecisionNode::addOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::addOutgoing(outgoing);
-}
-
-void QUmlDecisionNode::removeOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::removeOutgoing(outgoing);
-}
-
-void QUmlDecisionNode::addRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::addRedefinedNode(redefinedNode);
-}
-
-void QUmlDecisionNode::removeRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::removeRedefinedNode(redefinedNode);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [DecisionNode]
-
-void QUmlDecisionNode::setDecisionInput(QUmlBehavior *decisionInput)
-{
- UmlDecisionNode::setDecisionInput(decisionInput);
+ return _decisionInputFlow;
}
void QUmlDecisionNode::setDecisionInputFlow(QUmlObjectFlow *decisionInputFlow)
{
- UmlDecisionNode::setDecisionInputFlow(decisionInputFlow);
-}
+ // This is a read-write association end
-QT_END_NAMESPACE
+ if (_decisionInputFlow != decisionInputFlow) {
+ _decisionInputFlow = decisionInputFlow;
+ if (decisionInputFlow->asQObject() && this->asQObject())
+ QObject::connect(decisionInputFlow->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setDecisionInputFlow()));
+ }
+}