GdaDataModel rows

## GdaDataModel rows GdaDataModel rows — Row for a GdaDataModel object |

## Synopsis

                GdaRow;
    #define     GDA_TYPE_ROW
    GType       gda_row_get_type                (void);
    GdaRow*     gda_row_new                     (GdaDataModel *model,
                                                 gint count);
    GdaRow*     gda_row_new_from_list           (GdaDataModel *model,
                                                 const GList *values);
    GdaRow*     gda_row_copy                    (GdaRow *row);
    GdaValue*   gda_row_get_value               (GdaRow *row,
                                                 gint num);
    gboolean    gda_row_set_value               (GdaRow *row,
                                                 gint num,
                                                 const GdaValue *value);
    void        gda_row_set_model               (GdaRow *row,
                                                 GdaDataModel *model);
    GdaDataModel* gda_row_get_model             (GdaRow *row);
    gint        gda_row_get_number              (GdaRow *row);
    void        gda_row_set_number              (GdaRow *row,
                                                 gint number);
    const gchar* gda_row_get_id                 (GdaRow *row);
    void        gda_row_set_id                  (GdaRow *row,
                                                 const gchar *id);
    gint        gda_row_get_length              (GdaRow *row);
    void        gda_row_set_is_default          (GdaRow *row,
                                                 gint num,
                                                 gboolean is_default);
    gboolean    gda_row_get_is_default          (GdaRow *row,
                                                 gint num);

## Object Hierarchy

      GObject
       +----GdaRow

## Properties

      "model"                gpointer              : Read / Write
      "nb-values"            gint                  : Write
      "values"               gpointer              : Write

## Signals

    "value-changed"
                void        user_function      (GdaRow *gdarow,
                                                gint arg1,
                                                gpointer arg2,
                                                gpointer arg3,
                                                gpointer user_data);
    "value-to-change"
                gboolean    user_function      (GdaRow *gdarow,
                                                gint arg1,
                                                gpointer arg2,
                                                gpointer arg3,
                                                gpointer user_data);

## Description

Each GdaDataModel uses GdaRow to let the user access each row it contains.

## Details

### GdaRow

    typedef struct _GdaRow GdaRow;

### GDA_TYPE_ROW

    #define GDA_TYPE_ROW            (gda_row_get_type())

### gda_row_get_type ()

    GType       gda_row_get_type                (void);

Returns : |

### gda_row_new ()

    GdaRow*     gda_row_new                     (GdaDataModel *model,
                                                 gint count);

Creates a GdaRow which can hold `count` GdaValue values.

The caller of this function is the only owner of a reference to the newly created GdaRow object, even if `model` is not `NULL` (it is recommended to pass `NULL` as the `model` argument if this function is not called from within a GdaDataModel implementation).

`model` : | the GdaDataModel this row belongs to, or `NULL` if the row is outside any data model
`count` : | number of GdaValue in the new GdaRow.
Returns : | a newly allocated GdaRow object.

### gda_row_new_from_list ()

    GdaRow*     gda_row_new_from_list           (GdaDataModel *model,
                                                 const GList *values);

Creates a GdaRow from a list of GdaValue's. These GdaValue's are value-copied and the user are still responsible for freeing them.

See the `gda_row_new()` function's documentation for more information about the `model` attribute

`model` : | a GdaDataModel this row belongs to, or `NULL` if the row is outside any data model
`values` : | a list of GdaValue's.
Returns : | the newly created row.

### gda_row_copy ()

    GdaRow*     gda_row_copy                    (GdaRow *row);

Copy constructor. Warning: does not copy the GdaDataModel attribute.

`row` : | the GdaRow to copy
Returns : | a new GdaRow

### gda_row_get_value ()

    GdaValue*   gda_row_get_value               (GdaRow *row,
                                                 gint num);

Gets a pointer to a GdaValue stored in a GdaRow.

This is a pointer to the internal array of values. Don't try to free or modify it!

