Quantum GIS API Documentation  master-ce49b66
src/core/qgsfeatureiterator.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsfeatureiterator.cpp
00003     ---------------------
00004     begin                : Juli 2012
00005     copyright            : (C) 2012 by Martin Dobias
00006     email                : wonder dot sk at gmail dot com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #include "qgsfeatureiterator.h"
00016 
00017 
00018 QgsAbstractFeatureIterator::QgsAbstractFeatureIterator( const QgsFeatureRequest& request )
00019     : mRequest( request ),
00020     mClosed( false ),
00021     refs( 0 )
00022 {
00023 }
00024 
00025 QgsAbstractFeatureIterator::~QgsAbstractFeatureIterator()
00026 {
00027 }
00028 
00029 void QgsAbstractFeatureIterator::ref()
00030 {
00031   refs++;
00032 }
00033 void QgsAbstractFeatureIterator::deref()
00034 {
00035   refs--;
00036   if ( !refs )
00037     delete this;
00038 }
00039 
00041 
00042 QgsFeatureIterator& QgsFeatureIterator::operator=( const QgsFeatureIterator & other )
00043 {
00044   if ( this != &other )
00045   {
00046     if ( mIter )
00047       mIter->deref();
00048     mIter = other.mIter;
00049     if ( mIter )
00050       mIter->ref();
00051   }
00052   return *this;
00053 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines