umbrello 2.39.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

idchangelog.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef IDCHANGELOG_H
7#define IDCHANGELOG_H
8
9#include "basictypes.h"
10
11#include <QVector>
12
21 class IDChangeLog
22{
23 public:
24
25 IDChangeLog();
26 IDChangeLog(const IDChangeLog& Other);
27
28 ~IDChangeLog();
29
30 IDChangeLog& operator=(const IDChangeLog& Other);
31
32 bool operator==(const IDChangeLog& Other) const;
33
34 void addIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID);
35
36 IDChangeLog& operator+=(const IDChangeLog& Other);
37
38 Uml::ID::Type findNewID(Uml::ID::Type OldID);
39 Uml::ID::Type findOldID(Uml::ID::Type NewID);
40
41 void removeChangeByNewID(Uml::ID::Type OldID);
42
43 enum SpecialIDs
44 {
45 NullID = -1000
46 };
47
48 private:
49
53 class Point
54 {
55 public:
56 Point() {}
57 Point(const Uml::ID::Type &x, const Uml::ID::Type &y) : m_x(x), m_y(y) {}
58 virtual ~Point() {}
59 void setX(const Uml::ID::Type &x) { m_x = x; }
60 Uml::ID::Type x() const { return m_x; }
61 void setY(const Uml::ID::Type &y) { m_y = y; }
62 Uml::ID::Type y() const { return m_y; }
63 private:
64 Uml::ID::Type m_x, m_y;
65 };
66
67 class PointArray : QVector<Point*>
68 {
69 public:
70 void setPoint(uint i, const Uml::ID::Type &x, const Uml::ID::Type &y) {
71 QVector<Point*>::insert(i, new Point(x, y));
72 }
73 Point* point(uint i) const { return QVector<Point*>::at(i); }
74 uint size() const { return QVector<Point*>::size(); }
75 bool resize(uint size) { QVector<Point*>::resize(size); return true; }
76 };
77
78 PointArray m_LogArray;
79
80 bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint& pos);
81};
82
83#endif
basictypes.h
IDChangeLog::PointArray
Definition idchangelog.h:68
IDChangeLog::PointArray::size
uint size() const
Definition idchangelog.h:74
IDChangeLog::PointArray::point
Point * point(uint i) const
Definition idchangelog.h:73
IDChangeLog::PointArray::setPoint
void setPoint(uint i, const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition idchangelog.h:70
IDChangeLog::PointArray::resize
bool resize(uint size)
Definition idchangelog.h:75
IDChangeLog::Point
Definition idchangelog.h:54
IDChangeLog::Point::m_x
Uml::ID::Type m_x
Definition idchangelog.h:64
IDChangeLog::Point::y
Uml::ID::Type y() const
Definition idchangelog.h:62
IDChangeLog::Point::m_y
Uml::ID::Type m_y
Definition idchangelog.h:64
IDChangeLog::Point::setX
void setX(const Uml::ID::Type &x)
Definition idchangelog.h:59
IDChangeLog::Point::Point
Point(const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition idchangelog.h:57
IDChangeLog::Point::setY
void setY(const Uml::ID::Type &y)
Definition idchangelog.h:61
IDChangeLog::Point::Point
Point()
Definition idchangelog.h:56
IDChangeLog::Point::~Point
virtual ~Point()
Definition idchangelog.h:58
IDChangeLog::Point::x
Uml::ID::Type x() const
Definition idchangelog.h:60
IDChangeLog
Definition idchangelog.h:22
IDChangeLog::operator==
bool operator==(const IDChangeLog &Other) const
Definition idchangelog.cpp:46
IDChangeLog::operator+=
IDChangeLog & operator+=(const IDChangeLog &Other)
Definition idchangelog.cpp:72
IDChangeLog::addIDChange
void addIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID)
Definition idchangelog.cpp:83
IDChangeLog::findNewID
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition idchangelog.cpp:57
IDChangeLog::m_LogArray
PointArray m_LogArray
Definition idchangelog.h:78
IDChangeLog::~IDChangeLog
~IDChangeLog()
Definition idchangelog.cpp:26
IDChangeLog::IDChangeLog
IDChangeLog()
Definition idchangelog.cpp:11
IDChangeLog::removeChangeByNewID
void removeChangeByNewID(Uml::ID::Type OldID)
Definition idchangelog.cpp:119
IDChangeLog::findOldID
Uml::ID::Type findOldID(Uml::ID::Type NewID)
Definition idchangelog.cpp:94
IDChangeLog::operator=
IDChangeLog & operator=(const IDChangeLog &Other)
Definition idchangelog.cpp:36
IDChangeLog::findIDChange
bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint &pos)
Definition idchangelog.cpp:106
IDChangeLog::SpecialIDs
SpecialIDs
Definition idchangelog.h:44
IDChangeLog::NullID
@ NullID
An impossible id value.
Definition idchangelog.h:45
x
int x
Definition cxx11-lambda-functions-and-expressions.h:4
Uml::ID::Type
std::string Type
Definition basictypes.h:371