libgdamm: Gnome::Gda::DataModelArray Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions

# Gnome::Gda::DataModelArray Class Reference
[Data Models]

An implementation of DataModel based on an array. More...

Inheritance diagram for Gnome::Gda::DataModelArray:
[legend]
Collaboration diagram for Gnome::Gda::DataModelArray:
[legend]

List of all members.

## Public Member Functions
virtual | ~DataModelArray ()
GdaDataModelArray* | gobj ()
| Provides access to the underlying C GObject.
const GdaDataModelArray* | gobj () const
| Provides access to the underlying C GObject.
GdaDataModelArray* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | set_column_g_type (int col, GType type)
void | set_n_columns (int cols)
| Sets the number of columns for rows inserted in this model.
void | clear ()
| Frees all the rows in model.
Glib::RefPtr< Row > | get_row (int row)
| Get a pointer to a row in model.
Glib::RefPtr< const Row > | get_row (int row) const
| Get a pointer to a row in model.
Glib::PropertyProxy< guint > | property_n_columns ()
| The number of columns in the model.
Glib::PropertyProxy_ReadOnly < guint > | property_n_columns () const
| The number of columns in the model.
## Static Public Member Functions
static Glib::RefPtr < DataModelArray > | create (int cols)
## Protected Member Functions
| DataModelArray (int cols)
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr < Gnome::Gda::DataModelArray > | wrap (GdaDataModelArray* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

An implementation of DataModel based on an array.

The Gda::DataModelArray object is a data model which internally uses a GArray to index all its rows (represented as Gda::Row objects). In this data model, all the data is stored in memory, which can be a memory limitation if the number of rows is huge. This type of data model is easy to use to store some temporary data, and has a random access mode (any value can be accessed at any time without the need for an iterator).

## Constructor & Destructor Documentation

virtual Gnome::Gda::DataModelArray::~DataModelArray | ( | ) | `[virtual]`

Gnome::Gda::DataModelArray::DataModelArray | ( | int | cols ) | `[explicit, protected]`

## Member Function Documentation

void Gnome::Gda::DataModelArray::clear | ( | ) |

Frees all the rows in model.

static Glib::RefPtr<DataModelArray> Gnome::Gda::DataModelArray::create | ( | int | cols ) | `[static]`

Glib::RefPtr<Row> Gnome::Gda::DataModelArray::get_row | ( | int | row ) |

Get a pointer to a row in model.

Parameters:

  row | Row number (starting from 0).

Returns:
  The Gda::Row, or `0` if an error occurred.

Glib::RefPtr<const Row> Gnome::Gda::DataModelArray::get_row | ( | int | row ) | const

Get a pointer to a row in model.

Parameters:

  row | Row number (starting from 0).

Returns:
  The Gda::Row, or `0` if an error occurred.

GdaDataModelArray* Gnome::Gda::DataModelArray::gobj | ( | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::DataModel.

const GdaDataModelArray* Gnome::Gda::DataModelArray::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::DataModel.

GdaDataModelArray* Gnome::Gda::DataModelArray::gobj_copy | ( | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Glib::PropertyProxy<guint> Gnome::Gda::DataModelArray::property_n_columns | ( | ) |

The number of columns in the model.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gnome::Gda::DataModelArray::property_n_columns | ( | ) | const

The number of columns in the model.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gnome::Gda::DataModelArray::set_column_g_type | ( | int | col,
|  | GType | type
| ) |  |

void Gnome::Gda::DataModelArray::set_n_columns | ( | int | cols ) |

Sets the number of columns for rows inserted in this model.

cols must be greated than or equal to 0.

Also clears model's contents.

Parameters:

  cols | Number of columns for rows this data model should use.

## Friends And Related Function Documentation

Glib::RefPtr< Gnome::Gda::DataModelArray > wrap | ( | GdaDataModelArray * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- libgdamm/datamodelarray.h