umbrello 26.03.70-f7b1fd3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

umloperation.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef OPERATION_H
7#define OPERATION_H
8
9#include "umlattributelist.h"
10#include "umlclassifierlistitem.h"
11
12 class UMLClassifier;
13
19 class UMLOperation : public UMLClassifierListItem
20{
21 Q_OBJECT
22 public:
23 UMLOperation(UMLClassifier * parent, const QString& name,
24 Uml::ID::Type id = Uml::ID::None,
25 Uml::Visibility::Enum s = Uml::Visibility::Public,
26 UMLObject *rt = nullptr);
27 explicit UMLOperation(UMLClassifier * parent);
28 virtual ~UMLOperation();
29
30 bool operator==(const UMLOperation & rhs) const;
31
32 virtual void copyInto(UMLObject *lhs) const;
33
34 virtual UMLObject* clone() const;
35
36 void setType(UMLObject* type);
37
38 void moveParameterLeft(UMLAttribute *a);
39 void moveParameterRight(UMLAttribute *a);
40
41 void removeParameter(UMLAttribute *a, bool emitModifiedSignal = true);
42
43 UMLAttributeList getParameterList() const;
44
45 UMLAttribute * findParameter(const QString &name) const;
46
47 QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig,
48 bool withStereotype=false) const;
49
50 void addParameter(UMLAttribute *parameter, int position = -1);
51
52 bool resolveRef();
53
54 QString getUniqueParameterName() const;
55
56 virtual bool showPropertiesDialog(QWidget *parent = nullptr);
57
58 bool isConstructorOperation() const;
59 bool isDestructorOperation() const;
60 bool isLifeOperation() const;
61
62 void setConst(bool b);
63 bool getConst() const;
64 void setOverride(bool b);
65 bool getOverride() const;
66 void setFinal(bool b);
67 bool getFinal() const;
68 void setVirtual(bool b);
69 bool isVirtual() const;
70 void setInline(bool b);
71 bool isInline() const;
72
73 void setSourceCode(const QString& code);
74 QString getSourceCode() const;
75
76 void saveToXMI(QXmlStreamWriter& writer);
77
78 protected:
79 bool load1(QDomElement & element);
80
81 private:
82 Uml::ID::Type m_returnId;
83 UMLAttributeList m_args;
84 bool m_bConst;
85 bool m_bOverride;
86 bool m_bFinal;
87 bool m_bVirtual;
88 bool m_bInline;
89 QString m_Code;
90};
91
92#endif
UMLAttribute
Sets up attribute information.
Definition: umlattribute.h:23
UMLAttributeList
Definition: umlattributelist.h:21
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.h:35
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: umlclassifierlistitem.h:25
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
UMLOperation
Definition: umloperation.h:20
UMLOperation::m_bInline
bool m_bInline
Holds the inline attribute of the <UML:Operation>
Definition: umloperation.h:88
UMLOperation::m_bConst
bool m_bConst
Holds the isQuery attribute of the <UML:Operation>
Definition: umloperation.h:84
UMLOperation::setType
void setType(UMLObject *type)
Definition: umloperation.cpp:93
UMLOperation::moveParameterRight
void moveParameterRight(UMLAttribute *a)
Definition: umloperation.cpp:129
UMLOperation::resolveRef
bool resolveRef()
Definition: umloperation.cpp:352
UMLOperation::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: umloperation.cpp:530
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false) const
Definition: umloperation.cpp:204
UMLOperation::m_args
UMLAttributeList m_args
Parameter list.
Definition: umloperation.h:83
UMLOperation::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umloperation.cpp:325
UMLOperation::setConst
void setConst(bool b)
Definition: umloperation.cpp:421
UMLOperation::m_bVirtual
bool m_bVirtual
Holds the virtual attribute of the <UML:Operation>
Definition: umloperation.h:87
UMLOperation::findParameter
UMLAttribute * findParameter(const QString &name) const
Definition: umloperation.cpp:188
UMLOperation::moveParameterLeft
void moveParameterLeft(UMLAttribute *a)
Definition: umloperation.cpp:105
UMLOperation::addParameter
void addParameter(UMLAttribute *parameter, int position=-1)
Definition: umloperation.cpp:275
UMLOperation::isDestructorOperation
bool isDestructorOperation() const
Definition: umloperation.cpp:390
UMLOperation::setVirtual
void setVirtual(bool b)
Definition: umloperation.cpp:469
UMLOperation::load1
bool load1(QDomElement &element)
Definition: umloperation.cpp:601
UMLOperation::setInline
void setInline(bool b)
Definition: umloperation.cpp:485
UMLOperation::setSourceCode
void setSourceCode(const QString &code)
Definition: umloperation.cpp:514
UMLOperation::setOverride
void setOverride(bool b)
Definition: umloperation.cpp:437
UMLOperation::isInline
bool isInline() const
Definition: umloperation.cpp:493
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: umloperation.cpp:522
UMLOperation::m_bOverride
bool m_bOverride
Holds the override attribute of the <UML:Operation>
Definition: umloperation.h:85
UMLOperation::getOverride
bool getOverride() const
Definition: umloperation.cpp:445
UMLOperation::isLifeOperation
bool isLifeOperation() const
Definition: umloperation.cpp:413
UMLOperation::m_bFinal
bool m_bFinal
Holds the final attribute of the <UML:Operation>
Definition: umloperation.h:86
UMLOperation::clone
virtual UMLObject * clone() const
Definition: umloperation.cpp:337
UMLOperation::isVirtual
bool isVirtual() const
Definition: umloperation.cpp:477
UMLOperation::setFinal
void setFinal(bool b)
Definition: umloperation.cpp:453
UMLOperation::getConst
bool getConst() const
Definition: umloperation.cpp:429
UMLOperation::removeParameter
void removeParameter(UMLAttribute *a, bool emitModifiedSignal=true)
Definition: umloperation.cpp:157
UMLOperation::m_Code
QString m_Code
Holds the entered source code.
Definition: umloperation.h:89
UMLOperation::getFinal
bool getFinal() const
Definition: umloperation.cpp:461
UMLOperation::~UMLOperation
virtual ~UMLOperation()
Definition: umloperation.cpp:84
UMLOperation::isConstructorOperation
bool isConstructorOperation() const
Definition: umloperation.cpp:368
UMLOperation::getUniqueParameterName
QString getUniqueParameterName() const
Definition: umloperation.cpp:288
UMLOperation::operator==
bool operator==(const UMLOperation &rhs) const
Definition: umloperation.cpp:301
UMLOperation::getParameterList
UMLAttributeList getParameterList() const
Definition: umloperation.cpp:177
UMLOperation::m_returnId
Uml::ID::Type m_returnId
Holds the xmi.id of the <UML:Parameter kind="return">
Definition: umloperation.h:82
UMLOperation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=nullptr)
Definition: umloperation.cpp:503
b
bool b
Definition: cxx11-null-pointer-constant.h:6
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:160
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:161
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
Uml::Visibility::Public
@ Public
Definition: basictypes.h:46
a
QString a
Definition: petalnode.cpp:13
umlattributelist.h
umlclassifierlistitem.h