summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlcalloperationaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlcalloperationaction.cpp')
-rw-r--r--src/uml/qumlcalloperationaction.cpp599
1 files changed, 44 insertions, 555 deletions
diff --git a/src/uml/qumlcalloperationaction.cpp b/src/uml/qumlcalloperationaction.cpp
index 4dc34cea..6a2926e9 100644
--- a/src/uml/qumlcalloperationaction.cpp
+++ b/src/uml/qumlcalloperationaction.cpp
@@ -40,597 +40,86 @@
****************************************************************************/
#include "qumlcalloperationaction.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 "private/qumlcalloperationactionobject_p.h"
+
#include <QtUml/QUmlInputPin>
-#include <QtUml/QUmlInterruptibleActivityRegion>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
-#include <QtUml/QUmlOutputPin>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlPort>
-#include <QtUml/QUmlRedefinableElement>
-#include <QtUml/QUmlStringExpression>
-#include <QtUml/QUmlStructuredActivityNode>
-
-QT_BEGIN_NAMESPACE
/*!
- \class UmlCallOperationAction
+ \class QUmlCallOperationAction
\inmodule QtUml
\brief A call operation action is an action that transmits an operation call request to the target object, where it may cause the invocation of associated behavior. The argument values of the action are available to the execution of the invoked behavior. If the action is marked synchronous, the execution of the call operation action waits until the execution of the invoked behavior completes and a reply transmission is returned to the caller; otherwise execution of the action is complete when the invocation of the operation is established and the execution of the invoked operation proceeds concurrently with the execution of the calling behavior. Any values returned as part of the reply transmission are put on the result output pins of the call operation action. Upon receipt of the reply transmission, execution of the call operation action is complete.
*/
-
-QUmlCallOperationAction::QUmlCallOperationAction(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlCallOperationAction::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlCallOperationAction::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlCallOperationAction::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlCallOperationAction::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlCallOperationAction::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlCallOperationAction::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlCallOperationAction::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 QUmlCallOperationAction::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlCallOperationAction::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 QUmlCallOperationAction::isLeaf() const
-{
- return _isLeaf;
-}
-
-/*!
- The redefinable element that is being redefined by this element.
- */
-const QSet<QUmlRedefinableElement *> QUmlCallOperationAction::redefinedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlRedefinableElement *> *>(&_redefinedElement));
-}
-
-/*!
- References the contexts that this element may be redefined from.
- */
-const QSet<QUmlClassifier *> QUmlCallOperationAction::redefinitionContext() const
-{
- return *(reinterpret_cast<const QSet<QUmlClassifier *> *>(&_redefinitionContext));
-}
-
-// OWNED ATTRIBUTES [ActivityNode]
-
-/*!
- Activity containing the node.
- */
-QUmlActivity *QUmlCallOperationAction::activity() const
-{
- return reinterpret_cast<QUmlActivity *>(_activity);
-}
-
-/*!
- Groups containing the node.
- */
-const QSet<QUmlActivityGroup *> QUmlCallOperationAction::inGroup() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityGroup *> *>(&_inGroup));
-}
-
-/*!
- Interruptible regions containing the node.
- */
-const QSet<QUmlInterruptibleActivityRegion *> QUmlCallOperationAction::inInterruptibleRegion() const
-{
- return *(reinterpret_cast<const QSet<QUmlInterruptibleActivityRegion *> *>(&_inInterruptibleRegion));
-}
-
-/*!
- Partitions containing the node.
- */
-const QSet<QUmlActivityPartition *> QUmlCallOperationAction::inPartition() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityPartition *> *>(&_inPartition));
-}
-
-/*!
- Structured activity node containing the node.
- */
-QUmlStructuredActivityNode *QUmlCallOperationAction::inStructuredNode() const
-{
- return reinterpret_cast<QUmlStructuredActivityNode *>(_inStructuredNode);
-}
-
-/*!
- Edges that have the node as target.
- */
-const QSet<QUmlActivityEdge *> QUmlCallOperationAction::incoming() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_incoming));
-}
-
-/*!
- Edges that have the node as source.
- */
-const QSet<QUmlActivityEdge *> QUmlCallOperationAction::outgoing() const
-{
- return *(reinterpret_cast<const QSet<QUmlActivityEdge *> *>(&_outgoing));
-}
-
-/*!
- Inherited nodes replaced by this node in a specialization of the activity.
- */
-const QSet<QUmlActivityNode *> QUmlCallOperationAction::redefinedNode() const
+QUmlCallOperationAction::QUmlCallOperationAction(bool createQObject) :
+ _operation(0),
+ _target(0)
{
- return *(reinterpret_cast<const QSet<QUmlActivityNode *> *>(&_redefinedNode));
+ if (createQObject)
+ _qObject = new QUmlCallOperationActionObject(this);
}
-// 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 *> QUmlCallOperationAction::handler() const
+QUmlCallOperationAction::~QUmlCallOperationAction()
{
- return *(reinterpret_cast<const QSet<QUmlExceptionHandler *> *>(&_handler));
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-// OWNED ATTRIBUTES [Action]
-
-/*!
- The classifier that owns the behavior of which this action is a part.
- */
-QUmlClassifier *QUmlCallOperationAction::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 *> QUmlCallOperationAction::input() const
-{
- return *(reinterpret_cast<const QList<QUmlInputPin *> *>(&_input));
-}
-
-/*!
- 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 QUmlCallOperationAction::isLocallyReentrant() const
-{
- return _isLocallyReentrant;
-}
-
-/*!
- Constraint that must be satisfied when executed is completed.
- */
-const QSet<QUmlConstraint *> QUmlCallOperationAction::localPostcondition() const
-{
- return *(reinterpret_cast<const QSet<QUmlConstraint *> *>(&_localPostcondition));
-}
-
-/*!
- Constraint that must be satisfied when execution is started.
- */
-const QSet<QUmlConstraint *> QUmlCallOperationAction::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 *> QUmlCallOperationAction::output() const
-{
- return *(reinterpret_cast<const QList<QUmlOutputPin *> *>(&_output));
-}
-
-// OWNED ATTRIBUTES [InvocationAction]
-
-/*!
- Specification of the ordered set of argument values that appears during execution.
- */
-const QList<QUmlInputPin *> QUmlCallOperationAction::argument() const
-{
- return *(reinterpret_cast<const QList<QUmlInputPin *> *>(&_argument));
-}
-
-/*!
- A optional port of the receiver object on which the behavioral feature is invoked.
- */
-QUmlPort *QUmlCallOperationAction::onPort() const
-{
- return reinterpret_cast<QUmlPort *>(_onPort);
-}
-
-// OWNED ATTRIBUTES [CallAction]
-
-/*!
- If true, the call is synchronous and the caller waits for completion of the invoked behavior. If false, the call is asynchronous and the caller proceeds immediately and does not expect a return values.
- */
-bool QUmlCallOperationAction::isSynchronous() const
-{
- return _isSynchronous;
-}
-
-/*!
- A list of output pins where the results of performing the invocation are placed.
- */
-const QList<QUmlOutputPin *> QUmlCallOperationAction::result() const
-{
- return *(reinterpret_cast<const QList<QUmlOutputPin *> *>(&_result));
-}
-
-// OWNED ATTRIBUTES [CallOperationAction]
+// OWNED ATTRIBUTES
/*!
The operation to be invoked by the action execution.
*/
-QUmlOperation *QUmlCallOperationAction::operation() const
-{
- return reinterpret_cast<QUmlOperation *>(_operation);
-}
-
-/*!
- The target object to which the request is sent. The classifier of the target object is used to dynamically determine a behavior to invoke. This object constitutes the context of the execution of the operation.
- */
-QUmlInputPin *QUmlCallOperationAction::target() const
-{
- return reinterpret_cast<QUmlInputPin *>(_target);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlCallOperationAction::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 QUmlCallOperationAction::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 *> QUmlCallOperationAction::allNamespaces() const
+QUmlOperation *
+QUmlCallOperationAction::operation() const
{
- QList<QUmlNamespace *> r;
- foreach (UmlNamespace *element, UmlNamedElement::allNamespaces())
- r.append(reinterpret_cast<QUmlNamespace *>(element));
- return r;
-}
+ // This is a read-write association end
-/*!
- The query allOwningPackages() returns all the directly or indirectly owning packages.
- */
-QSet<QUmlPackage *> QUmlCallOperationAction::allOwningPackages() const
-{
- QSet<QUmlPackage *> r;
- foreach (UmlPackage *element, UmlNamedElement::allOwningPackages())
- r.insert(reinterpret_cast<QUmlPackage *>(element));
- return r;
+ return _operation;
}
-/*!
- 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 QUmlCallOperationAction::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
+void QUmlCallOperationAction::setOperation(QUmlOperation *operation)
{
- 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 QUmlCallOperationAction::separator() const
-{
- return UmlNamedElement::separator();
+ if (_operation != operation) {
+ _operation = operation;
+ if (operation->asQObject() && this->asQObject())
+ QObject::connect(operation->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setOperation()));
+ }
}
-// 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 QUmlCallOperationAction::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.
+ The target object to which the request is sent. The classifier of the target object is used to dynamically determine a behavior to invoke. This object constitutes the context of the execution of the operation.
*/
-bool QUmlCallOperationAction::isRedefinitionContextValid(QUmlRedefinableElement *redefined) const
-{
- return UmlRedefinableElement::isRedefinitionContextValid(redefined);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlCallOperationAction::addOwnedComment(UmlComment *ownedComment)
+QUmlInputPin *
+QUmlCallOperationAction::target() const
{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlCallOperationAction::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
+ // This is a read-write association end
-void QUmlCallOperationAction::addClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::addClientDependency(clientDependency);
-}
-
-void QUmlCallOperationAction::removeClientDependency(UmlDependency *clientDependency)
-{
- UmlNamedElement::removeClientDependency(clientDependency);
-}
-
-void QUmlCallOperationAction::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlCallOperationAction::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlCallOperationAction::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [RedefinableElement]
-
-void QUmlCallOperationAction::setLeaf(bool isLeaf)
-{
- UmlRedefinableElement::setLeaf(isLeaf);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ActivityNode]
-
-void QUmlCallOperationAction::setActivity(QUmlActivity *activity)
-{
- UmlActivityNode::setActivity(activity);
-}
-
-void QUmlCallOperationAction::addInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::addInInterruptibleRegion(inInterruptibleRegion);
+ return _target;
}
-void QUmlCallOperationAction::removeInInterruptibleRegion(UmlInterruptibleActivityRegion *inInterruptibleRegion)
-{
- UmlActivityNode::removeInInterruptibleRegion(inInterruptibleRegion);
-}
-
-void QUmlCallOperationAction::addInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::addInPartition(inPartition);
-}
-
-void QUmlCallOperationAction::removeInPartition(UmlActivityPartition *inPartition)
-{
- UmlActivityNode::removeInPartition(inPartition);
-}
-
-void QUmlCallOperationAction::setInStructuredNode(QUmlStructuredActivityNode *inStructuredNode)
-{
- UmlActivityNode::setInStructuredNode(inStructuredNode);
-}
-
-void QUmlCallOperationAction::addIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::addIncoming(incoming);
-}
-
-void QUmlCallOperationAction::removeIncoming(UmlActivityEdge *incoming)
-{
- UmlActivityNode::removeIncoming(incoming);
-}
-
-void QUmlCallOperationAction::addOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::addOutgoing(outgoing);
-}
-
-void QUmlCallOperationAction::removeOutgoing(UmlActivityEdge *outgoing)
-{
- UmlActivityNode::removeOutgoing(outgoing);
-}
-
-void QUmlCallOperationAction::addRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::addRedefinedNode(redefinedNode);
-}
-
-void QUmlCallOperationAction::removeRedefinedNode(UmlActivityNode *redefinedNode)
-{
- UmlActivityNode::removeRedefinedNode(redefinedNode);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [ExecutableNode]
-
-void QUmlCallOperationAction::addHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::addHandler(handler);
-}
-
-void QUmlCallOperationAction::removeHandler(UmlExceptionHandler *handler)
-{
- UmlExecutableNode::removeHandler(handler);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Action]
-
-void QUmlCallOperationAction::setLocallyReentrant(bool isLocallyReentrant)
-{
- UmlAction::setLocallyReentrant(isLocallyReentrant);
-}
-
-void QUmlCallOperationAction::addLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::addLocalPostcondition(localPostcondition);
-}
-
-void QUmlCallOperationAction::removeLocalPostcondition(UmlConstraint *localPostcondition)
-{
- UmlAction::removeLocalPostcondition(localPostcondition);
-}
-
-void QUmlCallOperationAction::addLocalPrecondition(UmlConstraint *localPrecondition)
-{
- UmlAction::addLocalPrecondition(localPrecondition);
-}
-
-void QUmlCallOperationAction::removeLocalPrecondition(UmlConstraint *localPrecondition)
-{
- UmlAction::removeLocalPrecondition(localPrecondition);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [InvocationAction]
-
-void QUmlCallOperationAction::addArgument(UmlInputPin *argument)
-{
- UmlInvocationAction::addArgument(argument);
-}
-
-void QUmlCallOperationAction::removeArgument(UmlInputPin *argument)
-{
- UmlInvocationAction::removeArgument(argument);
-}
-
-void QUmlCallOperationAction::setOnPort(QUmlPort *onPort)
-{
- UmlInvocationAction::setOnPort(onPort);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [CallAction]
-
-void QUmlCallOperationAction::setSynchronous(bool isSynchronous)
-{
- UmlCallAction::setSynchronous(isSynchronous);
-}
-
-void QUmlCallOperationAction::addResult(UmlOutputPin *result)
-{
- UmlCallAction::addResult(result);
-}
-
-void QUmlCallOperationAction::removeResult(UmlOutputPin *result)
+void QUmlCallOperationAction::setTarget(QUmlInputPin *target)
{
- UmlCallAction::removeResult(result);
-}
+ // This is a read-write association end
-// SLOTS FOR OWNED ATTRIBUTES [CallOperationAction]
+ if (_target != target) {
+ // Adjust subsetted properties
+ removeInput(_target);
-void QUmlCallOperationAction::setOperation(QUmlOperation *operation)
-{
- UmlCallOperationAction::setOperation(operation);
-}
+ _target = target;
+ if (target->asQObject() && this->asQObject())
+ QObject::connect(target->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setTarget()));
+ target->asQObject()->setParent(this->asQObject());
-void QUmlCallOperationAction::setTarget(QUmlInputPin *target)
-{
- UmlCallOperationAction::setTarget(target);
+ // Adjust subsetted properties
+ if (target) {
+ addInput(target);
+ }
+ }
}
-QT_END_NAMESPACE
-