umbrello: umbrello/umlmodel/operation.h Source File

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

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

- File List
- File Members

operation.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 "classifierlistitem.h"
11
12class UMLClassifier;
13
19 class UMLOperation : public UMLClassifierListItem
20{
21 Q_OBJECT
22public:
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 = 0);
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 moveParmLeft(UMLAttribute *a);
39 void moveParmRight(UMLAttribute *a);
40
41 void removeParm(UMLAttribute *a, bool emitModifiedSignal = true);
42
43 UMLAttributeList getParmList() const;
44
45 UMLAttribute * findParm(const QString &name) const;
46
47 QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig,
48 bool withStereotype=false) const;
49
50 void addParm(UMLAttribute *parameter, int position = -1);
51
52 bool resolveRef();
53
54 QString getUniqueParameterName() const;
55
56 virtual bool showPropertiesDialog(QWidget* parent = 0);
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
78protected:
79 bool load1(QDomElement & element);
80
81private:
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
UMLAttributeList
Definition umlattributelist.h:21
UMLAttribute
Sets up attribute information.
Definition attribute.h:23
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition classifierlistitem.h:25
UMLClassifier
Information for a non-graphical Concept/Class.
Definition classifier.h:35
UMLObject
The base class for UML objects.
Definition umlobject.h:70
UMLObject::name
QString name() const
Definition umlobject.cpp:207
UMLOperation
Definition operation.h:20
UMLOperation::m_bInline
bool m_bInline
Holds the inline attribute of the <UML:Operation>
Definition operation.h:88
UMLOperation::m_bConst
bool m_bConst
Holds the isQuery attribute of the <UML:Operation>
Definition operation.h:84
UMLOperation::setType
void setType(UMLObject *type)
Definition operation.cpp:93
UMLOperation::resolveRef
bool resolveRef()
Definition operation.cpp:353
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition operation.cpp:177
UMLOperation::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition operation.cpp:531
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false) const
Definition operation.cpp:205
UMLOperation::m_args
UMLAttributeList m_args
Parameter list.
Definition operation.h:83
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Definition operation.cpp:276
UMLOperation::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition operation.cpp:326
UMLOperation::setConst
void setConst(bool b)
Definition operation.cpp:422
UMLOperation::m_bVirtual
bool m_bVirtual
Holds the virtual attribute of the <UML:Operation>
Definition operation.h:87
UMLOperation::isDestructorOperation
bool isDestructorOperation() const
Definition operation.cpp:391
UMLOperation::setVirtual
void setVirtual(bool b)
Definition operation.cpp:470
UMLOperation::load1
bool load1(QDomElement &element)
Definition operation.cpp:602
UMLOperation::moveParmLeft
void moveParmLeft(UMLAttribute *a)
Definition operation.cpp:105
UMLOperation::setInline
void setInline(bool b)
Definition operation.cpp:486
UMLOperation::setSourceCode
void setSourceCode(const QString &code)
Definition operation.cpp:515
UMLOperation::setOverride
void setOverride(bool b)
Definition operation.cpp:438
UMLOperation::isInline
bool isInline() const
Definition operation.cpp:494
UMLOperation::getSourceCode
QString getSourceCode() const
Definition operation.cpp:523
UMLOperation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition operation.cpp:504
UMLOperation::m_bOverride
bool m_bOverride
Holds the override attribute of the <UML:Operation>
Definition operation.h:85
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Definition operation.cpp:157
UMLOperation::getOverride
bool getOverride() const
Definition operation.cpp:446
UMLOperation::isLifeOperation
bool isLifeOperation() const
Definition operation.cpp:414
UMLOperation::m_bFinal
bool m_bFinal
Holds the final attribute of the <UML:Operation>
Definition operation.h:86
UMLOperation::clone
virtual UMLObject * clone() const
Definition operation.cpp:338
UMLOperation::isVirtual
bool isVirtual() const
Definition operation.cpp:478
UMLOperation::setFinal
void setFinal(bool b)
Definition operation.cpp:454
UMLOperation::getConst
bool getConst() const
Definition operation.cpp:430
UMLOperation::m_Code
QString m_Code
Holds the entered source code.
Definition operation.h:89
UMLOperation::findParm
UMLAttribute * findParm(const QString &name) const
Definition operation.cpp:188
UMLOperation::moveParmRight
void moveParmRight(UMLAttribute *a)
Definition operation.cpp:129
UMLOperation::getFinal
bool getFinal() const
Definition operation.cpp:462
UMLOperation::~UMLOperation
virtual ~UMLOperation()
Definition operation.cpp:84
UMLOperation::isConstructorOperation
bool isConstructorOperation() const
Definition operation.cpp:369
UMLOperation::getUniqueParameterName
QString getUniqueParameterName() const
Definition operation.cpp:289
UMLOperation::operator==
bool operator==(const UMLOperation &rhs) const
Definition operation.cpp:302
UMLOperation::m_returnId
Uml::ID::Type m_returnId
Holds the xmi.id of the <UML:Parameter kind="return">
Definition operation.h:82
classifierlistitem.h
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