GObject.ValueArray¶
Fields¶
| Name | Type | Access | Description |
|---|---|---|---|
| n_prealloced | int |
r | |
| n_values | int |
r/w | number of values contained in the array |
| values | GObject.Value |
r/w | array of values |
Methods¶
| class | new (n_prealloced) |
append (value) |
|
copy () |
|
get_nth (index_) |
|
insert (index_, value) |
|
prepend (value) |
|
remove (index_) |
|
sort (compare_func, *user_data) |
Details¶
-
class
GObject.ValueArray¶ A
GObject.ValueArraycontains an array ofGObject.Valueelements.-
classmethod
new(n_prealloced)[source]¶ Parameters: n_prealloced ( int) – number of values to preallocate space forReturns: a newly allocated GObject.ValueArraywith 0 valuesReturn type: GObject.ValueArrayAllocate 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.Arrayand g_array_sized_new() instead.
-
append(value)[source]¶ Parameters: value ( GObject.ValueorNone) –GObject.Valueto copy intoGObject.ValueArray, orNoneReturns: the GObject.ValueArraypassed in as selfReturn type: GObject.ValueArrayInsert 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.Arrayand g_array_append_val() instead.
-
copy()[source]¶ Returns: Newly allocated copy of GObject.ValueArrayReturn type: GObject.ValueArrayConstruct an exact copy of a
GObject.ValueArrayby duplicating all its contents.Deprecated since version 2.32: Use
GLib.Arrayand g_array_ref() instead.
-
get_nth(index_)[source]¶ Parameters: index ( int) – index of the value of interestReturns: pointer to a value at index_ in self Return type: GObject.ValueReturn a pointer to the value at index_ containd in self.
Deprecated since version 2.32: Use g_array_index() instead.
-
insert(index_, value)[source]¶ Parameters: - index (
int) – insertion position, must be <= value_array->;n_values - value (
GObject.ValueorNone) –GObject.Valueto copy intoGObject.ValueArray, orNone
Returns: the
GObject.ValueArraypassed in as selfReturn 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.Arrayand g_array_insert_val() instead.- index (
-
prepend(value)[source]¶ Parameters: value ( GObject.ValueorNone) –GObject.Valueto copy intoGObject.ValueArray, orNoneReturns: the GObject.ValueArraypassed in as selfReturn type: GObject.ValueArrayInsert 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.Arrayand g_array_prepend_val() instead.
-
remove(index_)[source]¶ Parameters: index ( int) – position of value to remove, which must be less than self->n_valuesReturns: the GObject.ValueArraypassed in as selfReturn type: GObject.ValueArrayRemove the value at position index_ from self.
Deprecated since version 2.32: Use
GLib.Arrayand g_array_remove_index() instead.
-
sort(compare_func, *user_data)[source]¶ Parameters: - compare_func (
GLib.CompareDataFunc) – function to compare elements - user_data (
objectorNone) – extra data argument provided for compare_func
Returns: the
GObject.ValueArraypassed in as selfReturn 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.Arrayand g_array_sort_with_data().- compare_func (
-
classmethod