QGIS API Documentation
qgsfeaturestore.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfeaturestore.h
3  --------------------------------------
4  Date : February 2013
5  Copyright : (C) 2013 by Radim Blazek
6  Email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSFEATURESTORE_H
16 #define QGSFEATURESTORE_H
17 
18 #include "qgis.h"
19 #include "qgsfeature.h"
20 #include "qgsfield.h"
21 #include "qgslogger.h"
23 #include <QList>
24 #include <QMetaType>
25 #include <QVariant>
26 
30 class CORE_EXPORT QgsFeatureStore
31 {
32  public:
35 
37  QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceSystem& crs );
38 
40  QgsFields& fields() { return mFields; }
41 
43  void setFields( const QgsFields & fields );
44 
46  QgsCoordinateReferenceSystem crs() const { return mCrs; }
47 
49  void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCrs = crs; }
50 
55  void addFeature( const QgsFeature& feature );
56 
58  QgsFeatureList& features() { return mFeatures; }
59 
61  void setParams( const QMap<QString, QVariant> &theParams ) { mParams = theParams; }
62 
64  QMap<QString, QVariant> params() const { return mParams; }
65 
66  private:
67  QgsFields mFields;
68 
70 
71  QgsFeatureList mFeatures;
72 
73  // Optional parameters
75 };
76 
78 
79 Q_DECLARE_METATYPE( QgsFeatureStore )
80 
81 Q_DECLARE_METATYPE( QgsFeatureStoreList )
82 
83 #endif
Container for features with the same fields and crs.
QgsCoordinateReferenceSystem crs() const
Get crs.
QList< QgsFeatureStore > QgsFeatureStoreList
Container of fields for a vector layer.
Definition: qgsfield.h:187
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
void setParams(const QMap< QString, QVariant > &theParams)
Set map of optional parameters.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Set crs.
Class for storing a coordinate reference system (CRS)
QgsFields & fields()
Get fields list.
QMap< QString, QVariant > params() const
Get map of optional parameters.
QgsFeatureList & features()
Get features list reference.