Skip to content
Permalink
Browse files
Changed begin() to rewind() on provider interface
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9582 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 8, 2008
1 parent 6793f7c commit c3103ffeca3deb8f91c424d77749e92b36d3c70e
@@ -112,7 +112,7 @@ class QgsVectorDataProvider : QgsDataProvider
virtual QString dataComment() const;

/** Restart reading features from previous select operation */
virtual void begin() = 0;
virtual void rewind() = 0;

/**
* Returns the minimum value of an attributs
@@ -155,7 +155,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
virtual QString dataComment() const;

/** Restart reading features from previous select operation */
virtual void begin() = 0;
virtual void rewind() = 0;

/**
* Returns the minimum value of an attribute
@@ -434,7 +434,7 @@ void QgsDelimitedTextProvider::select( QgsAttributeList fetchAttributes,
{
mSelectionRectangle = rect;
}
begin();
rewind();
}


@@ -476,7 +476,7 @@ const QgsFieldMap & QgsDelimitedTextProvider::fields() const
return attributeFields;
}

void QgsDelimitedTextProvider::begin()
void QgsDelimitedTextProvider::rewind()
{
// Reset feature id to 0
mFid = 0;
@@ -103,7 +103,7 @@ class QgsDelimitedTextProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void begin();
virtual void rewind();

/** Returns a bitmask containing the supported capabilities
Note, some capabilities may change depending on whether
@@ -425,7 +425,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes,
mAttributesToFetch = fetchAttributes;
mFetchGeom = fetchGeometry;

begin();
rewind();
}


@@ -482,7 +482,7 @@ const QgsFieldMap& QgsGPXProvider::fields() const
}


void QgsGPXProvider::begin()
void QgsGPXProvider::rewind()
{
if ( mFeatureType == WaypointType )
mWptIter = data->waypointsBegin();
@@ -93,7 +93,7 @@ class QgsGPXProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void begin();
virtual void rewind();

/**
* Adds a list of features
@@ -557,7 +557,7 @@ int QgsGrassProvider::keyField()
return mLayers[mLayerId].keyColumn;
}

void QgsGrassProvider::begin()
void QgsGrassProvider::rewind()
{
if ( isEdited() || isFrozen() || !mValid )
return;
@@ -175,7 +175,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
int keyField();

/** Restart reading features from previous select operation */
void begin();
void rewind();

/** Returns the minimum value of an attributs
* @param index the index of the attribute */
@@ -1,5 +1,5 @@

SET (MEMORY_SRCS memoryprovider.cpp)
SET (MEMORY_SRCS qgsmemoryprovider.cpp)

INCLUDE_DIRECTORIES(
.
@@ -13,7 +13,7 @@
* *
***************************************************************************/

#include "memoryprovider.h"
#include "qgsmemoryprovider.h"

#include "qgsfeature.h"
#include "qgsfield.h"
@@ -175,10 +175,10 @@ void QgsMemoryProvider::select( QgsAttributeList fetchAttributes,
mSelectSI_Features.clear();
}

begin();
rewind();
}

void QgsMemoryProvider::begin()
void QgsMemoryProvider::rewind()
{
if ( mSelectUsingSpatialIndex )
mSelectSI_Iterator = mSelectSI_Features.begin();
@@ -93,7 +93,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void begin();
virtual void rewind();


/**
@@ -458,7 +458,7 @@ const QgsFieldMap & QgsOgrProvider::fields() const
return mAttributeFields;
}

void QgsOgrProvider::begin()
void QgsOgrProvider::rewind()
{
OGR_L_ResetReading( ogrLayer );
}
@@ -120,7 +120,7 @@ class QgsOgrProvider : public QgsVectorDataProvider
virtual QgsRect extent();

/** Restart reading features from previous select operation */
virtual void begin();
virtual void rewind();

/**Writes a list of features to the file*/
virtual bool addFeatures( QgsFeatureList & flist );
@@ -720,7 +720,7 @@ QString QgsPostgresProvider::dataComment() const
return mDataComment;
}

void QgsPostgresProvider::begin()
void QgsPostgresProvider::rewind()
{
if ( mFetching )
{
@@ -1876,7 +1876,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
returnvalue = false;
}

begin();
rewind();
return returnvalue;
}

@@ -1914,7 +1914,7 @@ bool QgsPostgresProvider::deleteFeatures( const QgsFeatureIds & id )
connectionRW->PQexecNR( "ROLLBACK" );
returnvalue = false;
}
begin();
rewind();
return returnvalue;
}

@@ -1953,7 +1953,7 @@ bool QgsPostgresProvider::addAttributes( const QgsNewAttributesMap & name )
returnvalue = false;
}

begin();
rewind();
return returnvalue;
}

@@ -1998,7 +1998,7 @@ bool QgsPostgresProvider::deleteAttributes( const QgsAttributeIds& ids )
returnvalue = false;
}

begin();
rewind();
return returnvalue;
}

@@ -2068,7 +2068,7 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap &
returnvalue = false;
}

begin();
rewind();

return returnvalue;
}
@@ -2148,7 +2148,7 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map )
returnvalue = false;
}

begin();
rewind();

QgsDebugMsg( "exiting." );

@@ -176,7 +176,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
* pointer, setting it to 0 and reloading the field list
*/
void begin();
void rewind();

/** Returns the minimum value of an attribute
* @param index the index of the attribute */
@@ -128,7 +128,7 @@ const QgsFieldMap & QgsWFSProvider::fields() const
return mFields;
}

void QgsWFSProvider::begin()
void QgsWFSProvider::rewind()
{
mFeatureIterator = mSelectedFeatures.begin();
}
@@ -69,7 +69,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
long featureCount() const;
uint fieldCount() const;
const QgsFieldMap & fields() const;
void begin();
void rewind();

virtual QgsCoordinateReferenceSystem crs();

@@ -114,7 +114,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
QgsSpatialIndex *mSpatialIndex;
/**Vector where the ids of the selected features are inserted*/
QList<int> mSelectedFeatures;
/**Iterator on the feature vector for use in begin(), nextFeature(), etc...*/
/**Iterator on the feature vector for use in rewind(), nextFeature(), etc...*/
QList<int>::iterator mFeatureIterator;
/**Vector where the features are inserted*/
QList<QgsFeature*> mFeatures;

0 comments on commit c3103ff

Please sign in to comment.