From f0691d7c9f3a4046f93861dbce6de93281ae129b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Nov 2015 20:56:17 +0200 Subject: [PATCH] Mark implicitly shared classes as a movable type. This can improve performance and memory efficiency when using Qt's container classes. --HG-- branch : develop --- src/libs/vgeometry/varc.h | 2 ++ src/libs/vgeometry/vgobject.h | 2 ++ src/libs/vgeometry/vpointf.h | 2 ++ src/libs/vgeometry/vspline.h | 2 ++ src/libs/vgeometry/vsplinepath.h | 2 ++ src/libs/vgeometry/vsplinepoint.h | 1 + src/libs/vlayout/vabstractdetail.h | 2 ++ src/libs/vlayout/vcontour.h | 2 ++ src/libs/vlayout/vlayoutdetail.h | 2 ++ src/libs/vlayout/vlayoutpaper.h | 2 ++ src/libs/vpatterndb/variables/vcurvevariable.h | 2 ++ src/libs/vpatterndb/variables/vincrement.h | 2 ++ src/libs/vpatterndb/variables/vinternalvariable.h | 2 ++ src/libs/vpatterndb/variables/vlineangle.h | 2 ++ src/libs/vpatterndb/variables/vlinelength.h | 2 ++ src/libs/vpatterndb/variables/vmeasurement.h | 2 ++ src/libs/vpatterndb/variables/vvariable.h | 2 ++ src/libs/vpatterndb/vcontainer.h | 2 +- src/libs/vpatterndb/vdetail.h | 2 ++ src/libs/vpatterndb/vnodedetail.h | 1 + 20 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/libs/vgeometry/varc.h b/src/libs/vgeometry/varc.h index dd1e3361a..7802eaab7 100644 --- a/src/libs/vgeometry/varc.h +++ b/src/libs/vgeometry/varc.h @@ -89,4 +89,6 @@ private: qreal MaxLength() const; }; +Q_DECLARE_TYPEINFO(VArc, Q_MOVABLE_TYPE); + #endif // VARC_H diff --git a/src/libs/vgeometry/vgobject.h b/src/libs/vgeometry/vgobject.h index 0a0d0ffdd..527f14094 100644 --- a/src/libs/vgeometry/vgobject.h +++ b/src/libs/vgeometry/vgobject.h @@ -95,4 +95,6 @@ private: static int PointInCircle (const QPointF &p, const QPointF ¢er, qreal radius); }; +Q_DECLARE_TYPEINFO(VGObject, Q_MOVABLE_TYPE); + #endif // VGOBJECT_H diff --git a/src/libs/vgeometry/vpointf.h b/src/libs/vgeometry/vpointf.h index b253f14c5..04fa0d8ae 100644 --- a/src/libs/vgeometry/vpointf.h +++ b/src/libs/vgeometry/vpointf.h @@ -69,6 +69,8 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VPointF, Q_MOVABLE_TYPE); + #if defined(Q_CC_INTEL) #pragma warning(pop) #endif diff --git a/src/libs/vgeometry/vspline.h b/src/libs/vgeometry/vspline.h index e61b74233..44b5f3dba 100644 --- a/src/libs/vgeometry/vspline.h +++ b/src/libs/vgeometry/vspline.h @@ -89,4 +89,6 @@ private: static int Sign(long double ld); }; +Q_DECLARE_TYPEINFO(VSpline, Q_MOVABLE_TYPE); + #endif // VSPLINE_H diff --git a/src/libs/vgeometry/vsplinepath.h b/src/libs/vgeometry/vsplinepath.h index 7a5f5addf..04ea29fb0 100644 --- a/src/libs/vgeometry/vsplinepath.h +++ b/src/libs/vgeometry/vsplinepath.h @@ -182,4 +182,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VSplinePath, Q_MOVABLE_TYPE); + #endif // VSPLINEPATH_H diff --git a/src/libs/vgeometry/vsplinepoint.h b/src/libs/vgeometry/vsplinepoint.h index e6aae714f..c455978bf 100644 --- a/src/libs/vgeometry/vsplinepoint.h +++ b/src/libs/vgeometry/vsplinepoint.h @@ -62,5 +62,6 @@ protected: }; Q_DECLARE_METATYPE(VSplinePoint) +Q_DECLARE_TYPEINFO(VSplinePoint, Q_MOVABLE_TYPE); #endif // VSPLINEPOINT_H diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h index f8aad520a..00cf72ad6 100644 --- a/src/libs/vlayout/vabstractdetail.h +++ b/src/libs/vlayout/vabstractdetail.h @@ -82,4 +82,6 @@ private: static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); }; +Q_DECLARE_TYPEINFO(VAbstractDetail, Q_MOVABLE_TYPE); + #endif // VABSTRACTDETAIL_H diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h index 5a6aaa6f7..659fbbf22 100644 --- a/src/libs/vlayout/vcontour.h +++ b/src/libs/vlayout/vcontour.h @@ -78,4 +78,6 @@ private: void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const; }; +Q_DECLARE_TYPEINFO(VContour, Q_MOVABLE_TYPE); + #endif // VCONTOUR_H diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h index 80e53a93b..69dbb0e0c 100644 --- a/src/libs/vlayout/vlayoutdetail.h +++ b/src/libs/vlayout/vlayoutdetail.h @@ -85,4 +85,6 @@ private: static QVector RoundPoints(const QVector &points); }; +Q_DECLARE_TYPEINFO(VLayoutDetail, Q_MOVABLE_TYPE); + #endif // VLAYOUTDETAIL_H diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index ce1888d88..8728cc8a1 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -84,4 +84,6 @@ private: }; +Q_DECLARE_TYPEINFO(VLayoutPaper, Q_MOVABLE_TYPE); + #endif // VLAYOUTPAPER_H diff --git a/src/libs/vpatterndb/variables/vcurvevariable.h b/src/libs/vpatterndb/variables/vcurvevariable.h index a074acf11..de3970bf6 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable.h +++ b/src/libs/vpatterndb/variables/vcurvevariable.h @@ -54,4 +54,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VCurveVariable, Q_MOVABLE_TYPE); + #endif // VCURVEVARIABLE_H diff --git a/src/libs/vpatterndb/variables/vincrement.h b/src/libs/vpatterndb/variables/vincrement.h index 5f20905fa..e927c9c5a 100644 --- a/src/libs/vpatterndb/variables/vincrement.h +++ b/src/libs/vpatterndb/variables/vincrement.h @@ -56,4 +56,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VIncrement, Q_MOVABLE_TYPE); + #endif // VINCREMENTTABLEROW_H diff --git a/src/libs/vpatterndb/variables/vinternalvariable.h b/src/libs/vpatterndb/variables/vinternalvariable.h index 1eb8d3fc3..9632f6ca4 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.h +++ b/src/libs/vpatterndb/variables/vinternalvariable.h @@ -60,4 +60,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VInternalVariable, Q_MOVABLE_TYPE); + #endif // VINTERNALVARIABLE_H diff --git a/src/libs/vpatterndb/variables/vlineangle.h b/src/libs/vpatterndb/variables/vlineangle.h index cd15bd3ec..f64440035 100644 --- a/src/libs/vpatterndb/variables/vlineangle.h +++ b/src/libs/vpatterndb/variables/vlineangle.h @@ -51,4 +51,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VLineAngle, Q_MOVABLE_TYPE); + #endif // VLINEANGLE_H diff --git a/src/libs/vpatterndb/variables/vlinelength.h b/src/libs/vpatterndb/variables/vlinelength.h index 47d9b6c5e..00a3eedd9 100644 --- a/src/libs/vpatterndb/variables/vlinelength.h +++ b/src/libs/vpatterndb/variables/vlinelength.h @@ -52,4 +52,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VLengthLine, Q_MOVABLE_TYPE); + #endif // VLINELENGTH_H diff --git a/src/libs/vpatterndb/variables/vmeasurement.h b/src/libs/vpatterndb/variables/vmeasurement.h index 206dc1a9a..3be732e81 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.h +++ b/src/libs/vpatterndb/variables/vmeasurement.h @@ -80,4 +80,6 @@ private: static void ListValue(QStringList &list, qreal value, Unit patternUnit); }; +Q_DECLARE_TYPEINFO(VMeasurement, Q_MOVABLE_TYPE); + #endif // VSTANDARDTABLEROW_H diff --git a/src/libs/vpatterndb/variables/vvariable.h b/src/libs/vpatterndb/variables/vvariable.h index 3fbf24c08..488e9e04e 100644 --- a/src/libs/vpatterndb/variables/vvariable.h +++ b/src/libs/vpatterndb/variables/vvariable.h @@ -64,4 +64,6 @@ private: QSharedDataPointer d; }; +Q_DECLARE_TYPEINFO(VVariable, Q_MOVABLE_TYPE); + #endif // VVARIABLE_H diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index 3641e2f9e..e2f7c3770 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -198,7 +198,7 @@ private: const QMap > DataVar(const VarType &type) const; }; - +Q_DECLARE_TYPEINFO(VContainer, Q_MOVABLE_TYPE); /* * Defintion of templated member functions of VContainer diff --git a/src/libs/vpatterndb/vdetail.h b/src/libs/vpatterndb/vdetail.h index b765239a5..e0402f94a 100644 --- a/src/libs/vpatterndb/vdetail.h +++ b/src/libs/vpatterndb/vdetail.h @@ -94,4 +94,6 @@ private: static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); }; +Q_DECLARE_TYPEINFO(VDetail, Q_MOVABLE_TYPE); + #endif // VDETAIL_H diff --git a/src/libs/vpatterndb/vnodedetail.h b/src/libs/vpatterndb/vnodedetail.h index a229440f3..aa662b1bb 100644 --- a/src/libs/vpatterndb/vnodedetail.h +++ b/src/libs/vpatterndb/vnodedetail.h @@ -125,5 +125,6 @@ private: }; Q_DECLARE_METATYPE(VNodeDetail) +Q_DECLARE_TYPEINFO(VNodeDetail, Q_MOVABLE_TYPE); #endif // VNODEDETAIL_H