Skip to content
Permalink
Browse files
Correct use of private vs protected in provider/sources
  • Loading branch information
nyalldawson committed Apr 23, 2017
1 parent c85a437 commit b819bc27fe378f7184371e02e84b8824bf770a02
@@ -34,7 +34,7 @@ class QgsDb2FeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QgsFields mFields;
QString mFidColName;
long mSRId;
@@ -30,7 +30,7 @@ class QgsDelimitedTextFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QgsDelimitedTextProvider::GeomRepresentationType mGeomRep;
QgsExpression *mSubsetExpression = nullptr;
QgsExpressionContext mExpressionContext;
@@ -78,6 +78,8 @@ class QgsDelimitedTextFeatureIterator : public QgsAbstractFeatureIteratorFromSou
protected:
virtual bool fetchFeature( QgsFeature &feature ) override;

private:

bool setNextFeatureId( qint64 fid );

bool nextFeatureInternal( QgsFeature &feature );
@@ -31,7 +31,7 @@ class QgsGPXFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QString mFileName;
QgsGPXProvider::DataType mFeatureType;
QgsGPSData *data = nullptr;
@@ -56,6 +56,8 @@ class QgsGPXFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsGPX

virtual bool fetchFeature( QgsFeature &feature ) override;

private:

bool readFid( QgsFeature &feature );

bool readWaypoint( const QgsWaypoint &wpt, QgsFeature &feature );
@@ -70,8 +72,6 @@ class QgsGPXFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsGPX
void readAttributes( QgsFeature &feature, const QgsRoute &rte );
void readAttributes( QgsFeature &feature, const QgsTrack &trk );

protected:

//! Current waypoint iterator
QgsGPSData::WaypointIterator mWptIter;
//! Current route iterator
@@ -32,7 +32,7 @@ class GRASS_LIB_EXPORT QgsGrassFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
#if 0
enum Selection
{
@@ -79,19 +79,24 @@ class GRASS_LIB_EXPORT QgsGrassFeatureIterator : public QObject, public QgsAbstr
virtual bool rewind() override;
virtual bool close() override;

// create QgsFeatureId from GRASS geometry object id, cat and layer number (editing)
static QgsFeatureId makeFeatureId( int grassId, int cat, int layer = 0 );

// Get layer number from QGIS fid
static int layerFromFid( QgsFeatureId fid );

// Get GRASS line id from QGIS fid
/**
* Get GRASS line id from a QGIS \a fid.
*/
static int lidFromFid( QgsFeatureId fid );

// Get GRASS cat from QGIS fid
/**
* Get GRASS cat from QGIS \a fid.
*/
static int catFromFid( QgsFeatureId fid );

// get attribute value to be used in different layer when it is edited
/**
* Get layer number from QGIS \a fid.
*/
static int layerFromFid( QgsFeatureId fid );

/**
* Get attribute value to be used in different layer when it is edited.
*/
static QVariant nonEditableValue( int layerNumber );

public slots:
@@ -102,7 +107,11 @@ class GRASS_LIB_EXPORT QgsGrassFeatureIterator : public QObject, public QgsAbstr

void doClose();

protected:
private:

// create QgsFeatureId from GRASS geometry object id, cat and layer number (editing)
static QgsFeatureId makeFeatureId( int grassId, int cat, int layer = 0 );

//void lock();
//void unlock();

@@ -35,7 +35,7 @@ class QgsMemoryFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QgsFields mFields;
QgsFeatureMap mFeatures;
QgsSpatialIndex *mSpatialIndex = nullptr;
@@ -60,6 +60,7 @@ class QgsMemoryFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Qgs

virtual bool fetchFeature( QgsFeature &feature ) override;

private:
bool nextFeatureUsingList( QgsFeature &feature );
bool nextFeatureTraverseAll( QgsFeature &feature );

@@ -34,7 +34,7 @@ class QgsMssqlFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QgsFields mFields;
QString mFidColName;
long mSRId;
@@ -79,11 +79,14 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsM
virtual bool close() override;

protected:
void BuildStatement( const QgsFeatureRequest &request );

virtual bool fetchFeature( QgsFeature &feature ) override;
bool nextFeatureFilterExpression( QgsFeature &f ) override;

private:
void BuildStatement( const QgsFeatureRequest &request );


private:

virtual bool prepareOrderBy( const QList<QgsFeatureRequest::OrderByClause> &orderBys ) override;
@@ -32,7 +32,7 @@ class QgsOgrFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QString mDataSource;
QString mLayerName;
int mLayerIndex;
@@ -62,6 +62,8 @@ class QgsOgrFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsOgr
virtual bool fetchFeature( QgsFeature &feature ) override;
bool nextFeatureFilterExpression( QgsFeature &f ) override;

private:

bool readFeature( OGRFeatureH fet, QgsFeature &feature ) const;

//! Get an attribute associated with a feature
@@ -77,7 +79,6 @@ class QgsOgrFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsOgr
//! Set to true, if geometry is in the requested columns
bool mFetchGeometry;

private:
bool mExpressionCompiled;
QgsFeatureIds mFilterFids;
QgsFeatureIds::const_iterator mFilterFidsIt;
@@ -34,7 +34,7 @@ class QgsPostgresFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:

QString mConnInfo;

@@ -83,6 +83,8 @@ class QgsPostgresFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Q
bool nextFeatureFilterExpression( QgsFeature &f ) override;
virtual bool prepareSimplification( const QgsSimplifyMethod &simplifyMethod ) override;

private:

QgsPostgresConn *mConn = nullptr;


@@ -110,7 +112,6 @@ class QgsPostgresFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Q

bool mIsTransactionConnection;

private:
virtual bool providerCanSimplify( QgsSimplifyMethod::MethodType methodType ) const override;

virtual bool prepareOrderBy( const QList<QgsFeatureRequest::OrderByClause> &orderBys ) override;
@@ -34,7 +34,7 @@ class QgsSpatiaLiteFeatureSource : public QgsAbstractFeatureSource

virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:
QString mGeometryColumn;
QString mSubsetString;
QgsFields mFields;
@@ -67,6 +67,8 @@ class QgsSpatiaLiteFeatureIterator : public QgsAbstractFeatureIteratorFromSource
virtual bool fetchFeature( QgsFeature &feature ) override;
bool nextFeatureFilterExpression( QgsFeature &f ) override;

private:

QString whereClauseRect();
QString whereClauseFid();
QString whereClauseFids();
@@ -95,7 +97,6 @@ class QgsSpatiaLiteFeatureIterator : public QgsAbstractFeatureIteratorFromSource
bool mHasPrimaryKey;
QgsFeatureId mRowNumber;

private:
bool prepareOrderBy( const QList<QgsFeatureRequest::OrderByClause> &orderBys ) override;

bool mOrderByCompiled;
@@ -63,6 +63,8 @@ class QgsVirtualLayerFeatureIterator : public QgsAbstractFeatureIteratorFromSour

virtual bool fetchFeature( QgsFeature &feature ) override;

private:

std::unique_ptr<Sqlite::Query> mQuery;

QgsAttributeList mAttributes;
@@ -255,7 +255,7 @@ class QgsWFSFeatureSource : public QgsAbstractFeatureSource

QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;

protected:
private:

std::shared_ptr<QgsWFSSharedData> mShared; //!< Mutable data shared between provider and feature sources

0 comments on commit b819bc2

Please sign in to comment.