Refactoring. Add a move assignment operator to all classes that use

QSharedDataPointer class to keep data.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2017-04-19 13:27:17 +03:00
parent a0262e260b
commit b2ed7d9db4
32 changed files with 283 additions and 32 deletions

View File

@ -54,9 +54,16 @@ public:
VAbstractArc (const GOType &type, const VPointF &center, qreal f1, quint32 idObject = 0,
Draw mode = Draw::Calculation);
explicit VAbstractArc(const VAbstractArc &arc);
VAbstractArc& operator= (const VAbstractArc &arc);
virtual ~VAbstractArc();
VAbstractArc& operator= (const VAbstractArc &arc);
#ifdef Q_COMPILER_RVALUE_REFS
VAbstractArc &operator=(VAbstractArc &&arc) Q_DECL_NOTHROW { Swap(arc); return *this; }
#endif
void Swap(VAbstractArc &arc) Q_DECL_NOTHROW
{ std::swap(d, arc.d); }
QString GetFormulaF1 () const;
void SetFormulaF1 (const QString &formula, qreal value);
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE;

View File

@ -53,9 +53,16 @@ public:
explicit VAbstractCurve(const GOType &type, const quint32 &idObject = NULL_ID,
const Draw &mode = Draw::Calculation);
explicit VAbstractCurve(const VAbstractCurve &curve);
VAbstractCurve& operator= (const VAbstractCurve &curve);
virtual ~VAbstractCurve() Q_DECL_OVERRIDE;
VAbstractCurve& operator= (const VAbstractCurve &curve);
#ifdef Q_COMPILER_RVALUE_REFS
VAbstractCurve &operator=(VAbstractCurve &&curve) Q_DECL_NOTHROW { Swap(curve); return *this; }
#endif
void Swap(VAbstractCurve &curve) Q_DECL_NOTHROW
{ std::swap(d, curve.d); }
virtual QVector<QPointF> GetPoints() const =0;
static QVector<QPointF> GetSegmentPoints(const QVector<QPointF> &points, const QPointF &begin, const QPointF &end,
bool reverse = false);

View File

@ -59,12 +59,19 @@ public:
qreal f1, const QString &formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation);
VArc (qreal length, const VPointF &center, qreal radius, qreal f1);
VArc(const VArc &arc);
VArc& operator= (const VArc &arc);
VArc Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
VArc Flip(const QLineF &axis, const QString &prefix = QString()) const;
VArc Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VArc() Q_DECL_OVERRIDE;
VArc& operator= (const VArc &arc);
#ifdef Q_COMPILER_RVALUE_REFS
VArc &operator=(VArc &&arc) Q_DECL_NOTHROW { Swap(arc); return *this; }
#endif
void Swap(VArc &arc) Q_DECL_NOTHROW
{ std::swap(d, arc.d); }
QString GetFormulaRadius () const;
void SetFormulaRadius (const QString &formula, qreal value);
qreal GetRadius () const;

View File

@ -50,12 +50,19 @@ public:
VCubicBezier(const VCubicBezier &curve);
VCubicBezier(const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4, quint32 idObject = 0,
Draw mode = Draw::Calculation);
VCubicBezier &operator=(const VCubicBezier &curve);
VCubicBezier Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
VCubicBezier Flip(const QLineF &axis, const QString &prefix = QString()) const;
VCubicBezier Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VCubicBezier();
VCubicBezier &operator=(const VCubicBezier &curve);
#ifdef Q_COMPILER_RVALUE_REFS
VCubicBezier &operator=(VCubicBezier &&curve) Q_DECL_NOTHROW { Swap(curve); return *this; }
#endif
void Swap(VCubicBezier &curve) Q_DECL_NOTHROW
{ std::swap(d, curve.d); }
virtual VPointF GetP1() const Q_DECL_OVERRIDE;
void SetP1(const VPointF &p);

View File

