Skip to content
Permalink
Browse files
Add c++20 todo for replacing equality operators with default implemen…
…tations
  • Loading branch information
nyalldawson committed Jul 2, 2021
1 parent 65bccd2 commit c8156b01066107b91121417e423dee4a299affc3
Showing with 63 additions and 3 deletions.
  1. +1 −0 python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in
  2. +1 −0 python/core/auto_generated/auth/qgsauthconfig.sip.in
  3. +0 −1 python/core/auto_generated/editform/qgseditformconfig.sip.in
  4. +1 −0 python/core/auto_generated/geometry/qgslinesegment.sip.in
  5. +1 −0 python/core/auto_generated/qgsdefaultvalue.sip.in
  6. +1 −0 python/core/auto_generated/qgsmaplayerdependency.sip.in
  7. +1 −0 python/core/auto_generated/qgsreadwritecontext.sip.in
  8. +1 −0 python/core/auto_generated/symbology/qgssymbollayerreference.sip.in
  9. +1 −0 src/3d/chunks/qgschunknode_p.h
  10. +1 −0 src/3d/materials/qgsgoochmaterialsettings.h
  11. +1 −0 src/3d/materials/qgsphongmaterialsettings.h
  12. +1 −0 src/3d/materials/qgsphongtexturedmaterialsettings.h
  13. +1 −0 src/3d/materials/qgssimplelinematerialsettings.h
  14. +1 −0 src/3d/qgscamerapose.h
  15. +1 −0 src/3d/qgsdirectionallightsettings.h
  16. +1 −0 src/3d/qgspointlightsettings.h
  17. +1 −0 src/3d/qgsraycastingutils_p.h
  18. +1 −0 src/analysis/interpolation/Vector3D.h
  19. +2 −0 src/analysis/vector/geometry_checker/qgsgeometrycheck.h
  20. +1 −0 src/app/vertextool/qgsvertextool.h
  21. +2 −0 src/core/auth/qgsauthconfig.h
  22. +1 −1 src/core/editform/qgseditformconfig.h
  23. +1 −0 src/core/geometry/qgsgeometry.h
  24. +2 −0 src/core/geometry/qgslinesegment.h
  25. +3 −0 src/core/metadata/qgsabstractmetadatabase.h
  26. +3 −0 src/core/metadata/qgslayermetadata.h
  27. +2 −0 src/core/pointcloud/qgspointcloudindex.h
  28. +1 −0 src/core/processing/models/qgsprocessingmodelchilddependency.h
  29. +2 −0 src/core/processing/qgsprocessingparameters.h
  30. +1 −0 src/core/proj/qgscoordinatetransformcontext_p.h
  31. +1 −0 src/core/proj/qgsdatumtransform.h
  32. +1 −0 src/core/providers/qgsabstractdatabaseproviderconnection.h
  33. +1 −0 src/core/providers/qgsprovidersublayerdetails.h
  34. +1 −0 src/core/qgsattributetableconfig.h
  35. +1 −0 src/core/qgsbookmarkmanager.h
  36. +2 −0 src/core/qgsdefaultvalue.h
  37. +1 −0 src/core/qgsfield_p.h
  38. +1 −0 src/core/qgsfieldconstraints.h
  39. +2 −0 src/core/qgsfields.h
  40. +2 −0 src/core/qgsmaplayerdependency.h
  41. +1 −0 src/core/qgsmapthemecollection.h
  42. +1 −0 src/core/qgspointlocator.h
  43. +2 −0 src/core/qgsreadwritecontext.h
  44. +1 −0 src/core/qgsremappingproxyfeaturesink.h
  45. +1 −0 src/core/qgssnappingconfig.h
  46. +1 −0 src/core/qgssnappingutils.h
  47. +2 −1 src/core/qgstemporalutils.h
  48. +1 −0 src/core/qgsvector3d.h
  49. +2 −0 src/core/symbology/qgssymbollayerreference.h
@@ -132,6 +132,7 @@ Create a new Change
QgsGeometryCheck::ChangeType type;

QgsVertexId vidx;

bool operator==( const QgsGeometryCheck::Change &other );
};

