diff options
Diffstat (limited to 'src/uml/qumlexecutionspecification.cpp')
-rw-r--r-- | src/uml/qumlexecutionspecification.cpp | 295 |
1 files changed, 29 insertions, 266 deletions
diff --git a/src/uml/qumlexecutionspecification.cpp b/src/uml/qumlexecutionspecification.cpp index e678a34f..965e73a1 100644 --- a/src/uml/qumlexecutionspecification.cpp +++ b/src/uml/qumlexecutionspecification.cpp @@ -40,305 +40,68 @@ ****************************************************************************/ #include "qumlexecutionspecification.h" -#include <QtUml/QUmlComment> -#include <QtUml/QUmlDependency> -#include <QtUml/QUmlElement> -#include <QtUml/QUmlGeneralOrdering> -#include <QtUml/QUmlInteraction> -#include <QtUml/QUmlInteractionOperand> -#include <QtUml/QUmlLifeline> -#include <QtUml/QUmlNamedElement> -#include <QtUml/QUmlNamespace> #include <QtUml/QUmlOccurrenceSpecification> -#include <QtUml/QUmlPackage> -#include <QtUml/QUmlStringExpression> - -QT_BEGIN_NAMESPACE /*! - \class UmlExecutionSpecification + \class QUmlExecutionSpecification \inmodule QtUml \brief An execution specification is a specification of the execution of a unit of behavior or action within the lifeline. The duration of an execution specification is represented by two cccurrence specifications, the start occurrence specification and the finish occurrence specification. */ - -QUmlExecutionSpecification::QUmlExecutionSpecification(QObject *parent) : - QObject(parent) +QUmlExecutionSpecification::QUmlExecutionSpecification() : + _finish(0), + _start(0) { } -// OWNED ATTRIBUTES [Element] - -/*! - The Comments owned by this element. - */ -const QSet<QUmlComment *> QUmlExecutionSpecification::ownedComment() const +QUmlExecutionSpecification::~QUmlExecutionSpecification() { - return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment)); } -/*! - The Elements owned by this element. - */ -const QSet<QUmlElement *> QUmlExecutionSpecification::ownedElement() const -{ - return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement)); -} - -/*! - The Element that owns this element. - */ -QUmlElement *QUmlExecutionSpecification::owner() const -{ - return reinterpret_cast<QUmlElement *>(_owner); -} - -// OWNED ATTRIBUTES [NamedElement] - -/*! - Indicates the dependencies that reference the client. - */ -const QSet<QUmlDependency *> QUmlExecutionSpecification::clientDependency() const -{ - return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency)); -} - -/*! - The name of the NamedElement. - */ -QString QUmlExecutionSpecification::name() const -{ - return _name; -} - -/*! - The string expression used to define the name of this named element. - */ -QUmlStringExpression *QUmlExecutionSpecification::nameExpression() const -{ - return reinterpret_cast<QUmlStringExpression *>(_nameExpression); -} - -/*! - Specifies the namespace that owns the NamedElement. - */ -QUmlNamespace *QUmlExecutionSpecification::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 QUmlExecutionSpecification::qualifiedName() const -{ - return UmlNamedElement::qualifiedName(); -} - -/*! - Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility. - */ -QtUml::VisibilityKind QUmlExecutionSpecification::visibility() const -{ - return _visibility; -} - -// OWNED ATTRIBUTES [InteractionFragment] - -/*! - References the Lifelines that the InteractionFragment involves. - */ -const QSet<QUmlLifeline *> QUmlExecutionSpecification::covered() const -{ - return *(reinterpret_cast<const QSet<QUmlLifeline *> *>(&_covered)); -} - -/*! - The Interaction enclosing this InteractionFragment. - */ -QUmlInteraction *QUmlExecutionSpecification::enclosingInteraction() const -{ - return reinterpret_cast<QUmlInteraction *>(_enclosingInteraction); -} - -/*! - The operand enclosing this InteractionFragment (they may nest recursively) - */ -QUmlInteractionOperand *QUmlExecutionSpecification::enclosingOperand() const -{ - return reinterpret_cast<QUmlInteractionOperand *>(_enclosingOperand); -} - -/*! - The general ordering relationships contained in this fragment. - */ -const QSet<QUmlGeneralOrdering *> QUmlExecutionSpecification::generalOrdering() const -{ - return *(reinterpret_cast<const QSet<QUmlGeneralOrdering *> *>(&_generalOrdering)); -} - -// OWNED ATTRIBUTES [ExecutionSpecification] +// OWNED ATTRIBUTES /*! References the OccurrenceSpecification that designates the finish of the Action or Behavior. */ -QUmlOccurrenceSpecification *QUmlExecutionSpecification::finish() const +QUmlOccurrenceSpecification * +QUmlExecutionSpecification::finish() const { - return reinterpret_cast<QUmlOccurrenceSpecification *>(_finish); -} + // This is a read-write association end -/*! - References the OccurrenceSpecification that designates the start of the Action or Behavior - */ -QUmlOccurrenceSpecification *QUmlExecutionSpecification::start() const -{ - return reinterpret_cast<QUmlOccurrenceSpecification *>(_start); + return _finish; } -// OPERATIONS [Element] - -/*! - The query allOwnedElements() gives all of the direct and indirect owned elements of an element. - */ -QSet<QUmlElement *> QUmlExecutionSpecification::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 QUmlExecutionSpecification::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 *> QUmlExecutionSpecification::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 *> QUmlExecutionSpecification::allOwningPackages() const +void QUmlExecutionSpecification::setFinish(QUmlOccurrenceSpecification *finish) { - 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 QUmlExecutionSpecification::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const -{ - return UmlNamedElement::isDistinguishableFrom(n, ns); + if (_finish != finish) { + _finish = finish; + if (finish->asQObject() && this->asQObject()) + QObject::connect(finish->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setFinish())); + } } /*! - The query separator() gives the string that is used to separate names when constructing a qualified name. + References the OccurrenceSpecification that designates the start of the Action or Behavior */ -QString QUmlExecutionSpecification::separator() const -{ - return UmlNamedElement::separator(); -} - -// SLOTS FOR OWNED ATTRIBUTES [Element] - -void QUmlExecutionSpecification::addOwnedComment(UmlComment *ownedComment) -{ - UmlElement::addOwnedComment(ownedComment); -} - -void QUmlExecutionSpecification::removeOwnedComment(UmlComment *ownedComment) -{ - UmlElement::removeOwnedComment(ownedComment); -} - -// SLOTS FOR OWNED ATTRIBUTES [NamedElement] - -void QUmlExecutionSpecification::addClientDependency(UmlDependency *clientDependency) -{ - UmlNamedElement::addClientDependency(clientDependency); -} - -void QUmlExecutionSpecification::removeClientDependency(UmlDependency *clientDependency) -{ - UmlNamedElement::removeClientDependency(clientDependency); -} - -void QUmlExecutionSpecification::setName(QString name) -{ - UmlNamedElement::setName(name); -} - -void QUmlExecutionSpecification::setNameExpression(QUmlStringExpression *nameExpression) -{ - UmlNamedElement::setNameExpression(nameExpression); -} - -void QUmlExecutionSpecification::setVisibility(QtUml::VisibilityKind visibility) -{ - UmlNamedElement::setVisibility(visibility); -} - -// SLOTS FOR OWNED ATTRIBUTES [InteractionFragment] - -void QUmlExecutionSpecification::addCovered(UmlLifeline *covered) -{ - UmlInteractionFragment::addCovered(covered); -} - -void QUmlExecutionSpecification::removeCovered(UmlLifeline *covered) +QUmlOccurrenceSpecification * +QUmlExecutionSpecification::start() const { - UmlInteractionFragment::removeCovered(covered); -} - -void QUmlExecutionSpecification::setEnclosingInteraction(QUmlInteraction *enclosingInteraction) -{ - UmlInteractionFragment::setEnclosingInteraction(enclosingInteraction); -} - -void QUmlExecutionSpecification::setEnclosingOperand(QUmlInteractionOperand *enclosingOperand) -{ - UmlInteractionFragment::setEnclosingOperand(enclosingOperand); -} - -void QUmlExecutionSpecification::addGeneralOrdering(UmlGeneralOrdering *generalOrdering) -{ - UmlInteractionFragment::addGeneralOrdering(generalOrdering); -} + // This is a read-write association end -void QUmlExecutionSpecification::removeGeneralOrdering(UmlGeneralOrdering *generalOrdering) -{ - UmlInteractionFragment::removeGeneralOrdering(generalOrdering); -} - -// SLOTS FOR OWNED ATTRIBUTES [ExecutionSpecification] - -void QUmlExecutionSpecification::setFinish(QUmlOccurrenceSpecification *finish) -{ - UmlExecutionSpecification::setFinish(finish); + return _start; } void QUmlExecutionSpecification::setStart(QUmlOccurrenceSpecification *start) { - UmlExecutionSpecification::setStart(start); -} + // This is a read-write association end -QT_END_NAMESPACE + if (_start != start) { + _start = start; + if (start->asQObject() && this->asQObject()) + QObject::connect(start->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setStart())); + } +} |