`row` : | a GdaRow
`num` : | field index.
Returns : | a pointer to the GdaValue in the position `num` of `row`.

### gda_row_set_value ()

    gboolean    gda_row_set_value               (GdaRow *row,
                                                 gint num,
                                                 const GdaValue *value);

Sets the value stored at position `num` in `row` to be a copy of `value`.

`row` : | a GdaRow
`num` : | field index.
`value` : | a GdaValue to insert into `row` at the `num` position, or `NULL`
Returns : | TRUE if no error occured.

### gda_row_set_model ()

    void        gda_row_set_model               (GdaRow *row,
                                                 GdaDataModel *model);

Set the GdaDataModel the given GdaRow belongs to. Note that calling this method should be reserved to GdaDataModel implementations and should therefore not be called by the user.

`row` : | a GdaRow.
`model` : | a GdaDataModel this row belongs to, or `NULL` if the row is outside any data model

### gda_row_get_model ()

    GdaDataModel* gda_row_get_model             (GdaRow *row);

Gets the GdaDataModel the given GdaRow belongs to.

`row` : | a GdaRow.
Returns : | a GdaDataModel.

### gda_row_get_number ()

    gint        gda_row_get_number              (GdaRow *row);

Gets the number of the given row, that is, its position in its containing data model.

`row` : | a GdaRow.
Returns : | the row number, or -1 if there was an error.

### gda_row_set_number ()

    void        gda_row_set_number              (GdaRow *row,
                                                 gint number);

Sets the row number for the given row.

`row` : | a GdaRow.
`number` : | the new row number.

### gda_row_get_id ()

    const gchar* gda_row_get_id                 (GdaRow *row);

Returns the unique identifier for this row. This identifier is assigned by the different providers, to uniquely identify rows returned to clients. If there is no ID, this means that the row has not been created by a provider, or that it the provider cannot identify it (ie, modifications to it won't take place into the database).

`row` : | a GdaRow (which contains GdaValue).
Returns : | the unique identifier for this row.

### gda_row_set_id ()

    void        gda_row_set_id                  (GdaRow *row,
                                                 const gchar *id);

Assigns a new identifier to the given row. This function is usually called by providers.

`row` : | a GdaRow (which contains GdaValue).
`id` : | new identifier for the row.

### gda_row_get_length ()

    gint        gda_row_get_length              (GdaRow *row);

`row` : | a GdaRow.
Returns : | the number of columns that the `row` has.

### gda_row_set_is_default ()

    void        gda_row_set_is_default          (GdaRow *row,
                                                 gint num,
                                                 gboolean is_default);

`row` : |
`num` : |
`is_default` : |

### gda_row_get_is_default ()

    gboolean    gda_row_get_is_default          (GdaRow *row,
                                                 gint num);

Tells if the value at column `num` in `row` must be considered as a default value

`row` : | a GdaRow
`num` : | field index
Returns : |

## Property Details

### The "`model`" property

      "model"                gpointer              : Read / Write

### The "`nb-values`" property

      "nb-values"            gint                  : Write

Allowed values: >= 1

Default value: 1

### The "`values`" property

      "values"               gpointer              : Write

## Signal Details

### The "value-changed" signal

    void        user_function                  (GdaRow *gdarow,
                                                gint arg1,
                                                gpointer arg2,
                                                gpointer arg3,
                                                gpointer user_data);

`gdarow` : | the object which received the signal.
`arg1` : |
`arg2` : |
`arg3` : |
`user_data` : | user data set when the signal handler was connected.

### The "value-to-change" signal

    gboolean    user_function                  (GdaRow *gdarow,
                                                gint arg1,
                                                gpointer arg2,
                                                gpointer arg3,
                                                gpointer user_data);

`gdarow` : | the object which received the signal.
`arg1` : |
`arg2` : |
`arg3` : |
`user_data` : | user data set when the signal handler was connected.
Returns : |