GValueArray

A gobject.value_array.ValueArray is a container structure to hold an array of generic values.

The prime purpose of a gobject.value_array.ValueArray is for it to be used as an object property that holds an array of values. A gobject.value_array.ValueArray wraps an array of gobject.value.Value elements in order for it to be used as a boxed type through G_TYPE_VALUE_ARRAY.

gobject.value_array.ValueArray is deprecated in favour of glib.array.Array since GLib 2.32. It is possible to create a glib.array.Array that behaves like a gobject.value_array.ValueArray by using the size of gobject.value.Value as the element size, and by setting gobject.value.Value.unset as the clear function using glib.array.Array.setClearFunc, for instance, the following code:

GValueArray *array = g_value_array_new (10);

can be replaced by:

GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
More...

Members

Variables

nPrealloced
uint nPrealloced;
nValues
uint nValues;

number of values contained in the array

values
GValue* values;

array of values

Detailed Description

Deprecated: Use glib.array.Array instead, if possible for the given use case, as described above.