QGIS API Documentation  master-6227475
QgsVectorLayerJoinBuffer Class Reference

Manages joined fields for a vector layer. More...

#include <qgsvectorlayerjoinbuffer.h>

List of all members.

Public Member Functions

 QgsVectorLayerJoinBuffer ()
 ~QgsVectorLayerJoinBuffer ()
void addJoin (const QgsVectorJoinInfo &joinInfo)
 Joins another vector layer to this layer.
bool containsJoins () const
 Quick way to test if there is any join at all.
void createJoinCaches ()
 Calls cacheJoinLayer() for all vector joins.
const QgsVectorJoinInfojoinForFieldIndex (int index, const QgsFields &fields, int &sourceFieldIndex) const
 Finds the vector join for a layer field index.
void readXml (const QDomNode &layer_node)
 Reads joins from project file.
void removeJoin (const QString &joinLayerId)
 Removes a vector layer join.
void updateFields (QgsFields &fields)
 Updates field map with joined attributes.
const QList< QgsVectorJoinInfo > & vectorJoins () const
void writeXml (QDomNode &layer_node, QDomDocument &document) const
 Saves mVectorJoins to xml under the layer node.

Private Member Functions

void cacheJoinLayer (QgsVectorJoinInfo &joinInfo)
 Caches attributes of join layer in memory if QgsVectorJoinInfo.memoryCache is true (and the cache is not already there)

Private Attributes

QList< QgsVectorJoinInfomVectorJoins
 Joined vector layers.

Detailed Description

Manages joined fields for a vector layer.

Definition at line 31 of file qgsvectorlayerjoinbuffer.h.


Constructor & Destructor Documentation


Member Function Documentation

Joins another vector layer to this layer.

Parameters:
joinInfojoin object containing join layer id, target and source field

Definition at line 33 of file qgsvectorlayerjoinbuffer.cpp.

References cacheJoinLayer(), QgsVectorJoinInfo::memoryCache, and mVectorJoins.

Referenced by QgsVectorLayer::addJoin(), and readXml().

Calls cacheJoinLayer() for all vector joins.

Definition at line 115 of file qgsvectorlayerjoinbuffer.cpp.

References cacheJoinLayer(), and mVectorJoins.

Referenced by QgsVectorLayer::createJoinCaches().

const QgsVectorJoinInfo * QgsVectorLayerJoinBuffer::joinForFieldIndex ( int  index,
const QgsFields fields,
int &  sourceFieldIndex 
) const

Finds the vector join for a layer field index.

Parameters:
indexthis layers attribute index
fieldsfields of the vector layer (including joined fields)
sourceFieldIndexOutput: field's index in source layer

Definition at line 174 of file qgsvectorlayerjoinbuffer.cpp.

References QgsFields::fieldOrigin(), QgsFields::fieldOriginIndex(), mVectorJoins, and QgsFields::OriginJoin.

Referenced by QgsVectorLayer::maximumValue(), QgsVectorLayer::minimumValue(), QgsVectorLayerFeatureIterator::prepareJoins(), and QgsVectorLayer::uniqueValues().

void QgsVectorLayerJoinBuffer::removeJoin ( const QString &  joinLayerId)

Removes a vector layer join.

Definition at line 44 of file qgsvectorlayerjoinbuffer.cpp.

References mVectorJoins.

Referenced by QgsVectorLayer::removeJoin().

const QList< QgsVectorJoinInfo >& QgsVectorLayerJoinBuffer::vectorJoins ( ) const [inline]

Definition at line 61 of file qgsvectorlayerjoinbuffer.h.

Referenced by QgsVectorLayer::vectorJoins().

void QgsVectorLayerJoinBuffer::writeXml ( QDomNode &  layer_node,
QDomDocument &  document 
) const

Saves mVectorJoins to xml under the layer node.

Definition at line 125 of file qgsvectorlayerjoinbuffer.cpp.

References mVectorJoins.

Referenced by QgsVectorLayer::writeXml().


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines