QGIS API Documentation  2.99.0-Master (40f86b2)
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_core.h"
19 #include "qgis.h"
20 #include "qgsfeature.h"
21 #include "qgsfields.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> &params ) { mParams = params; }
62 
64  QMap<QString, QVariant> params() const { return mParams; }
65 
66  private:
67  QgsFields mFields;
68 
70 
71  QgsFeatureList mFeatures;
72 
73  // Optional parameters
74  QMap<QString, QVariant> mParams;
75 };
76 
77 typedef QList<QgsFeatureStore> QgsFeatureStoreList;
78 
80 
82 
83 #endif
Container for features with the same fields and crs.
void setParams(const QMap< QString, QVariant > &params)
Set map of optional parameters.
QList< QgsFeatureStore > QgsFeatureStoreList
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:363
Q_DECLARE_METATYPE(QgsMimeDataUtils::UriList)
Container of fields for a vector layer.
Definition: qgsfields.h:39
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:136
void setCrs(const QgsCoordinateReferenceSystem &crs)
Set crs.
This class represents a coordinate reference system (CRS).
QMap< QString, QVariant > params() const
Get map of optional parameters.
QgsFields & fields()
Get fields list.
QgsCoordinateReferenceSystem crs() const
Get crs.
QgsFeatureList & features()
Get features list reference.