QGIS/python/core/qgscachedfeatureiterator.sip

109 lines
3.1 KiB
Plaintext
Raw Normal View History

class QgsCachedFeatureIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* This constructor creates a feature iterator, that delivers only cached information, based on the
* @link QgsFeatureIds @endlink. No request is made to the backend.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
* @param featureIds The feature ids to return
2014-01-26 18:35:21 +01:00
*
* @deprecated Use QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest )
* instead
*/
QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest, QgsFeatureIds featureIds );
/**
2014-01-26 18:35:21 +01:00
* This constructor creates a feature iterator, that delivers all cached features. No request is made to the backend.
*
2014-01-26 18:35:21 +01:00
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
*/
2014-01-26 18:35:21 +01:00
QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest );
/**
2014-01-26 18:35:21 +01:00
* Rewind to the beginning of the iterator
*
2014-01-26 18:35:21 +01:00
* @return bool true if the operation was ok
*/
virtual bool rewind();
/**
2014-01-26 18:35:21 +01:00
* Close this iterator. No further features will be available.
*
2014-01-26 18:35:21 +01:00
* @return true if successful
*/
virtual bool close();
2014-05-27 23:22:50 +02:00
// QgsAbstractFeatureIterator interface
protected:
/**
* Implementation for fetching a feature.
*
* @param f Will write to this feature
* @return bool true if the operation was ok
*
* @see bool getFeature( QgsFeature& f )
*/
virtual bool fetchFeature( QgsFeature& f );
/**
* We have a local special iterator for FilterFids, no need to run the generic.
*
* @param f Will write to this feature
* @return bool true if the operation was ok
*/
virtual bool nextFeatureFilterFids( QgsFeature& f );
};
2014-05-27 23:22:50 +02:00
/**
* @brief
* Uses another iterator as backend and writes features to the cache
*
*/
class QgsCachedFeatureWriterIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* This constructor creates a feature iterator, which queries the backend and caches retrieved features.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
*/
QgsCachedFeatureWriterIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest );
/**
2014-05-27 23:22:50 +02:00
* Rewind to the beginning of the iterator
*
2014-05-27 23:22:50 +02:00
* @return bool true if the operation was ok
*/
2014-05-27 23:22:50 +02:00
virtual bool rewind();
/**
2014-05-27 23:22:50 +02:00
* Close this iterator. No further features will be available.
*
2014-05-27 23:22:50 +02:00
* @return true if successful
*/
2014-05-27 23:22:50 +02:00
virtual bool close();
protected:
/**
2014-05-27 23:22:50 +02:00
* Implementation for fetching a feature.
*
2014-05-27 23:22:50 +02:00
* @param f Will write to this feature
* @return bool true if the operation was ok
*
* @see bool getFeature( QgsFeature& f )
*/
2014-05-27 23:22:50 +02:00
virtual bool fetchFeature( QgsFeature& f );
};