Mark implicitly shared classes as a movable type. This can improve performance

and memory efficiency when using Qt's container classes.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-11-25 20:56:17 +02:00
parent 783e3d57c2
commit f0691d7c9f
20 changed files with 37 additions and 1 deletions

View File

@ -89,4 +89,6 @@ private:
qreal MaxLength() const;
};
Q_DECLARE_TYPEINFO(VArc, Q_MOVABLE_TYPE);
#endif // VARC_H

View File

@ -95,4 +95,6 @@ private:
static int PointInCircle (const QPointF &p, const QPointF &center, qreal radius);
};
Q_DECLARE_TYPEINFO(VGObject, Q_MOVABLE_TYPE);
#endif // VGOBJECT_H

View File

@ -69,6 +69,8 @@ private:
QSharedDataPointer<VPointFData> d;
};
Q_DECLARE_TYPEINFO(VPointF, Q_MOVABLE_TYPE);
#if defined(Q_CC_INTEL)
#pragma warning(pop)
#endif

View File

@ -89,4 +89,6 @@ private:
static int Sign(long double ld);
};
Q_DECLARE_TYPEINFO(VSpline, Q_MOVABLE_TYPE);
#endif // VSPLINE_H

View File

@ -182,4 +182,6 @@ private:
QSharedDataPointer<VSplinePathData> d;
};
Q_DECLARE_TYPEINFO(VSplinePath, Q_MOVABLE_TYPE);
#endif // VSPLINEPATH_H

View File

@ -62,5 +62,6 @@ protected:
};
Q_DECLARE_METATYPE(VSplinePoint)
Q_DECLARE_TYPEINFO(VSplinePoint, Q_MOVABLE_TYPE);
#endif // VSPLINEPOINT_H

View File

@ -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

View File

@ -78,4 +78,6 @@ private:
void AppendWhole(QVector<QPointF> &contour, const VLayoutDetail &detail, int detJ) const;
};
Q_DECLARE_TYPEINFO(VContour, Q_MOVABLE_TYPE);
#endif // VCONTOUR_H

View File

@ -85,4 +85,6 @@ private:
static QVector<QPointF> RoundPoints(const QVector<QPointF> &points);
};
Q_DECLARE_TYPEINFO(VLayoutDetail, Q_MOVABLE_TYPE);
#endif // VLAYOUTDETAIL_H

View File

@ -84,4 +84,6 @@ private:
};
Q_DECLARE_TYPEINFO(VLayoutPaper, Q_MOVABLE_TYPE);
#endif // VLAYOUTPAPER_H

View File

@ -54,4 +54,6 @@ private:
QSharedDataPointer<VCurveVariableData> d;
};
Q_DECLARE_TYPEINFO(VCurveVariable, Q_MOVABLE_TYPE);
#endif // VCURVEVARIABLE_H

View File

@ -56,4 +56,6 @@ private:
QSharedDataPointer<VIncrementData> d;
};
Q_DECLARE_TYPEINFO(VIncrement, Q_MOVABLE_TYPE);
#endif // VINCREMENTTABLEROW_H

View File

@ -60,4 +60,6 @@ private:
QSharedDataPointer<VInternalVariableData> d;
};
Q_DECLARE_TYPEINFO(VInternalVariable, Q_MOVABLE_TYPE);
#endif // VINTERNALVARIABLE_H

View File

@ -51,4 +51,6 @@ private:
QSharedDataPointer<VLineAngleData> d;
};
Q_DECLARE_TYPEINFO(VLineAngle, Q_MOVABLE_TYPE);
#endif // VLINEANGLE_H

View File

@ -52,4 +52,6 @@ private:
QSharedDataPointer<VLengthLineData> d;
};
Q_DECLARE_TYPEINFO(VLengthLine, Q_MOVABLE_TYPE);
#endif // VLINELENGTH_H

View File

@ -80,4 +80,6 @@ private:
static void ListValue(QStringList &list, qreal value, Unit patternUnit);
};
Q_DECLARE_TYPEINFO(VMeasurement, Q_MOVABLE_TYPE);
#endif // VSTANDARDTABLEROW_H

View File

@ -64,4 +64,6 @@ private:
QSharedDataPointer<VVariableData> d;
};
Q_DECLARE_TYPEINFO(VVariable, Q_MOVABLE_TYPE);
#endif // VVARIABLE_H

View File

@ -198,7 +198,7 @@ private:
const QMap<QString, QSharedPointer<T> > DataVar(const VarType &type) const;
};
Q_DECLARE_TYPEINFO(VContainer, Q_MOVABLE_TYPE);
/*
* Defintion of templated member functions of VContainer

View File

@ -94,4 +94,6 @@ private:
static QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my);
};
Q_DECLARE_TYPEINFO(VDetail, Q_MOVABLE_TYPE);
#endif // VDETAIL_H

View File

@ -125,5 +125,6 @@ private:
};
Q_DECLARE_METATYPE(VNodeDetail)
Q_DECLARE_TYPEINFO(VNodeDetail, Q_MOVABLE_TYPE);
#endif // VNODEDETAIL_H