umbrello  2.31.90
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  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2002-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef IDCHANGELOG_H
12 #define IDCHANGELOG_H
13 
14 #include "basictypes.h"
15 
16 #include <QVector>
17 
27 {
28 public:
29 
30  IDChangeLog();
31  IDChangeLog(const IDChangeLog& Other);
32 
33  ~IDChangeLog();
34 
35  IDChangeLog& operator=(const IDChangeLog& Other);
36 
37  bool operator==(const IDChangeLog& Other) const;
38 
39  void addIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID);
40 
41  IDChangeLog& operator+=(const IDChangeLog& Other);
42 
45 
47 
49  {
50  NullID = -1000
51  };
52 
53 private:
54 
58  class Point
59  {
60  public:
61  Point() {}
62  Point(const Uml::ID::Type &x, const Uml::ID::Type &y) : m_x(x), m_y(y) {}
63  virtual ~Point() {}
64  void setX(const Uml::ID::Type &x) { m_x = x; }
65  Uml::ID::Type x() const { return m_x; }
66  void setY(const Uml::ID::Type &y) { m_y = y; }
67  Uml::ID::Type y() const { return m_y; }
68  private:
70  };
71 
72  class PointArray : QVector<Point*>
73  {
74  public:
75  void setPoint(uint i, const Uml::ID::Type &x, const Uml::ID::Type &y) {
76  QVector<Point*>::insert(i, new Point(x, y));
77  }
78  Point* point(uint i) const { return QVector<Point*>::at(i); }
79  uint size() const { return QVector<Point*>::size(); }
80  bool resize(uint size) { QVector<Point*>::resize(size); return true; }
81  };
82 
84 
85  bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint& pos);
86 };
87 
88 #endif
IDChangeLog::Point::m_y
Uml::ID::Type m_y
Definition: idchangelog.h:69
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
IDChangeLog::Point
Definition: idchangelog.h:59
IDChangeLog::Point::Point
Point(const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition: idchangelog.h:62
IDChangeLog::findNewID
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:62
IDChangeLog::~IDChangeLog
~IDChangeLog()
Definition: idchangelog.cpp:31
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
IDChangeLog::Point::x
Uml::ID::Type x() const
Definition: idchangelog.h:65
IDChangeLog::Point::~Point
virtual ~Point()
Definition: idchangelog.h:63
IDChangeLog::PointArray::setPoint
void setPoint(uint i, const Uml::ID::Type &x, const Uml::ID::Type &y)
Definition: idchangelog.h:75
IDChangeLog::operator+=
IDChangeLog & operator+=(const IDChangeLog &Other)
Definition: idchangelog.cpp:77
IDChangeLog::PointArray::size
uint size() const
Definition: idchangelog.h:79
IDChangeLog::findIDChange
bool findIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID, uint &pos)
Definition: idchangelog.cpp:111
IDChangeLog::removeChangeByNewID
void removeChangeByNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:124
IDChangeLog
Definition: idchangelog.h:27
IDChangeLog::IDChangeLog
IDChangeLog()
Definition: idchangelog.cpp:16
IDChangeLog::PointArray::resize
bool resize(uint size)
Definition: idchangelog.h:80
IDChangeLog::operator==
bool operator==(const IDChangeLog &Other) const
Definition: idchangelog.cpp:51
IDChangeLog::addIDChange
void addIDChange(Uml::ID::Type OldID, Uml::ID::Type NewID)
Definition: idchangelog.cpp:88
basictypes.h
IDChangeLog::Point::setY
void setY(const Uml::ID::Type &y)
Definition: idchangelog.h:66
IDChangeLog::operator=
IDChangeLog & operator=(const IDChangeLog &Other)
Definition: idchangelog.cpp:41
IDChangeLog::NullID
@ NullID
An impossible id value.
Definition: idchangelog.h:50
IDChangeLog::PointArray::point
Point * point(uint i) const
Definition: idchangelog.h:78
IDChangeLog::PointArray
Definition: idchangelog.h:73
IDChangeLog::SpecialIDs
SpecialIDs
Definition: idchangelog.h:49
IDChangeLog::Point::y
Uml::ID::Type y() const
Definition: idchangelog.h:67
IDChangeLog::findOldID
Uml::ID::Type findOldID(Uml::ID::Type NewID)
Definition: idchangelog.cpp:99
IDChangeLog::Point::m_x
Uml::ID::Type m_x
Definition: idchangelog.h:69
idchangelog.h
IDChangeLog::Point::setX
void setX(const Uml::ID::Type &x)
Definition: idchangelog.h:64
IDChangeLog::m_LogArray
PointArray m_LogArray
Definition: idchangelog.h:83
IDChangeLog::Point::Point
Point()
Definition: idchangelog.h:61