summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlvaluespecificationaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlvaluespecificationaction.cpp')
-rw-r--r--src/uml/qumlvaluespecificationaction.cpp533
1 files changed, 51 insertions, 482 deletions
diff --git a/src/uml/qumlvaluespecificationaction.cpp b/src/uml/qumlvaluespecificationaction.cpp
index 4d02990e..9a17ea94 100644
--- a/src/uml/qumlvaluespecificationaction.cpp
+++ b/src/uml/qumlvaluespecificationaction.cpp
@@ -40,526 +40,95 @@
****************************************************************************/
#include "qumlvaluespecificationaction.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/QUmlExceptionHandler>
-#include <QtUml/QUmlInputPin>
-#include <QtUml/QUmlInterruptibleActivityRegion>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
+#include "private/qumlvaluespecificationactionobject_p.h"
+
#include <QtUml/QUmlOutputPin>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlValueSpecification>
-QT_BEGIN_NAMESPACE
-
/*!
- \class UmlValueSpecificationAction
+ \class QUmlValueSpecificationAction
\inmodule QtUml
\brief A value specification action is an action that evaluates a value specification.
*/
-
-QUmlValueSpecificationAction::QUmlValueSpecificationAction(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlValueSpecificationAction::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlValueSpecificationAction::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlValueSpecificationAction::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlValueSpecificationAction::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlValueSpecificationAction::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlValueSpecificationAction::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlValueSpecificationAction::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 QUmlValueSpecificationAction::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlValueSpecificationAction::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 QUmlValueSpecificationAction::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlValueSpecificationAction::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlValueSpecificationAction::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [ActivityNode]
-
-/*!
- Activity containing the node.
- */
-QUmlActivity *QUmlValueSpecificationAction::activity() const
-{
- return reinterpret_cast<QUmlActivity *>(_activity);
-}
-
-/*!
- Groups containing the node.
- */
-const QSet<QUmlActivityGroup *> QUmlValueSpecificationAction::inGroup() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityGroup *> *>(&_inGroup));
-}
-
-/*!
- Interruptible regions containing the node.
- */
-const QSet<QUmlInterruptibleActivityRegion *> QUmlValueSpecificationAction::inInterruptibleRegion() const
-{
- return *(reinterpret_cast<const QSet<QUmlInterruptibleActivityRegion *> *>(&_inInterruptibleRegion));
-}
-
-/*!
- Partitions containing the node.
- */
-const QSet<QUmlActivityPartition *> QUmlValueSpecificationAction::inPartition() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityPartition *> *>(&_inPartition));
-}
-
-/*!
- Structured activity node containing the node.
- */
-QUmlStructuredActivityNode *QUmlValueSpecificationAction::inStructuredNode() const
-{
- return reinterpret_cast<QUmlStructuredActivityNode *>(_inStructuredNode);
-}
-
-/*!
- Edges that have the node as target.
- */
-const QSet<QUmlActivityEdge *> QUmlValueSpecificationAction::incoming() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_incoming));
-}
-
-/*!
- Edges that have the node as source.
- */
-const QSet<QUmlActivityEdge *> QUmlValueSpecificationAction::outgoing() const
+QUmlValueSpecificationAction::QUmlValueSpecificationAction(bool createQObject) :
+ _result(0),
+ _value(0)
{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_outgoing));
+ if (createQObject)
+ _qObject = new QUmlValueSpecificationActionObject(this);
}
-/*!
- Inherited nodes replaced by this node in a specialization of the activity.
- */
-const QSet<QUmlActivityNode *> QUmlValueSpecificationAction::redefinedNode() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_redefinedNode));
-}
-
-// 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 *> QUmlValueSpecificationAction::handler() const
-{
- return *(reinterpret_cast<const QSet<QUmlExceptionHandler *> *>(&_handler));
-}
-
-// OWNED ATTRIBUTES [Action]
-
-/*!
- The classifier that owns the behavior of which this action is a part.
- */
-QUmlClassifier *QUmlValueSpecificationAction::context() const
-{
- return reinterpret_cast<QUmlClassifier *>(UmlAction::context());
-}
-
-/*!
- The ordered set of input pins connected to the Action. These are among the total set of inputs.
- */
-const QList<QUmlInputPin *> QUmlValueSpecificationAction::input() const
+QUmlValueSpecificationAction::~QUmlValueSpecificationAction()
{
- return *(reinterpret_cast<const QList<QUmlInputPin *> *>(&_input));
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-/*!
- 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 QUmlValueSpecificationAction::isLocallyReentrant() const
-{
- return _isLocallyReentrant;
-}
-
-/*!
- Constraint that must be satisfied when executed is completed.
- */
-const QSet<QUmlConstraint *> QUmlValueSpecificationAction::localPostcondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_localPostcondition));
-}
-
-/*!
- Constraint that must be satisfied when execution is started.
- */
-const QSet<QUmlConstraint *> QUmlValueSpecificationAction::localPrecondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_localPrecondition));
-}
-
-/*!
- The ordered set of output pins connected to the Action. The action places its results onto pins in this set.
- */
-const QList<QUmlOutputPin *> QUmlValueSpecificationAction::output() const
-{
- return *(reinterpret_cast<const QList<QUmlOutputPin *> *>(&_output));
-}
-
-// OWNED ATTRIBUTES [ValueSpecificationAction]
+// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *QUmlValueSpecificationAction::result() const
-{
- return reinterpret_cast<QUmlOutputPin *>(_result);
-}
-
-/*!
- Value specification to be evaluated.
- */
-QUmlValueSpecification *QUmlValueSpecificationAction::value() const
-{
- return reinterpret_cast<QUmlValueSpecification *>(_value);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlValueSpecificationAction::allOwnedElements() const
+QUmlOutputPin *
+QUmlValueSpecificationAction::result() 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 QUmlValueSpecificationAction::mustBeOwned() const
-{
- return UmlElement::mustBeOwned();
+ return _result;
}
-// OPERATIONS [NamedElement]
-
-/*!
- The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
- */
-QList<QUmlNamespace *> QUmlValueSpecificationAction::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 *> QUmlValueSpecificationAction::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 QUmlValueSpecificationAction::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
+void QUmlValueSpecificationAction::setResult(QUmlOutputPin *result)
{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
-}
+ // This is a read-write association end
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlValueSpecificationAction::separator() const
-{
- return UmlNamedElement::separator();
-}
+ if (_result != result) {
+ // Adjust subsetted properties
+ removeOutput(_result);
-// OPERATIONS [RedefinableElement]
+ _result = result;
+ if (result->asQObject() && this->asQObject())
+ QObject::connect(result->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setResult()));
+ result->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 QUmlValueSpecificationAction::isConsistentWith(QUmlRedefinableElement *redefinee) const
-{
- return UmlRedefinableElement::isConsistentWith(redefinee);
+ // Adjust subsetted properties
+ if (result) {
+ addOutput(result);
+ }
+ }
}
/*!
- 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.
+ Value specification to be evaluated.
*/
-bool QUmlValueSpecificationAction::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
-{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlValueSpecificationAction::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlValueSpecificationAction::removeOwnedComment(UmlComment *ownedComment)
+QUmlValueSpecification *
+QUmlValueSpecificationAction::value() const
{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlValueSpecificationAction::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
+ // This is a read-write association end
-void QUmlValueSpecificationAction::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlValueSpecificationAction::setName(QString name)
-{
- UmlNamedElement::setName(name);
+ return _value;
}
-void QUmlValueSpecificationAction::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlValueSpecificationAction::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlValueSpecificationAction::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ActivityNode]
-
-void QUmlValueSpecificationAction::setActivity(QUmlActivity *activity)
-{
- UmlActivityNode::setActivity(activity);
-}
-
-void QUmlValueSpecificationAction::addInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::addInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlValueSpecificationAction::removeInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::removeInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlValueSpecificationAction::addInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::addInPartition(inPartition);
-}
-
-void QUmlValueSpecificationAction::removeInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::removeInPartition(inPartition);
-}
-
-void QUmlValueSpecificationAction::setInStructuredNode(QUmlStructuredActivityNode *inStructuredNode)
-{
- UmlActivityNode::setInStructuredNode(inStructuredNode);
-}
-
-void QUmlValueSpecificationAction::addIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::addIncoming(incoming);
-}
-
-void QUmlValueSpecificationAction::removeIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::removeIncoming(incoming);
-}
-
-void QUmlValueSpecificationAction::addOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::addOutgoing(outgoing);
-}
-
-void QUmlValueSpecificationAction::removeOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::removeOutgoing(outgoing);
-}
-
-void QUmlValueSpecificationAction::addRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::addRedefinedNode(redefinedNode);
-}
-
-void QUmlValueSpecificationAction::removeRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::removeRedefinedNode(redefinedNode);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ExecutableNode]
-
-void QUmlValueSpecificationAction::addHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::addHandler(handler);
-}
-
-void QUmlValueSpecificationAction::removeHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::removeHandler(handler);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Action]
-
-void QUmlValueSpecificationAction::setLocallyReentrant(bool isLocallyReentrant)
-{
- UmlAction::setLocallyReentrant(isLocallyReentrant);
-}
-
-void QUmlValueSpecificationAction::addLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::addLocalPostcondition(localPostcondition);
-}
-
-void QUmlValueSpecificationAction::removeLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::removeLocalPostcondition(localPostcondition);
-}
-
-void QUmlValueSpecificationAction::addLocalPrecondition(UmlConstraint *localPrecondition)
-{
- UmlAction::addLocalPrecondition(localPrecondition);
-}
-
-void QUmlValueSpecificationAction::removeLocalPrecondition(UmlConstraint *localPrecondition)
+void QUmlValueSpecificationAction::setValue(QUmlValueSpecification *value)
{
- UmlAction::removeLocalPrecondition(localPrecondition);
-}
+ // This is a read-write association end
-// SLOTS FOR OWNED ATTRIBUTES [ValueSpecificationAction]
+ if (_value != value) {
+ // Adjust subsetted properties
+ removeOwnedElement(_value);
-void QUmlValueSpecificationAction::setResult(QUmlOutputPin *result)
-{
- UmlValueSpecificationAction::setResult(result);
-}
+ _value = value;
+ if (value->asQObject() && this->asQObject())
+ QObject::connect(value->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setValue()));
+ value->asQObject()->setParent(this->asQObject());
-void QUmlValueSpecificationAction::setValue(QUmlValueSpecification *value)
-{
- UmlValueSpecificationAction::setValue(value);
+ // Adjust subsetted properties
+ if (value) {
+ addOwnedElement(value);
+ }
+ }
}
-QT_END_NAMESPACE
-