Skip to content

Commit 51122d2

Browse files
committedOct 20, 2012
Store attributes and fields in vectors instead of maps
1 parent 8bf9590 commit 51122d2

File tree

134 files changed

+805
-1134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+805
-1134
lines changed
 

‎python/core/qgsexpression.sip

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class QgsExpression
1414
QString parserErrorString() const;
1515

1616
//! Get the expression ready for evaluation - find out column indexes.
17-
bool prepare( const QMap<int, QgsField> &fields );
17+
bool prepare( const QgsFields &fields );
1818

1919
//! Get list of columns referenced by the expression
2020
QStringList referencedColumns();
@@ -29,7 +29,7 @@ class QgsExpression
2929

3030
//! Evaluate the feature and return the result
3131
//! @note this method does not expect that prepare() has been called on this instance
32-
QVariant evaluate( QgsFeature* f, const QMap<int, QgsField>& fields );
32+
QVariant evaluate( QgsFeature* f, const QgsFields& fields );
3333

3434
//! Returns true if an error occurred when evaluating last input
3535
bool hasEvalError() const;
@@ -169,7 +169,7 @@ class QgsExpression
169169

170170
// abstract virtual preparation function
171171
// errors are reported to the parent
172-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields ) = 0;
172+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields ) = 0;
173173

174174
virtual QString dump() const = 0;
175175

@@ -224,7 +224,7 @@ class QgsExpression
224224
QgsExpression::UnaryOperator op();
225225
QgsExpression::Node* operand();
226226

227-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
227+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
228228
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
229229
virtual QString dump() const;
230230

@@ -246,7 +246,7 @@ class QgsExpression
246246
QgsExpression::Node* opLeft();
247247
QgsExpression::Node* opRight();
248248

249-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
249+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
250250
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
251251
virtual QString dump() const;
252252

@@ -268,7 +268,7 @@ class QgsExpression
268268
bool isNotIn();
269269
QgsExpression::NodeList* list();
270270

271-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
271+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
272272
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
273273
virtual QString dump() const;
274274

@@ -289,7 +289,7 @@ class QgsExpression
289289
int fnIndex();
290290
QgsExpression::NodeList* args();
291291

292-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
292+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
293293
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
294294
virtual QString dump() const;
295295

@@ -308,7 +308,7 @@ class QgsExpression
308308

309309
QVariant value();
310310

311-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
311+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
312312
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
313313
virtual QString dump() const;
314314

@@ -327,7 +327,7 @@ class QgsExpression
327327

328328
QString name();
329329

330-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
330+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
331331
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
332332
virtual QString dump() const;
333333

@@ -358,7 +358,7 @@ class QgsExpression
358358
~NodeCondition();
359359

360360
virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
361-
virtual bool prepare( QgsExpression* parent, const QMap<int, QgsField> &fields );
361+
virtual bool prepare( QgsExpression* parent, const QgsFields &fields );
362362
virtual QString dump() const;
363363

364364
virtual void toOgcFilter( QDomDocument &doc, QDomElement &element ) const;

‎python/core/qgsfeature.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ typedef QMap<int, QString> QgsFieldNameMap;
1717
typedef QList<QgsFeature> QgsFeatureList;
1818

1919
typedef QMap<int, QgsField> QgsFieldMap;
20-
20+
typedef QVector<QgsField> QgsFields;
2121

2222
class QgsFeature
2323
{
@@ -159,12 +159,12 @@ class QgsFeature
159159
/** Assign a field map with the feature to allow attribute access by attribute name
160160
* @note added in 2.0
161161
*/
162-
void setFieldMap( const QgsFieldMap* fields );
162+
void setFields( const QgsFields* fields );
163163

164164
/** Get associated field map. may be NULL
165165
* @note added in 2.0
166166
*/
167-
const QgsFieldMap* fieldMap() const;
167+
const QgsFields* fields() const;
168168

169169
/** Insert a value into attribute. Returns false if attribute name could not be converted to index.
170170
* Field map must be associated to make this work.

0 commit comments

Comments
 (0)
Please sign in to comment.