@ -51,12 +51,19 @@ public:
explicit VCubicBezierPath(quint32 idObject = 0, Draw mode = Draw::Calculation);
VCubicBezierPath(const VCubicBezierPath &curve);
VCubicBezierPath(const QVector<VPointF> &points, quint32 idObject = 0, Draw mode = Draw::Calculation);
VCubicBezierPath &operator=(const VCubicBezierPath &curve);
VCubicBezierPath Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
VCubicBezierPath Flip(const QLineF &axis, const QString &prefix = QString()) const;
VCubicBezierPath Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VCubicBezierPath();
VCubicBezierPath &operator=(const VCubicBezierPath &curve);
#ifdef Q_COMPILER_RVALUE_REFS
VCubicBezierPath &operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW { Swap(curve); return *this; }
#endif
void Swap(VCubicBezierPath &curve) Q_DECL_NOTHROW
{ std::swap(d, curve.d); }
VPointF &operator[](int indx);
const VPointF &at(int indx) const;

View File

@ -59,16 +59,22 @@ public:
qreal rotationAngle, const QString &formulaRotationAngle, quint32 idObject = 0,
Draw mode = Draw::Calculation);
VEllipticalArc (qreal length, const VPointF &center, qreal radius1, qreal radius2, qreal f1, qreal rotationAngle);
VEllipticalArc(const VEllipticalArc &arc);
VEllipticalArc& operator= (const VEllipticalArc &arc);
VEllipticalArc Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
VEllipticalArc Flip(const QLineF &axis, const QString &prefix = QString()) const;
VEllipticalArc Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VEllipticalArc() Q_DECL_OVERRIDE;
VEllipticalArc& operator= (const VEllipticalArc &arc);
#ifdef Q_COMPILER_RVALUE_REFS
VEllipticalArc &operator=(VEllipticalArc &&arc) Q_DECL_NOTHROW { Swap(arc); return *this; }
#endif
void Swap(VEllipticalArc &arc) Q_DECL_NOTHROW
{ std::swap(d, arc.d); }
QString GetFormulaRotationAngle () const;
void SetFormulaRotationAngle (const QString &formula, qreal value);
qreal GetRotationAngle() const;

View File

@ -53,9 +53,17 @@ public:
VGObject();
explicit VGObject(const GOType &type, const quint32 &idObject = 0, const Draw &mode = Draw::Calculation);
VGObject(const VGObject &obj);
VGObject& operator= (const VGObject &obj);
virtual ~VGObject();
VGObject& operator= (const VGObject &obj);
#ifdef Q_COMPILER_RVALUE_REFS
VGObject &operator=(VGObject &&obj) Q_DECL_NOTHROW { Swap(obj); return *this; }
#endif
void Swap(VGObject &obj) Q_DECL_NOTHROW
{ std::swap(d, obj.d); }
quint32 getIdObject() const;
void setIdObject(const quint32 &value);

View File

@ -59,7 +59,15 @@ public:
VPointF (const QPointF &point, const QString &name, qreal mx, qreal my, quint32 idObject = 0,
const Draw &mode = Draw::Calculation);
virtual ~VPointF() Q_DECL_OVERRIDE;
VPointF &operator=(const VPointF &point);
#ifdef Q_COMPILER_RVALUE_REFS
VPointF &operator=(VPointF &&point) Q_DECL_NOTHROW { Swap(point); return *this; }
#endif
void Swap(VPointF &point) Q_DECL_NOTHROW
{ std::swap(d, point.d); }
explicit operator QPointF() const;
VPointF Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
VPointF Flip(const QLineF &axis, const QString &prefix = QString()) const;

View File

@ -64,7 +64,14 @@ public:
VSpline Flip(const QLineF &axis, const QString &prefix = QString()) const;
VSpline Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VSpline();
VSpline &operator=(const VSpline &spline);
#ifdef Q_COMPILER_RVALUE_REFS
VSpline &operator=(VSpline &&spline) Q_DECL_NOTHROW { Swap(spline); return *this; }
#endif
void Swap(VSpline &spline) Q_DECL_NOTHROW
{ std::swap(d, spline.d); }
virtual VPointF GetP1 () const Q_DECL_OVERRIDE;
void SetP1 (const VPointF &p);

View File

@ -64,8 +64,14 @@ public:
VSplinePath Move(qreal length, qreal angle, const QString &prefix = QString()) const;
virtual ~VSplinePath() Q_DECL_OVERRIDE;
VSplinePath &operator=(const VSplinePath &path);
VSplinePoint &operator[](int indx);
VSplinePath &operator=(const VSplinePath &path);
#ifdef Q_COMPILER_RVALUE_REFS
VSplinePath &operator=(VSplinePath &&path) Q_DECL_NOTHROW { Swap(path); return *this; }
#endif
void Swap(VSplinePath &path) Q_DECL_NOTHROW
{ std::swap(d, path.d); }
void append(const VSplinePoint &point);

