diff options
Diffstat (limited to 'src/uml/qumlobservation.cpp')
-rw-r--r-- | src/uml/qumlobservation.cpp | 244 |
1 files changed, 3 insertions, 241 deletions
diff --git a/src/uml/qumlobservation.cpp b/src/uml/qumlobservation.cpp index c30d7393..0f7cac8a 100644 --- a/src/uml/qumlobservation.cpp +++ b/src/uml/qumlobservation.cpp @@ -40,256 +40,18 @@ ****************************************************************************/ #include "qumlobservation.h" -#include <QtUml/QUmlComment> -#include <QtUml/QUmlDependency> -#include <QtUml/QUmlElement> -#include <QtUml/QUmlNamedElement> -#include <QtUml/QUmlNamespace> -#include <QtUml/QUmlPackage> -#include <QtUml/QUmlParameterableElement> -#include <QtUml/QUmlStringExpression> -#include <QtUml/QUmlTemplateParameter> - -QT_BEGIN_NAMESPACE - /*! - \class UmlObservation + \class QUmlObservation \inmodule QtUml \brief Observation is a superclass of TimeObservation and DurationObservation in order for TimeExpression and Duration to refer to either in a simple way. */ - -QUmlObservation::QUmlObservation(QObject *parent) : - QObject(parent) -{ -} - -// OWNED ATTRIBUTES [Element] - -/*! - The Comments owned by this element. - */ -const QSet<QUmlComment *> QUmlObservation::ownedComment() const -{ - return *(reinterpret_cast<const QSet<QUmlComment *> *>(&_ownedComment)); -} - -/*! - The Elements owned by this element. - */ -const QSet<QUmlElement *> QUmlObservation::ownedElement() const -{ - return *(reinterpret_cast<const QSet<QUmlElement *> *>(&_ownedElement)); -} - -/*! - The Element that owns this element. - */ -QUmlElement *QUmlObservation::owner() const -{ - return reinterpret_cast<QUmlElement *>(_owner); -} - -// OWNED ATTRIBUTES [ParameterableElement] - -/*! - The formal template parameter that owns this element. - */ -QUmlTemplateParameter *QUmlObservation::owningTemplateParameter() const -{ - return reinterpret_cast<QUmlTemplateParameter *>(_owningTemplateParameter); -} - -/*! - The template parameter that exposes this element as a formal parameter. - */ -QUmlTemplateParameter *QUmlObservation::templateParameter() const -{ - return reinterpret_cast<QUmlTemplateParameter *>(_templateParameter); -} - -// OWNED ATTRIBUTES [NamedElement] - -/*! - Indicates the dependencies that reference the client. - */ -const QSet<QUmlDependency *> QUmlObservation::clientDependency() const -{ - return *(reinterpret_cast<const QSet<QUmlDependency *> *>(&_clientDependency)); -} - -/*! - The name of the NamedElement. - */ -QString QUmlObservation::name() const -{ - return _name; -} - -/*! - The string expression used to define the name of this named element. - */ -QUmlStringExpression *QUmlObservation::nameExpression() const -{ - return reinterpret_cast<QUmlStringExpression *>(_nameExpression); -} - -/*! - Specifies the namespace that owns the NamedElement. - */ -QUmlNamespace *QUmlObservation::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 QUmlObservation::qualifiedName() const -{ - return UmlNamedElement::qualifiedName(); -} -// OWNED ATTRIBUTES [PackageableElement] - -/*! - Indicates that packageable elements must always have a visibility, i.e., visibility is not optional. - */ -QtUml::VisibilityKind QUmlObservation::visibility() const -{ - return _visibility; -} - -// OPERATIONS [Element] - -/*! - The query allOwnedElements() gives all of the direct and indirect owned elements of an element. - */ -QSet<QUmlElement *> QUmlObservation::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 QUmlObservation::mustBeOwned() const -{ - return UmlElement::mustBeOwned(); -} - -// OPERATIONS [ParameterableElement] - -/*! - The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. Subclasses should override this operation to specify different compatibility constraints. - */ -bool QUmlObservation::isCompatibleWith(QUmlParameterableElement *p) const -{ - return UmlParameterableElement::isCompatibleWith(p); -} - -/*! - The query isTemplateParameter() determines if this parameterable element is exposed as a formal template parameter. - */ -bool QUmlObservation::isTemplateParameter() const -{ - return UmlParameterableElement::isTemplateParameter(); -} - -// OPERATIONS [NamedElement] - -/*! - The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards. - */ -QList<QUmlNamespace *> QUmlObservation::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 *> QUmlObservation::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 QUmlObservation::isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const +QUmlObservation::QUmlObservation() { - return UmlNamedElement::isDistinguishableFrom(n, ns); } -/*! - The query separator() gives the string that is used to separate names when constructing a qualified name. - */ -QString QUmlObservation::separator() const -{ - return UmlNamedElement::separator(); -} - -// SLOTS FOR OWNED ATTRIBUTES [Element] - -void QUmlObservation::addOwnedComment(UmlComment *ownedComment) -{ - UmlElement::addOwnedComment(ownedComment); -} - -void QUmlObservation::removeOwnedComment(UmlComment *ownedComment) +QUmlObservation::~QUmlObservation() { - UmlElement::removeOwnedComment(ownedComment); } -// SLOTS FOR OWNED ATTRIBUTES [ParameterableElement] - -void QUmlObservation::setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter) -{ - UmlParameterableElement::setOwningTemplateParameter(owningTemplateParameter); -} - -void QUmlObservation::setTemplateParameter(QUmlTemplateParameter *templateParameter) -{ - UmlParameterableElement::setTemplateParameter(templateParameter); -} - -// SLOTS FOR OWNED ATTRIBUTES [NamedElement] - -void QUmlObservation::addClientDependency(UmlDependency *clientDependency) -{ - UmlNamedElement::addClientDependency(clientDependency); -} - -void QUmlObservation::removeClientDependency(UmlDependency *clientDependency) -{ - UmlNamedElement::removeClientDependency(clientDependency); -} - -void QUmlObservation::setName(QString name) -{ - UmlNamedElement::setName(name); -} - -void QUmlObservation::setNameExpression(QUmlStringExpression *nameExpression) -{ - UmlNamedElement::setNameExpression(nameExpression); -} -// SLOTS FOR OWNED ATTRIBUTES [PackageableElement] - -void QUmlObservation::setVisibility(QtUml::VisibilityKind visibility) -{ - UmlPackageableElement::setVisibility(visibility); -} - -QT_END_NAMESPACE - |