@@ -31,6 +31,7 @@ Construct a configuration for an authentication method
:param version: Version of the configuration (for updating previously saved configs later on)
%End


bool operator==( const QgsAuthMethodConfig &other ) const;

bool operator!=( const QgsAuthMethodConfig &other ) const;
@@ -85,7 +85,6 @@ Copy constructor
%End
~QgsEditFormConfig();


bool operator==( const QgsEditFormConfig &o );

void addTab( QgsAttributeEditorElement *data /Transfer/ );
@@ -191,6 +191,7 @@ on the line, or exactly in line with the segment) and the result is undefined.
Reverses the line segment, so that the start and end points are flipped.
%End


bool operator==( const QgsLineSegment2D &other ) const /HoldGIL/;

bool operator!=( const QgsLineSegment2D &other ) const /HoldGIL/;
@@ -44,6 +44,7 @@ Create a new default value with the given ``expression`` and ``applyOnUpdate`` f

.. seealso:: :py:func:`QgsVectorLayer.setDefaultValueDefinition`
%End

bool operator==( const QgsDefaultValue &other ) const;

QString expression() const;
@@ -60,6 +60,7 @@ Returns the dependency origin
Returns the ID of the layer this dependency depends on
%End


bool operator==( const QgsMapLayerDependency &other ) const;

//! hash operator
@@ -45,6 +45,7 @@ Returns the message level
Returns the stack of categories of the message
%End


bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const;

bool operator!=( const QgsReadWriteContext::ReadWriteMessage &other ) const;
@@ -69,6 +69,7 @@ Returns the key associated to the symbol
Returns the symbol layer index path inside the symbol
%End


bool operator==( const QgsSymbolLayerId &other ) const;

bool operator<( const QgsSymbolLayerId &other ) const;
@@ -68,6 +68,7 @@ struct QgsChunkNodeId
return QStringLiteral( "%1/%2/%3/%4" ).arg( d ).arg( x ).arg( y ).arg( z ); // octree
}

