QGIS API Documentation  2.6.0-Brighton
 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 : [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 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:
73  QgsFields mFields;
74 
76 
77  QgsFeatureList mFeatures;
78 
79  // Optional parameters
80  QMap<QString, QVariant> mParams;
81 };
82 
83 typedef QList<QgsFeatureStore> QgsFeatureStoreList;
84 
86 
88 
89 #endif