QGIS API Documentation  master-59fd5e0
src/core/qgsvectorlayerjoinbuffer.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                           qgsvectorlayerjoinbuffer.h
00003                           ---------------------------
00004     begin                : Feb 09, 2011
00005     copyright            : (C) 2011 by Marco Hugentobler
00006     email                : marco dot hugentobler at sourcepole dot ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef QGSVECTORLAYERJOINBUFFER_H
00019 #define QGSVECTORLAYERJOINBUFFER_H
00020 
00021 #include "qgsfeature.h"
00022 #include "qgsvectorlayer.h"
00023 
00024 #include <QHash>
00025 #include <QString>
00026 
00027 
00028 
00029 
00031 class CORE_EXPORT QgsVectorLayerJoinBuffer
00032 {
00033   public:
00034     QgsVectorLayerJoinBuffer();
00035     ~QgsVectorLayerJoinBuffer();
00036 
00039     void addJoin( const QgsVectorJoinInfo& joinInfo );
00040 
00042     void removeJoin( const QString& joinLayerId );
00043 
00047     void updateFields( QgsFields& fields );
00048 
00050     void createJoinCaches();
00051 
00053     void writeXml( QDomNode& layer_node, QDomDocument& document ) const;
00054 
00056     void readXml( const QDomNode& layer_node );
00057 
00059     bool containsJoins() const { return !mVectorJoins.isEmpty(); }
00060 
00061     const QList< QgsVectorJoinInfo >& vectorJoins() const { return mVectorJoins; }
00062 
00067     const QgsVectorJoinInfo* joinForFieldIndex( int index, const QgsFields& fields, int& sourceFieldIndex ) const;
00068 
00069   private:
00070 
00072     QList< QgsVectorJoinInfo > mVectorJoins;
00073 
00075     void cacheJoinLayer( QgsVectorJoinInfo& joinInfo );
00076 };
00077 
00078 #endif // QGSVECTORLAYERJOINBUFFER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines