QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 : radim.blazek@gmail.com
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 QgsFeatureStore &rhs );
38 
40  QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceSystem& crs );
41 
43  ~QgsFeatureStore();
44 
46  QgsFields& fields() { return mFields; }
47 
49  void setFields( const QgsFields & fields );
50 
52  QgsCoordinateReferenceSystem crs() const { return mCrs; }
53 
55  void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCrs = crs; }
56 
61  void addFeature( const QgsFeature& feature );
62 
64  QgsFeatureList& features() { return mFeatures; }
65 
67  void setParams( const QMap<QString, QVariant> &theParams ) { mParams = theParams; }
68 
70  QMap<QString, QVariant> params() const { return mParams; }
71 
72  private:
74 
76 
78 
79  // Optional parameters
80  QMap<QString, QVariant> mParams;
81 };
82 
83 typedef QList<QgsFeatureStore> QgsFeatureStoreList;
84 
86 
88 
89 #endif
Container for features with the same fields and crs.
QgsCoordinateReferenceSystem crs() const
Get crs.
QgsFeatureList mFeatures
QMap< QString, QVariant > mParams
QList< QgsFeatureStore > QgsFeatureStoreList
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:330
Container of fields for a vector layer.
Definition: qgsfield.h:161
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
void setParams(const QMap< QString, QVariant > &theParams)
Set map of optional parameters.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Set crs.
Q_DECLARE_METATYPE(QgsFeatureStore)
Class for storing a coordinate reference system (CRS)
QgsCoordinateReferenceSystem mCrs
QgsFields & fields()
Get fields list.
QMap< QString, QVariant > params() const
Get map of optional parameters.
QgsFeatureList & features()
Get features list reference.