Class (GI Struct)

GObject-2.0GObjectValueArrayDeprecated 2.32

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

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

GObject.ValueArray is deprecated in favour of GLib.Array since GLib 2.32. It is possible to create a GLib.Array that behaves like a GObject.ValueArray by using the size of GObject.Value as the element size, and by setting GObject.Value.unset as the clear function using GLib.Array.set_clear_func, 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);

since 2.32: Use GLib.Array instead, if possible for the given use case, as described above.

Index

Constructors

Properties

n_values: number

Methods

  • Return a pointer to the value at index_ contained in value_array.

    Parameters

    • Deprecatedindex_: number

      index of the value of interest

    Returns unknown

    pointer to a value at index_ in value_array