summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlgate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlgate.cpp')
-rw-r--r--src/uml/qumlgate.cpp216
1 files changed, 10 insertions, 206 deletions
diff --git a/src/uml/qumlgate.cpp b/src/uml/qumlgate.cpp
index 4531bfa2..94e38d76 100644
--- a/src/uml/qumlgate.cpp
+++ b/src/uml/qumlgate.cpp
@@ -40,222 +40,26 @@
****************************************************************************/
#include "qumlgate.h"
-#include <QtUml/QUmlComment>
-#include <QtUml/QUmlDependency>
-#include <QtUml/QUmlElement>
-#include <QtUml/QUmlMessage>
-#include <QtUml/QUmlNamedElement>
-#include <QtUml/QUmlNamespace>
-#include <QtUml/QUmlPackage>
-#include <QtUml/QUmlStringExpression>
-
-QT_BEGIN_NAMESPACE
+#include "private/qumlgateobject_p.h"
/*!
- \class UmlGate
+ \class QUmlGate
\inmodule QtUml
\brief A gate is a connection point for relating a message outside an interaction fragment with a message inside the interaction fragment.
*/
-
-QUmlGate::QUmlGate(QObject *parent) :
- QObject(parent)
-{
-}
-
-// OWNED ATTRIBUTES [Element]
-
-/*!
- The Comments owned by this element.
- */
-const QSet<QUmlComment *> QUmlGate::ownedComment() const
-{
- return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment));
-}
-
-/*!
- The Elements owned by this element.
- */
-const QSet<QUmlElement *> QUmlGate::ownedElement() const
-{
- return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement));
-}
-
-/*!
- The Element that owns this element.
- */
-QUmlElement *QUmlGate::owner() const
-{
- return reinterpret_cast<QUmlElement *>(_owner);
-}
-
-// OWNED ATTRIBUTES [NamedElement]
-
-/*!
- Indicates the dependencies that reference the client.
- */
-const QSet<QUmlDependency *> QUmlGate::clientDependency() const
-{
- return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency));
-}
-
-/*!
- The name of the NamedElement.
- */
-QString QUmlGate::name() const
-{
- return _name;
-}
-
-/*!
- The string expression used to define the name of this named element.
- */
-QUmlStringExpression *QUmlGate::nameExpression() const
-{
- return reinterpret_cast<QUmlStringExpression *>(_nameExpression);
-}
-
-/*!
- Specifies the namespace that owns the NamedElement.
- */
-QUmlNamespace *QUmlGate::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 QUmlGate::qualifiedName() const
-{
- return UmlNamedElement::qualifiedName();
-}
-
-/*!
- Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
- */
-QtUml::VisibilityKind QUmlGate::visibility() const
-{
- return _visibility;
-}
-
-// OWNED ATTRIBUTES [MessageEnd]
-
-/*!
- References a Message.
- */
-QUmlMessage *QUmlGate::message() const
-{
- return reinterpret_cast<QUmlMessage *>(_message);
-}
-
-// OPERATIONS [Element]
-
-/*!
- The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
- */
-QSet<QUmlElement *> QUmlGate::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 QUmlGate::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 *> QUmlGate::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 *> QUmlGate::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 QUmlGate::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const
-{
- return UmlNamedElement::isDistinguishableFrom(n, ns);
-}
-
-/*!
- The query separator() gives the string that is used to separate names when constructing a qualified name.
- */
-QString QUmlGate::separator() const
-{
- return UmlNamedElement::separator();
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [Element]
-
-void QUmlGate::addOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::addOwnedComment(ownedComment);
-}
-
-void QUmlGate::removeOwnedComment(UmlComment *ownedComment)
-{
- UmlElement::removeOwnedComment(ownedComment);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [NamedElement]
-
-void QUmlGate::addClientDependency(UmlDependency *clientDependency)
+QUmlGate::QUmlGate(bool createQObject)
{
- UmlNamedElement::addClientDependency(clientDependency);
+ if (createQObject)
+ _qObject = new QUmlGateObject(this);
}
-void QUmlGate::removeClientDependency(UmlDependency *clientDependency)
+QUmlGate::~QUmlGate()
{
- UmlNamedElement::removeClientDependency(clientDependency);
+ if (!deletingFromQObject) {
+ _qObject->setProperty("deletingFromModelingObject", true);
+ delete _qObject;
+ }
}
-void QUmlGate::setName(QString name)
-{
- UmlNamedElement::setName(name);
-}
-
-void QUmlGate::setNameExpression(QUmlStringExpression *nameExpression)
-{
- UmlNamedElement::setNameExpression(nameExpression);
-}
-
-void QUmlGate::setVisibility(QtUml::VisibilityKind visibility)
-{
- UmlNamedElement::setVisibility(visibility);
-}
-
-// SLOTS FOR OWNED ATTRIBUTES [MessageEnd]
-
-void QUmlGate::setMessage(QUmlMessage *message)
-{
- UmlMessageEnd::setMessage(message);
-}
-
-QT_END_NAMESPACE
-