QGIS API Documentation  2.99.0-Master (8ec3eaf)
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 "qgsfields.h"
22 #include <QList>
23 #include <QMetaType>
24 #include <QVariant>
25 
29 class CORE_EXPORT QgsFeatureStore
30 {
31  public:
34 
36  QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceSystem& crs );
37 
39  QgsFields& fields() { return mFields; }
40 
42  void setFields( const QgsFields & fields );
43 
45  QgsCoordinateReferenceSystem crs() const { return mCrs; }
46 
48  void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCrs = crs; }
49 
54  void addFeature( const QgsFeature& feature );
55 
57  QgsFeatureList& features() { return mFeatures; }
58 
60  void setParams( const QMap<QString, QVariant> &theParams ) { mParams = theParams; }
61 
63  QMap<QString, QVariant> params() const { return mParams; }
64 
65  private:
66  QgsFields mFields;
67 
69 
70  QgsFeatureList mFeatures;
71 
72  // Optional parameters
73  QMap<QString, QVariant> mParams;
74 };
75 
76 typedef QList<QgsFeatureStore> QgsFeatureStoreList;
77 
79 
81 
82 #endif
Container for features with the same fields and crs.
QList< QgsFeatureStore > QgsFeatureStoreList
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:360
Q_DECLARE_METATYPE(QgsMimeDataUtils::UriList)
Container of fields for a vector layer.
Definition: qgsfields.h:36
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:135
void setParams(const QMap< QString, QVariant > &theParams)
Set map of optional parameters.
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.