![]() |
![]() |
![]() |
GNOME Data Access manual | ![]() |
---|---|---|---|---|
Top | Description |
GdaDataModelHashGdaDataModelHash — An implementation of GdaDataModel based on a hash table |
GdaDataModelHashPrivate; GdaDataModel * gda_data_model_hash_new (gint cols); const GdaValue * gda_data_model_hash_get_value_at (GdaDataModel *model, gint col, gint row); void gda_data_model_hash_clear (GdaDataModelHash *model); void gda_data_model_hash_set_n_columns (GdaDataModelHash *model, gint cols); void gda_data_model_hash_insert_row (GdaDataModelHash *model, gint rownum, GdaRow *row); const GdaRow * gda_data_model_hash_get_row (GdaDataModel *model, gint row);
Unlike GdaDataModelArray, this data model implementation stores the GdaRow in a hash table. So it only retrieves from the database backend exactly the requested rows (while in GdaDataModelArray you have to retrieve all the rows until the one requested).
GdaDataModel * gda_data_model_hash_new (gint cols);
|
number of columns for rows in this data model. |
Returns : |
a pointer to the newly created GdaDataModel. |
const GdaValue * gda_data_model_hash_get_value_at (GdaDataModel *model, gint col, gint row);
Retrieves the value at a specified column and row.
|
the GdaDataModelHash to retrieve the value from. |
|
column number (starting from 0). |
|
row number (starting from 0). |
Returns : |
a pointer to a GdaValue. |
void gda_data_model_hash_clear (GdaDataModelHash *model);
Frees all the rows inserted in model
.
|
the model to clear. |
void gda_data_model_hash_set_n_columns (GdaDataModelHash *model, gint cols);
Sets the number of columns for rows inserted in this model.
cols
must be greater than or equal to 0.
This function calls gda_data_model_hash_clear to free the existing rows if any.
|
the GdaDataModelHash. |
|
the number of columns for rows inserted in model .
|
void gda_data_model_hash_insert_row (GdaDataModelHash *model, gint rownum, GdaRow *row);
Inserts a row
in the model
.
|
the GdaDataModelHash which is gonna hold the row. |
|
the number of the row. |
|
the row to insert. The model is responsible of freeing it! |
const GdaRow * gda_data_model_hash_get_row (GdaDataModel *model, gint row);
Retrieves a row from the underlying hash table.
|
the GdaDataModelHash |
|
row number |
Returns : |
a GdaRow or NULL if the requested row is not in the hash table. |