create_iter


Description:

public DataModelIter create_iter ()

Creates a new iterator object DataModelIter object which can be used to iterate through rows in this.

The new DataModelIter does not hold any reference to this (ie. if this is destroyed at some point, the new iterator will become useless but in any case it will not prevent the data model from being destroyed).

Depending on the data model's implementation, a new DataModelIter object may be created, or a reference to an already existing DataModelIter may be returned. For example if this only supports being accessed using a forward moving cursor (say a the result of a SELECT executed by SQLite with a cursor access mode specified), then this method will always return the same iterator.

If a new DataModelIter is created, then the row it represents is undefined.

For models which can be accessed randomly, any row can be set using move_to_row, and for models which are accessible sequentially only then use move_next (and move_prev if supported).

Note: for the DataProxy data model (which proxies any DataModel for modifications and has twice the number of columns of the proxied data model), this method will create an iterator in which only the columns of the proxied data model appear. If you need to have a DataModelIter in which all the proxy's columns appear, create it using: < programlisting><![CDATA[iter = g_object_new (GDA_TYPE_DATA_MODEL_ITER, "data-model", proxy, NULL);]]></programlisting>

Parameters:

this

a DataModel object.

Returns:

a DataModelIter object, or null if an error occurred