umbrello: umbrello/umlmodel/entity.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
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

entity.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2003-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef ENTITY_H
7#define ENTITY_H
8
9#include "classifier.h"
10
11// forward declarations
12class UMLEntityAttribute;
13class UMLEntityConstraint;
14class UMLUniqueConstraint;
15class UMLForeignKeyConstraint;
16class UMLCheckConstraint;
17class UMLEntityAttributeList;
18
29 class UMLEntity : public UMLClassifier
30{
31 Q_OBJECT
32public:
33 explicit UMLEntity(const QString& name = QString(), Uml::ID::Type id = Uml::ID::None);
34 virtual ~UMLEntity();
35
36 bool operator==(const UMLEntity& rhs) const;
37
38 virtual void copyInto(UMLObject *lhs) const;
39
40 virtual UMLObject* clone() const;
41
42 virtual UMLAttribute* createAttribute(const QString &name = QString(),
43 UMLObject *type = 0, Uml::Visibility::Enum vis = Uml::Visibility::Private,
44 const QString &init = QString());
45
46 UMLUniqueConstraint* createUniqueConstraint(const QString &name = QString());
47 UMLForeignKeyConstraint* createForeignKeyConstraint(const QString &name = QString());
48 UMLCheckConstraint* createCheckConstraint(const QString &name = QString());
49
50 UMLObject* addEntityAttribute(const QString &name, Uml::ID::Type id = Uml::ID::None);
51 bool addEntityAttribute(UMLEntityAttribute* att, IDChangeLog* log = 0);
52 bool addEntityAttribute(UMLEntityAttribute* att, int position);
53
54 int removeEntityAttribute(UMLClassifierListItem* att);
55
56 void signalEntityAttributeRemoved(UMLClassifierListItem *eattr);
57
58 int entityAttributes() const;
59
60 bool setAsPrimaryKey(UMLUniqueConstraint* uconstr);
61 void unsetPrimaryKey();
62 bool hasPrimaryKey() const;
63 bool isPrimaryKey(const UMLUniqueConstraint* uConstr) const;
64
65 bool addConstraint(UMLEntityConstraint* constr);
66 bool removeConstraint(UMLEntityConstraint* constr);
67
68 virtual bool resolveRef();
69
70 virtual void saveToXMI(QXmlStreamWriter& writer);
71
72 UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const;
73
74 UMLEntityAttributeList getEntityAttributes() const;
75
76 virtual UMLClassifierListItem* makeChildObject(const QString& xmiTag);
77
78private slots:
79 void slotEntityAttributeRemoved(UMLClassifierListItem*);
80
81signals:
82 void entityAttributeAdded(UMLClassifierListItem*);
83 void entityAttributeRemoved(UMLClassifierListItem*);
84 void entityConstraintAdded(UMLClassifierListItem*);
85 void entityConstraintRemoved(UMLClassifierListItem*);
86
87protected:
88 bool load1(QDomElement& element);
89
90private:
91
98 UMLUniqueConstraint* m_PrimaryKey;
99
100};
101
102#endif // ENTITY_H
103
IDChangeLog
Definition: idchangelog.h:22
UMLAttribute
Sets up attribute information.
Definition: attribute.h:23
UMLCheckConstraint
Sets up Check Constraint information for UMLEntities.
Definition: checkconstraint.h:21
UMLClassifierListItemList
Definition: umlclassifierlistitemlist.h:22
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
UMLEntityAttributeList
Definition: umlentityattributelist.h:20
UMLEntityAttribute
Sets up entityattribute information.
Definition: entityattribute.h:21
UMLEntityConstraint
Sets up entity constraint information.
Definition: entityconstraint.h:22
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:30
UMLEntity::~UMLEntity
virtual ~UMLEntity()
Definition: entity.cpp:50
UMLEntity::operator==
bool operator==(const UMLEntity &rhs) const
Definition: entity.cpp:58
UMLEntity::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: entity.cpp:67
UMLEntity::createForeignKeyConstraint
UMLForeignKeyConstraint * createForeignKeyConstraint(const QString &name=QString())
Definition: entity.cpp:202
UMLEntity::addEntityAttribute
UMLObject * addEntityAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: entity.cpp:302
UMLEntity::load1
bool load1(QDomElement &element)
Definition: entity.cpp:456
UMLEntity::slotEntityAttributeRemoved
void slotEntityAttributeRemoved(UMLClassifierListItem *)
Definition: entity.cpp:624
UMLEntity::entityAttributeRemoved
void entityAttributeRemoved(UMLClassifierListItem *)
UMLEntity::createAttribute
virtual UMLAttribute * createAttribute(const QString &name=QString(), UMLObject *type=0, Uml::Visibility::Enum vis=Uml::Visibility::Private, const QString &init=QString())
Definition: entity.cpp:97
UMLEntity::entityAttributes
int entityAttributes() const
Definition: entity.cpp:389
UMLEntity::clone
virtual UMLObject * clone() const
Definition: entity.cpp:81
UMLEntity::entityAttributeAdded
void entityAttributeAdded(UMLClassifierListItem *)
UMLEntity::unsetPrimaryKey
void unsetPrimaryKey()
Definition: entity.cpp:553
UMLEntity::removeEntityAttribute
int removeEntityAttribute(UMLClassifierListItem *att)
Definition: entity.cpp:370
UMLEntity::addConstraint
bool addConstraint(UMLEntityConstraint *constr)
Definition: entity.cpp:577
UMLEntity::createUniqueConstraint
UMLUniqueConstraint * createUniqueConstraint(const QString &name=QString())
Definition: entity.cpp:148
UMLEntity::getEntityAttributes
UMLEntityAttributeList getEntityAttributes() const
Definition: entity.cpp:693
UMLEntity::entityConstraintAdded
void entityConstraintAdded(UMLClassifierListItem *)
UMLEntity::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: entity.cpp:434
UMLEntity::isPrimaryKey
bool isPrimaryKey(const UMLUniqueConstraint *uConstr) const
Definition: entity.cpp:680
UMLEntity::makeChildObject
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
Definition: entity.cpp:713
UMLEntity::entityConstraintRemoved
void entityConstraintRemoved(UMLClassifierListItem *)
UMLEntity::createCheckConstraint
UMLCheckConstraint * createCheckConstraint(const QString &name=QString())
Definition: entity.cpp:251
UMLEntity::resolveRef
virtual bool resolveRef()
Definition: entity.cpp:407
UMLEntity::getFilteredList
UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Definition: entity.cpp:646
UMLEntity::setAsPrimaryKey
bool setAsPrimaryKey(UMLUniqueConstraint *uconstr)
Definition: entity.cpp:513
UMLEntity::m_PrimaryKey
UMLUniqueConstraint * m_PrimaryKey
Definition: entity.h:98
UMLEntity::signalEntityAttributeRemoved
void signalEntityAttributeRemoved(UMLClassifierListItem *eattr)
Definition: entity.cpp:398
UMLEntity::removeConstraint
bool removeConstraint(UMLEntityConstraint *constr)
Definition: entity.cpp:600
UMLEntity::hasPrimaryKey
bool hasPrimaryKey() const
Definition: entity.cpp:562
UMLForeignKeyConstraint
Sets up Foreign Key entity constraint information.
Definition: foreignkeyconstraint.h:28
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:76
UMLObject::init
void init()
Definition: umlobject.cpp:122
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
UMLUniqueConstraint
Sets up Unique entity constraint information.
Definition: uniqueconstraint.h:24
classifier.h
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::Visibility::Enum
Enum
Definition: basictypes.h:45
Uml::Visibility::Private
@ Private
Definition: basictypes.h:47