GObject.ValueArray¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
n_prealloced |
r |
||
n_values |
r/w |
number of values contained in the array |
|
values |
r/w |
array of values |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GObject.ValueArray¶
A
GObject.ValueArray
contains an array ofGObject.Value
elements.- classmethod new(n_prealloced)¶
- Parameters:
n_prealloced (
int
) – number of values to preallocate space for- Returns:
a newly allocated
GObject.ValueArray
with 0 values- Return type:
Allocate and initialize a new
GObject.ValueArray
, optionally preserve space for n_prealloced elements. New arrays always contain 0 elements, regardless of the value of n_prealloced.Deprecated since version 2.32: Use
GLib.Array
and g_array_sized_new() instead.
- append(value)¶
- Parameters:
value (
GObject.Value
orNone
) –GObject.Value
to copy intoGObject.ValueArray
, orNone
- Returns:
the
GObject.ValueArray
passed in as self- Return type:
Insert a copy of value as last element of self. If value is
None
, an uninitialized value is appended.Deprecated since version 2.32: Use
GLib.Array
and g_array_append_val() instead.
- copy()¶
- Returns:
Newly allocated copy of
GObject.ValueArray
- Return type:
Construct an exact copy of a
GObject.ValueArray
by duplicating all its contents.Deprecated since version 2.32: Use
GLib.Array
and g_array_ref() instead.
- get_nth(index_)¶
- Parameters:
index (
int
) – index of the value of interest- Returns:
pointer to a value at index_ in self
- Return type:
Return a pointer to the value at index_ containd in self.
Deprecated since version 2.32: Use g_array_index() instead.
- insert(index_, value)¶
- Parameters:
index (
int
) – insertion position, must be <= value_array->;n_valuesvalue (
GObject.Value
orNone
) –GObject.Value
to copy intoGObject.ValueArray
, orNone
- Returns:
the
GObject.ValueArray
passed in as self- Return type:
Insert a copy of value at specified position into self. If value is
None
, an uninitialized value is inserted.Deprecated since version 2.32: Use
GLib.Array
and g_array_insert_val() instead.
- prepend(value)¶
- Parameters:
value (
GObject.Value
orNone
) –GObject.Value
to copy intoGObject.ValueArray
, orNone
- Returns:
the
GObject.ValueArray
passed in as self- Return type:
Insert a copy of value as first element of self. If value is
None
, an uninitialized value is prepended.Deprecated since version 2.32: Use
GLib.Array
and g_array_prepend_val() instead.
- remove(index_)¶
- Parameters:
index (
int
) – position of value to remove, which must be less than self->n_values- Returns:
the
GObject.ValueArray
passed in as self- Return type:
Remove the value at position index_ from self.
Deprecated since version 2.32: Use
GLib.Array
and g_array_remove_index() instead.
- sort(compare_func, *user_data)¶
- Parameters:
compare_func (
GLib.CompareDataFunc
) – function to compare elementsuser_data (
object
orNone
) – extra data argument provided for compare_func
- Returns:
the
GObject.ValueArray
passed in as self- Return type:
Sort self using compare_func to compare the elements according to the semantics of
GLib.CompareDataFunc
.The current implementation uses the same sorting algorithm as standard C qsort() function.
Deprecated since version 2.32: Use
GLib.Array
and g_array_sort_with_data().