View File

@ -49,9 +49,16 @@ public:
VFSplinePoint();
VFSplinePoint(const VPointF &pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
VFSplinePoint(const VFSplinePoint &point);
VFSplinePoint &operator=(const VFSplinePoint &point);
~VFSplinePoint();
VFSplinePoint &operator=(const VFSplinePoint &point);
#ifdef Q_COMPILER_RVALUE_REFS
VFSplinePoint &operator=(VFSplinePoint &&point) Q_DECL_NOTHROW { Swap(point); return *this; }
#endif
void Swap(VFSplinePoint &point) Q_DECL_NOTHROW
{ std::swap(d, point.d); }
VPointF P() const;
void SetP(const VPointF &value);
qreal Angle1() const;
@ -82,9 +89,16 @@ public:
VSplinePoint(const VPointF &pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F,
qreal length1, const QString &length1F, qreal length2, const QString &length2F);
VSplinePoint(const VSplinePoint &point);
VSplinePoint &operator=(const VSplinePoint &point);
~VSplinePoint();
VSplinePoint &operator=(const VSplinePoint &point);
#ifdef Q_COMPILER_RVALUE_REFS
VSplinePoint &operator=(VSplinePoint &&point) Q_DECL_NOTHROW { Swap(point); return *this; }
#endif
void Swap(VSplinePoint &point) Q_DECL_NOTHROW
{ std::swap(d, point.d); }
VPointF P() const;
void SetP(const VPointF &value);

View File

@ -140,9 +140,16 @@ class VAbstractPiece
public:
VAbstractPiece();
VAbstractPiece(const VAbstractPiece &piece);
VAbstractPiece &operator=(const VAbstractPiece &piece);
virtual ~VAbstractPiece();
VAbstractPiece &operator=(const VAbstractPiece &piece);
#ifdef Q_COMPILER_RVALUE_REFS
VAbstractPiece &operator=(VAbstractPiece &&piece) Q_DECL_NOTHROW { Swap(piece); return *this; }
#endif
void Swap(VAbstractPiece &piece) Q_DECL_NOTHROW
{ std::swap(d, piece.d); }
QString GetName() const;
void SetName(const QString &value);

View File

@ -50,9 +50,17 @@ public:
VContour();
VContour(int height, int width);
VContour(const VContour &contour);
VContour &operator=(const VContour &contour);
~VContour();
VContour &operator=(const VContour &contour);
#ifdef Q_COMPILER_RVALUE_REFS
VContour &operator=(VContour &&contour) Q_DECL_NOTHROW { Swap(contour); return *this; }
#endif
void Swap(VContour &contour) Q_DECL_NOTHROW
{ std::swap(d, contour.d); }
void SetContour(const QVector<QPointF> &contour);
QVector<QPointF> GetContour() const;

View File

@ -52,9 +52,17 @@ public:
VLayoutPaper();
VLayoutPaper(int height, int width);
VLayoutPaper(const VLayoutPaper &paper);
VLayoutPaper &operator=(const VLayoutPaper &paper);
~VLayoutPaper();
VLayoutPaper &operator=(const VLayoutPaper &paper);
#ifdef Q_COMPILER_RVALUE_REFS
VLayoutPaper &operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW { Swap(paper); return *this; }
#endif
void Swap(VLayoutPaper &paper) Q_DECL_NOTHROW
{ std::swap(d, paper.d); }
int GetHeight() const;
void SetHeight(int height);

View File

@ -59,9 +59,17 @@ class VLayoutPiece :public VAbstractPiece
public:
VLayoutPiece();
VLayoutPiece(const VLayoutPiece &detail);
VLayoutPiece &operator=(const VLayoutPiece &detail);
virtual ~VLayoutPiece() Q_DECL_OVERRIDE;
VLayoutPiece &operator=(const VLayoutPiece &detail);
#ifdef Q_COMPILER_RVALUE_REFS
VLayoutPiece &operator=(VLayoutPiece &&detail) Q_DECL_NOTHROW { Swap(detail); return *this; }
#endif
void Swap(VLayoutPiece &detail) Q_DECL_NOTHROW
{ std::swap(d, detail.d); }
static VLayoutPiece Create(const VPiece &piece, const VContainer *pattern);
QVector<QPointF> GetContourPoints() const;

View File

@ -41,9 +41,17 @@ public:
VLayoutPiecePath();
VLayoutPiecePath(const QVector<QPointF> &points, Qt::PenStyle penStyle = Qt::SolidLine);
VLayoutPiecePath(const VLayoutPiecePath &path);
VLayoutPiecePath &operator=(const VLayoutPiecePath &path);
virtual ~VLayoutPiecePath();
VLayoutPiecePath &operator=(const VLayoutPiecePath &path);
#ifdef Q_COMPILER_RVALUE_REFS
VLayoutPiecePath &operator=(VLayoutPiecePath &&path) Q_DECL_NOTHROW { Swap(path); return *this; }
#endif
void Swap(VLayoutPiecePath &path) Q_DECL_NOTHROW
{ std::swap(d, path.d); }
QPainterPath GetPainterPath() const;
QVector<QPointF> Points() const;

View File

@ -39,9 +39,17 @@ class VAbstractFloatItemData
public:
VAbstractFloatItemData();
VAbstractFloatItemData(const VAbstractFloatItemData &data);
VAbstractFloatItemData &operator=(const VAbstractFloatItemData &data);
virtual ~VAbstractFloatItemData();
VAbstractFloatItemData &operator=(const VAbstractFloatItemData &data);
#ifdef Q_COMPILER_RVALUE_REFS
VAbstractFloatItemData &operator=(VAbstractFloatItemData &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
#endif
void Swap(VAbstractFloatItemData &data) Q_DECL_NOTHROW
{ std::swap(d, data.d); }
// methods, which set and return values of different parameters
QPointF GetPos() const;
void SetPos(const QPointF& ptPos);

View File

@ -46,9 +46,17 @@ class VGrainlineData : public VAbstractFloatItemData
public:
VGrainlineData();
VGrainlineData(const VGrainlineData &data);
VGrainlineData &operator=(const VGrainlineData &data);
virtual ~VGrainlineData();
VGrainlineData &operator=(const VGrainlineData &data);
#ifdef Q_COMPILER_RVALUE_REFS
VGrainlineData &operator=(VGrainlineData &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
#endif
void Swap(VGrainlineData &data) Q_DECL_NOTHROW
{ std::swap(d, data.d); }
// methods, which set and return values of different parameters
QString GetLength() const;
void SetLength(const QString& qsLen);

View File

@ -43,9 +43,17 @@ class VPatternLabelData : public VAbstractFloatItemData
public:
VPatternLabelData();
VPatternLabelData(const VPatternLabelData &data);
VPatternLabelData &operator=(const VPatternLabelData &data);
virtual ~VPatternLabelData();
VPatternLabelData &operator=(const VPatternLabelData &data);
#ifdef Q_COMPILER_RVALUE_REFS
VPatternLabelData &operator=(VPatternLabelData &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
#endif
void Swap(VPatternLabelData &data) Q_DECL_NOTHROW
{ std::swap(d, data.d); }
// methods, which set up label parameters
QString GetLabelWidth() const;
void SetLabelWidth(const QString &dLabelW);

View File

@ -45,9 +45,17 @@ class VPieceLabelData : public VPatternLabelData
public:
VPieceLabelData();
VPieceLabelData(const VPieceLabelData &data);
VPieceLabelData &operator=(const VPieceLabelData &data);
virtual ~VPieceLabelData();
VPieceLabelData &operator=(const VPieceLabelData &data);
#ifdef Q_COMPILER_RVALUE_REFS
VPieceLabelData &operator=(VPieceLabelData &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
#endif
void Swap(VPieceLabelData &data) Q_DECL_NOTHROW
{ std::swap(d, data.d); }
// methods, which operate on MaterialCutPlacement container
void Append(const MaterialCutPlacement& rMCP);
void Insert(int i, const MaterialCutPlacement& rMCP);

View File

@ -44,9 +44,17 @@ public:
VCurveVariable();
VCurveVariable(const quint32 &id, const quint32 &parentId);
VCurveVariable(const VCurveVariable &var);
VCurveVariable &operator=(const VCurveVariable &var);
virtual ~VCurveVariable() Q_DECL_OVERRIDE;
VCurveVariable &operator=(const VCurveVariable &var);
#ifdef Q_COMPILER_RVALUE_REFS
VCurveVariable &operator=(VCurveVariable &&var) Q_DECL_NOTHROW { Swap(var); return *this; }
#endif
void Swap(VCurveVariable &var) Q_DECL_NOTHROW
{ std::swap(d, var.d); }
virtual bool Filter(quint32 id) Q_DECL_OVERRIDE;
quint32 GetId() const;

View File

@ -50,9 +50,17 @@ public:
VIncrement(VContainer *data, const QString &name, quint32 index, qreal base, const QString &formula, bool ok,
const QString &description = QString());
VIncrement(const VIncrement &incr);
VIncrement &operator=(const VIncrement &incr);
virtual ~VIncrement() Q_DECL_OVERRIDE;
VIncrement &operator=(const VIncrement &incr);
#ifdef Q_COMPILER_RVALUE_REFS
VIncrement &operator=(VIncrement &&incr) Q_DECL_NOTHROW { Swap(incr); return *this; }
#endif
void Swap(VIncrement &incr) Q_DECL_NOTHROW
{ std::swap(d, incr.d); }
quint32 getIndex() const;
QString GetFormula() const;
bool IsFormulaOk() const;

View File

@ -43,9 +43,17 @@ class VInternalVariable
public:
VInternalVariable();
VInternalVariable(const VInternalVariable &var);
VInternalVariable &operator=(const VInternalVariable &var);
virtual ~VInternalVariable();
VInternalVariable &operator=(const VInternalVariable &var);
#ifdef Q_COMPILER_RVALUE_REFS
VInternalVariable &operator=(VInternalVariable &&var) Q_DECL_NOTHROW { Swap(var); return *this; }
#endif
void Swap(VInternalVariable &var) Q_DECL_NOTHROW
{ std::swap(d, var.d); }
qreal GetValue() const;
qreal* GetValue();
void SetValue(const qreal &value);

View File

@ -45,9 +45,17 @@ public:
VLineAngle();
VLineAngle(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id);
VLineAngle(const VLineAngle &var);
VLineAngle &operator=(const VLineAngle &var);
virtual ~VLineAngle() Q_DECL_OVERRIDE;
VLineAngle &operator=(const VLineAngle &var);
#ifdef Q_COMPILER_RVALUE_REFS
VLineAngle &operator=(VLineAngle &&var) Q_DECL_NOTHROW { Swap(var); return *this; }
#endif
void Swap(VLineAngle &var) Q_DECL_NOTHROW
{ std::swap(d, var.d); }
virtual bool Filter(quint32 id) Q_DECL_OVERRIDE;
void SetValue(const VPointF *p1, const VPointF *p2);
quint32 GetP1Id() const;

View File

@ -47,9 +47,17 @@ public:
VLengthLine();
VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *p2, const quint32 &p2Id, Unit patternUnit);
VLengthLine(const VLengthLine &var);
VLengthLine &operator=(const VLengthLine &var);
virtual ~VLengthLine() Q_DECL_OVERRIDE;
VLengthLine &operator=(const VLengthLine &var);
#ifdef Q_COMPILER_RVALUE_REFS
VLengthLine &operator=(VLengthLine &&var) Q_DECL_NOTHROW { Swap(var); return *this; }
#endif
void Swap(VLengthLine &var) Q_DECL_NOTHROW
{ std::swap(d, var.d); }
virtual bool Filter(quint32 id) Q_DECL_OVERRIDE;
void SetValue(const VPointF *p1, const VPointF *p2);
quint32 GetP1Id() const;

View File

@ -57,9 +57,17 @@ public:
bool ok, const QString &gui_text = QString(), const QString &description = QString(),
const QString &tagName = QString());
VMeasurement(const VMeasurement &m);
VMeasurement &operator=(const VMeasurement &m);
virtual ~VMeasurement() Q_DECL_OVERRIDE;
VMeasurement &operator=(const VMeasurement &m);
#ifdef Q_COMPILER_RVALUE_REFS
VMeasurement &operator=(VMeasurement &&m) Q_DECL_NOTHROW { Swap(m); return *this; }
#endif
void Swap(VMeasurement &m) Q_DECL_NOTHROW
{ std::swap(d, m.d); }
QString GetGuiText() const;
QString TagName() const;

View File

@ -49,9 +49,17 @@ public:
const qreal &kheight = 0, const QString &description = QString());
VVariable(const QString &name, const qreal &base, const QString &description = QString());
VVariable(const VVariable &var);
VVariable &operator=(const VVariable &var);
virtual ~VVariable() Q_DECL_OVERRIDE;
VVariable &operator=(const VVariable &var);
#ifdef Q_COMPILER_RVALUE_REFS
VVariable &operator=(VVariable &&var) Q_DECL_NOTHROW { Swap(var); return *this; }
#endif
void Swap(VVariable &var) Q_DECL_NOTHROW
{ std::swap(d, var.d); }
qreal GetBase() const;
void SetBase(const qreal &value);

View File

@ -118,10 +118,17 @@ class VContainer
Q_DECLARE_TR_FUNCTIONS(VContainer)
public:
VContainer(const VTranslateVars *trVars, const Unit *patternUnit);
VContainer &operator=(const VContainer &data);
VContainer(const VContainer &data);
~VContainer();
VContainer &operator=(const VContainer &data);
#ifdef Q_COMPILER_RVALUE_REFS
VContainer &operator=(VContainer &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
#endif
void Swap(VContainer &data) Q_DECL_NOTHROW
{ std::swap(d, data.d); }
template <typename T>
const QSharedPointer<T> GeometricObject(const quint32 &id) const;
const QSharedPointer<VGObject> GetGObject(quint32 id) const;

View File

@ -64,13 +64,22 @@ public:
* @param node node
*/
VNodeDetail(const VNodeDetail &node);
~VNodeDetail();
/**
* @brief operator = assignment operator
* @param node node
* @return node
*/
VNodeDetail &operator=(const VNodeDetail &node);
~VNodeDetail();
#ifdef Q_COMPILER_RVALUE_REFS
VNodeDetail &operator=(VNodeDetail &&node) Q_DECL_NOTHROW { Swap(node); return *this; }
#endif
void Swap(VNodeDetail &node) Q_DECL_NOTHROW
{ std::swap(d, node.d); }
/**
* @brief getId return object id.
* @return id.

View File

@ -51,9 +51,17 @@ class VPiece : public VAbstractPiece
public:
VPiece();
VPiece(const VPiece &piece);
VPiece &operator=(const VPiece &piece);
virtual ~VPiece();
VPiece &operator=(const VPiece &piece);
#ifdef Q_COMPILER_RVALUE_REFS
VPiece &operator=(VPiece &&piece) Q_DECL_NOTHROW { Swap(piece); return *this; }
#endif
void Swap(VPiece &piece) Q_DECL_NOTHROW
{ std::swap(d, piece.d); }
VPiecePath GetPath() const;
VPiecePath &GetPath();
void SetPath(const VPiecePath &path);

View File

@ -44,9 +44,17 @@ public:
VPieceNode();
VPieceNode(quint32 id, Tool typeTool, bool reverse = false);
VPieceNode(const VPieceNode &node);
VPieceNode &operator=(const VPieceNode &node);
~VPieceNode();
VPieceNode &operator=(const VPieceNode &node);
#ifdef Q_COMPILER_RVALUE_REFS
VPieceNode &operator=(VPieceNode &&node) Q_DECL_NOTHROW { Swap(node); return *this; }
#endif
void Swap(VPieceNode &node) Q_DECL_NOTHROW
{ std::swap(d, node.d); }
friend QDataStream& operator<<(QDataStream& out, const VPieceNode& p);
friend QDataStream& operator>>(QDataStream& in, VPieceNode& p);

View File

@ -48,9 +48,17 @@ public:
VPiecePath();
explicit VPiecePath(PiecePathType type);
VPiecePath(const VPiecePath &path);
VPiecePath &operator=(const VPiecePath &path);
~VPiecePath();
VPiecePath &operator=(const VPiecePath &path);
#ifdef Q_COMPILER_RVALUE_REFS
VPiecePath &operator=(VPiecePath &&path) Q_DECL_NOTHROW { Swap(path); return *this; }
#endif
void Swap(VPiecePath &path) Q_DECL_NOTHROW
{ std::swap(d, path.d); }
void Append(const VPieceNode &node);
void Clear();
qint32 CountNodes() const;