GdaDataModelHash

Name

GdaDataModelHash -- An implementation of GdaDataModel based on a hash table.

Synopsis



struct      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);

Description

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).

Details

struct GdaDataModelHashPrivate

struct GdaDataModelHashPrivate;


gda_data_model_hash_new ()

GdaDataModel* gda_data_model_hash_new       (gint cols);


gda_data_model_hash_get_value_at ()

const GdaValue* gda_data_model_hash_get_value_at
                                            (GdaDataModel *model,
                                             gint col,
                                             gint row);

Retrieve the value at a specified column and row.


gda_data_model_hash_clear ()

void        gda_data_model_hash_clear       (GdaDataModelHash *model);

Frees all the rows inserted in model.


gda_data_model_hash_set_n_columns ()

void        gda_data_model_hash_set_n_columns
                                            (GdaDataModelHash *model,
                                             gint cols);

Set the nunber 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.


gda_data_model_hash_insert_row ()

void        gda_data_model_hash_insert_row  (GdaDataModelHash *model,
                                             gint rownum,
                                             GdaRow *row);

Inserts a row in the model.