umbrello  2.39.2
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
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 
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 
40 
42 
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:
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 
79 
80  bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint& pos);
81 };
82 
83 #endif
Definition: idchangelog.h:68
Point * point(uint i) const
Definition: idchangelog.h:73
uint size() const
Definition: idchangelog.h:74
void setPoint(uint i, const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition: idchangelog.h:70
bool resize(uint size)
Definition: idchangelog.h:75
Definition: idchangelog.h:54
Uml::ID::Type m_x
Definition: idchangelog.h:64
Uml::ID::Type y() const
Definition: idchangelog.h:62
Uml::ID::Type m_y
Definition: idchangelog.h:64
void setX(const Uml::ID::Type &x)
Definition: idchangelog.h:59
Point(const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition: idchangelog.h:57
void setY(const Uml::ID::Type &y)
Definition: idchangelog.h:61
Point()
Definition: idchangelog.h:56
virtual ~Point()
Definition: idchangelog.h:58
Uml::ID::Type x() const
Definition: idchangelog.h:60
Definition: idchangelog.h:22
bool operator==(const IDChangeLog &Other) const
Definition: idchangelog.cpp:46
IDChangeLog & operator+=(const IDChangeLog &Other)
Definition: idchangelog.cpp:72
void addIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID)
Definition: idchangelog.cpp:83
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:57
PointArray m_LogArray
Definition: idchangelog.h:78
~IDChangeLog()
Definition: idchangelog.cpp:26
IDChangeLog()
Definition: idchangelog.cpp:11
void removeChangeByNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:119
Uml::ID::Type findOldID(Uml::ID::Type NewID)
Definition: idchangelog.cpp:94
IDChangeLog & operator=(const IDChangeLog &Other)
Definition: idchangelog.cpp:36
bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint &pos)
Definition: idchangelog.cpp:106
SpecialIDs
Definition: idchangelog.h:44
@ NullID
An impossible id value.
Definition: idchangelog.h:45
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
std::string Type
Definition: basictypes.h:371