Skip to content
Permalink
Browse files

Fix classes which violate the rule-of-three

(identified using clazy analyser)
  • Loading branch information
nyalldawson committed Oct 24, 2016
1 parent 12a7bb3 commit 3272964f588b8fd06fea45942e844f7f6798796e
@@ -58,4 +58,5 @@ class QgsRasterProjector : QgsRasterInterface
static bool extentSize( const QgsCoordinateTransform& ct,
const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
QgsRectangle& theDestExtent, int& theDestXSize, int& theDestYSize );

};
@@ -69,4 +69,8 @@ class QgsLayerTreeEmbeddedWidgetRegistry
protected:
//! Protected constructor - use instance() to access the registry.
QgsLayerTreeEmbeddedWidgetRegistry();

private:

QgsLayerTreeEmbeddedWidgetRegistry( const QgsLayerTreeEmbeddedWidgetRegistry& other );
};
@@ -129,7 +129,7 @@ class ANALYSIS_EXPORT QgsOSMDatabase
* Encapsulate iteration over table of nodes/
* @note not available in Python bindings
*/
class ANALYSIS_EXPORT QgsOSMNodeIterator
class ANALYSIS_EXPORT QgsOSMNodeIterator // clazy:exclude=rule-of-three
{
public:
~QgsOSMNodeIterator();
@@ -145,6 +145,7 @@ class ANALYSIS_EXPORT QgsOSMNodeIterator
sqlite3_stmt* mStmt;

friend class QgsOSMDatabase;

};


@@ -153,7 +154,7 @@ class ANALYSIS_EXPORT QgsOSMNodeIterator
* Encapsulate iteration over table of ways
* @note not available in Python bindings
*/
class ANALYSIS_EXPORT QgsOSMWayIterator
class ANALYSIS_EXPORT QgsOSMWayIterator // clazy:exclude=rule-of-three
{
public:
~QgsOSMWayIterator();
@@ -168,9 +169,8 @@ class ANALYSIS_EXPORT QgsOSMWayIterator

sqlite3_stmt* mStmt;

private:

friend class QgsOSMDatabase;

};


@@ -322,6 +322,12 @@ namespace pal
* @return maximum # of iteration
*/
int getMaxIt();

private:

Pal( const Pal& other );
Pal& operator=( const Pal& other );

};

} // end namespace pal
@@ -96,6 +96,8 @@ namespace pal
int *layersNbLabelledObjects; // [nbLayers]

PalStat();
PalStat( const PalStat& other );
PalStat& operator=( const PalStat& other );
};

} // end namespace pal
@@ -175,6 +175,9 @@ namespace pal

private:

Problem( const Problem& other );
Problem& operator=( const Problem& other );

/**
* How many layers are labelled ?
*/
@@ -444,6 +444,11 @@ namespace pal
ASSERT( m_file );
return fread( static_cast< void* >( a_array ), sizeof( TYPE ) * a_count, 1, m_file );
}

private:

RTFileStream( const RTFileStream& other );
RTFileStream& operator=( const RTFileStream& other );
};


@@ -135,7 +135,7 @@ class CORE_EXPORT Qgis
* @note not available in Python bindings
*/
// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
template<class Object> class QgsSignalBlocker
template<class Object> class QgsSignalBlocker // clazy:exclude=rule-of-three
{
public:

@@ -213,6 +213,12 @@ class QgsConnectionPoolGroup
QMutex connMutex;
QSemaphore sem;
QTimer* expirationTimer;

private:

QgsConnectionPoolGroup( const QgsConnectionPoolGroup& other );
QgsConnectionPoolGroup& operator=( const QgsConnectionPoolGroup& other );

};


@@ -131,6 +131,9 @@ class CORE_EXPORT QgsGmlStreamingParser

private:

QgsGmlStreamingParser( const QgsGmlStreamingParser& other );
QgsGmlStreamingParser& operator=( const QgsGmlStreamingParser& other );

enum ParseMode
{
none,
@@ -112,7 +112,7 @@ class CORE_EXPORT QgsLogger

/** \ingroup core
*/
class QgsScopeLogger
class QgsScopeLogger // clazy:exclude=rule-of-three
{
public:
QgsScopeLogger( const char* file, const char* func, int line )
@@ -134,6 +134,9 @@ class ProjectorData
int srcCols() const { return mSrcCols; }

private:
ProjectorData( const ProjectorData& other );
ProjectorData& operator=( const ProjectorData& other );

/** \brief get destination point for _current_ destination position */
void destPointOnCPMatrix( int theRow, int theCol, double *theX, double *theY );

@@ -90,6 +90,12 @@ struct EFFECTIVE_AREAS
QgsPointSequence inpts;
areanode *initial_arealist;
double *res_arealist;

private:

EFFECTIVE_AREAS( const EFFECTIVE_AREAS& other );
EFFECTIVE_AREAS& operator=( const EFFECTIVE_AREAS& other );

};

void ptarray_calc_areas( EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, double trshld );
@@ -87,6 +87,11 @@ class GUI_EXPORT QgsLayerTreeEmbeddedWidgetRegistry

//! storage of all the providers
QMap<QString, QgsLayerTreeEmbeddedWidgetProvider*> mProviders;

private:

QgsLayerTreeEmbeddedWidgetRegistry( const QgsLayerTreeEmbeddedWidgetRegistry& other );
QgsLayerTreeEmbeddedWidgetRegistry& operator=( const QgsLayerTreeEmbeddedWidgetRegistry& other );
};


@@ -27,7 +27,7 @@ class QgsMapCanvas;
*
* \note added in QGIS 3.0
*/
class GUI_EXPORT QgsSymbolWidgetContext
class GUI_EXPORT QgsSymbolWidgetContext // clazy:exclude=rule-of-three
{
public:

@@ -83,6 +83,11 @@ class QgsCPLErrorHandler
{
CPLPopErrorHandler();
}
private:
QgsCPLErrorHandler( const QgsCPLErrorHandler& other );
QgsCPLErrorHandler& operator=( const QgsCPLErrorHandler& other );
};
@@ -1974,7 +1979,7 @@ static QString createFileFilter_( QString const &longName, QString const &glob )
} // createFileFilter_


QString createFilters( QString type )
QString createFilters( const QString& type )
{
/** Database drivers available*/
static QString myDatabaseDrivers;
@@ -2904,7 +2909,7 @@ QVariant QgsOgrProvider::maximumValue( int index ) const
return value;
}

QByteArray QgsOgrProvider::quotedIdentifier( QByteArray field ) const
QByteArray QgsOgrProvider::quotedIdentifier( const QByteArray& field ) const
{
return QgsOgrProviderUtils::quotedIdentifier( field, ogrDriverName );
}
@@ -244,6 +244,8 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider

private:
char *errMsg;

SLException& operator=( const SLException& other );
};

/**
@@ -163,6 +163,10 @@ struct VTable
QgsFields fields() const { return mFields; }

private:

VTable( const VTable& other );
VTable& operator=( const VTable& other );

// connection
sqlite3* mSql;

0 comments on commit 3272964

Please sign in to comment.
You can’t perform that action at this time.