// TODO c++20 - replace with = default
bool operator==( const QgsChunkNodeId &other ) const
{
return d == other.d && x == other.x && y == other.y && z == other.z;
@@ -108,6 +108,7 @@ class _3D_EXPORT QgsGoochMaterialSettings : public QgsAbstractMaterialSettings

#endif

// TODO c++20 - replace with = default
bool operator==( const QgsGoochMaterialSettings &other ) const
{
return mDiffuse == other.mDiffuse &&
@@ -96,6 +96,7 @@ class _3D_EXPORT QgsPhongMaterialSettings : public QgsAbstractMaterialSettings
void applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &data ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsPhongMaterialSettings &other ) const
{
return mAmbient == other.mAmbient &&
@@ -120,6 +120,7 @@ class _3D_EXPORT QgsPhongTexturedMaterialSettings : public QgsAbstractMaterialSe
void addParametersToEffect( Qt3DRender::QEffect *effect ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsPhongTexturedMaterialSettings &other ) const
{
return mAmbient == other.mAmbient &&
@@ -78,6 +78,7 @@ class _3D_EXPORT QgsSimpleLineMaterialSettings : public QgsAbstractMaterialSetti
void addParametersToEffect( Qt3DRender::QEffect *effect ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsSimpleLineMaterialSettings &other ) const
{
return mAmbient == other.mAmbient;
@@ -75,6 +75,7 @@ class _3D_EXPORT QgsCameraPose
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsCameraPose &other ) const
{
return mCenterPoint == other.mCenterPoint &&
@@ -55,6 +55,7 @@ class _3D_EXPORT QgsDirectionalLightSettings
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsDirectionalLightSettings &other );

private:
@@ -76,6 +76,7 @@ class _3D_EXPORT QgsPointLightSettings
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsPointLightSettings &other );

private:
@@ -75,6 +75,7 @@ namespace QgsRayCastingUtils
Ray3D &transform( const QMatrix4x4 &matrix );
Ray3D transformed( const QMatrix4x4 &matrix ) const;

// TODO c++20 - replace with = default
bool operator==( const Ray3D &other ) const;
bool operator!=( const Ray3D &other ) const;

@@ -48,6 +48,7 @@ class ANALYSIS_EXPORT Vector3D
//! Default constructor
Vector3D() = default;

// TODO c++20 - replace with = default
bool operator==( const Vector3D &v ) const;
bool operator!=( const Vector3D &v ) const;
//! Returns the x-component of the vector
@@ -200,6 +200,8 @@ class ANALYSIS_EXPORT QgsGeometryCheck
* The index of the part / ring / vertex, depending on \see what.
*/
QgsVertexId vidx;

// TODO c++20 - replace with = default
bool operator==( const QgsGeometryCheck::Change &other )
{
return what == other.what && type == other.type && vidx == other.vidx;
@@ -42,6 +42,7 @@ struct Vertex
, fid( fid )
, vertexId( vertexId ) {}

// TODO c++20 - replace with = default
bool operator==( const Vertex &other ) const
{
return layer == other.layer && fid == other.fid && vertexId == other.vertexId;
@@ -49,6 +49,8 @@ class CORE_EXPORT QgsAuthMethodConfig
*/
QgsAuthMethodConfig( const QString &method = QString(), int version = 0 );

// TODO c++20 - replace with = default

//! Operator used to compare configs' equality
bool operator==( const QgsAuthMethodConfig &other ) const;

@@ -124,7 +124,7 @@ class CORE_EXPORT QgsEditFormConfig
~QgsEditFormConfig();

QgsEditFormConfig &operator=( const QgsEditFormConfig &o );

// TODO c++20 - replace with = default
bool operator==( const QgsEditFormConfig &o );

/**
@@ -2312,6 +2312,7 @@ class CORE_EXPORT QgsGeometry
% End
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsGeometry::Error &other ) const
{
return other.mMessage == mMessage && other.mHasLocation == mHasLocation && other.mLocation == mLocation;
@@ -218,6 +218,8 @@ class CORE_EXPORT QgsLineSegment2D
std::swap( mStart, mEnd );
}

// TODO c++20 - replace with = default

//! Equality operator
bool operator==( const QgsLineSegment2D &other ) const SIP_HOLDGIL
{
@@ -127,6 +127,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString country;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Address &other ) const;
};

@@ -188,6 +189,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString role;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Contact &other ) const;
};

@@ -252,6 +254,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString size;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Link &other ) const;
};

@@ -81,6 +81,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
QgsBox3d bounds;

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::SpatialExtent &other ) const;
};

@@ -118,6 +119,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
void setTemporalExtents( const QList< QgsDateTimeRange > &extents );

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::Extent &other ) const;

#ifndef SIP_RUN
@@ -155,6 +157,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
QString constraint;

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::Constraint &other ) const;

};
@@ -62,6 +62,8 @@ class CORE_EXPORT IndexedPointCloudNode
//! Returns whether node is valid
bool isValid() const { return mD >= 0; }

// TODO c++20 - replace with = default

//! Compares nodes
bool operator==( IndexedPointCloudNode other ) const
{
@@ -72,6 +72,7 @@ class CORE_EXPORT QgsProcessingModelChildDependency
return true;
}

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingModelChildDependency &other ) const
{
return childId == other.childId && conditionalBranch == other.conditionalBranch;
@@ -162,6 +162,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition
*/
bool loadVariant( const QVariantMap &map );

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingFeatureSourceDefinition &other ) const
{
return source == other.source
@@ -296,6 +297,7 @@ class CORE_EXPORT QgsProcessingOutputLayerDefinition
return QVariant::fromValue( *this );
}

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingOutputLayerDefinition &other ) const;
bool operator!=( const QgsProcessingOutputLayerDefinition &other ) const;

@@ -64,6 +64,7 @@ class QgsCoordinateTransformContextPrivate : public QSharedData
QString operation;
bool allowFallback = true;

// TODO c++20 - replace with = default
bool operator==( const OperationDetails &other ) const
{
return operation == other.operation && allowFallback == other.allowFallback;
@@ -73,6 +73,7 @@ class CORE_EXPORT QgsDatumTransform
*/
int destinationTransformId = -1;

// TODO c++20 - replace with = default
bool operator==( QgsDatumTransform::TransformPair other ) const
{
return other.sourceTransformId == sourceTransformId && other.destinationTransformId == destinationTransformId;
@@ -234,6 +234,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv
QgsWkbTypes::Type wkbType;
QgsCoordinateReferenceSystem crs;

// TODO c++20 - replace with = default
inline bool operator==( const GeometryColumnType &other ) const
{
return this->crs == other.crs && this->wkbType == other.wkbType;
@@ -230,6 +230,7 @@ class CORE_EXPORT QgsProviderSublayerDetails
*/
void setLayerNumber( int number ) { mLayerNumber = number; }

// TODO c++20 - replace with = default
bool operator==( const QgsProviderSublayerDetails &other ) const;
bool operator!=( const QgsProviderSublayerDetails &other ) const;

@@ -54,6 +54,7 @@ class CORE_EXPORT QgsAttributeTableConfig
//! Constructor for ColumnConfig
ColumnConfig() = default;

// TODO c++20 - replace with = default
bool operator== ( const QgsAttributeTableConfig::ColumnConfig &other ) const SIP_SKIP;

QgsAttributeTableConfig::Type type = Field; //!< The type of this column.
@@ -116,6 +116,7 @@ class CORE_EXPORT QgsBookmark
% End
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsBookmark &other );
bool operator!=( const QgsBookmark &other );

@@ -59,6 +59,8 @@ class CORE_EXPORT QgsDefaultValue
* \see QgsVectorLayer::setDefaultValueDefinition
*/
explicit QgsDefaultValue( const QString &expression = QString(), bool applyOnUpdate = false );

// TODO c++20 - replace with = default
bool operator==( const QgsDefaultValue &other ) const;

/**
@@ -84,6 +84,7 @@ class QgsFieldPrivate : public QSharedData

~QgsFieldPrivate() = default;

// TODO c++20 - replace with = default
bool operator==( const QgsFieldPrivate &other ) const
{
return ( ( name == other.name ) && ( type == other.type ) && ( subType == other.subType )
@@ -141,6 +141,7 @@ class CORE_EXPORT QgsFieldConstraints
*/
void setConstraintExpression( const QString &expression, const QString &description = QString() );

// TODO c++20 - replace with = default
bool operator==( const QgsFieldConstraints &other ) const;

private:
@@ -67,6 +67,8 @@ class CORE_EXPORT QgsFields
, originIndex( oi )
{}

// TODO c++20 - replace with = default

//! \since QGIS 2.6
bool operator==( const Field &other ) const { return field == other.field && origin == other.origin && originIndex == other.originIndex; }
//! \since QGIS 2.6
@@ -67,6 +67,8 @@ class CORE_EXPORT QgsMapLayerDependency
//! Returns the ID of the layer this dependency depends on
QString layerId() const { return mLayerId; }

// TODO c++20 - replace with = default

//! Comparison operator
bool operator==( const QgsMapLayerDependency &other ) const
{
@@ -61,6 +61,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
//! Initialize layer record with a map layer - it will be stored as a weak pointer
MapThemeLayerRecord( QgsMapLayer *l = nullptr ): mLayer( l ) {}

// TODO c++20 - replace with = default
bool operator==( const QgsMapThemeCollection::MapThemeLayerRecord &other ) const
{
return mLayer == other.mLayer && isVisible == other.isVisible &&
@@ -276,6 +276,7 @@ class CORE_EXPORT QgsPointLocator : public QObject
return point;
}

// TODO c++20 - replace with = default
bool operator==( const QgsPointLocator::Match &other ) const
{
return mType == other.mType &&
@@ -57,6 +57,8 @@ class CORE_EXPORT QgsReadWriteContext
//! Returns the stack of categories of the message
QStringList categories() const {return mCategories;}

// TODO c++20 - replace with = default

bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const
{
return mMessage == other.mMessage && mLevel == other.mLevel && mCategories == other.mCategories;

0 comments on commit c8156b0

Please sign in to comment.