Optionalproperties: Partial<{ length: number }>Since 2.14clearSince 2.60clear_Convenience method, which frees all the memory used by a GLib.Queue,
and calls the provided free_func on each item in the GLib.Queue.
Since 2.4copyCopies a queue. Note that is a shallow copy. If the elements in the
queue consist of pointers to data, the pointers are copied, but the
actual data is not.
a copy of queue
Since 2.4foreachCalls func for each element in the queue passing user_data to the
function.
It is safe for func to remove the element from queue, but it must
not modify any part of the queue after that element.
the function to call for each element's data
Frees the memory allocated for the GLib.Queue. Only call this function
if queue was created with g_queue_new(). If queue elements contain
dynamically-allocated memory, they should be freed first.
If queue elements contain dynamically-allocated memory, you should
either use g_queue_free_full() or free them manually first.
Since 2.32free_Convenience method, which frees all the memory used by a GLib.Queue, and calls the specified destroy function on every element's data.
free_func should not modify the queue (eg, by removing the freed
element from it).
Since 2.4get_Since 2.4indexSince 2.14initA statically-allocated GLib.Queue must be initialized with this function
before it can be used. Alternatively you can initialize it with
G_QUEUE_INIT. It is not necessary to initialize queues created with
g_queue_new().
Since 2.4insert_Inserts data into queue using func to determine the new position.
the data to insert
the GLib.CompareDataFunc used to compare elements in the queue. It is called with two elements of the queue and user_data. It should return 0 if the elements are equal, a negative value if the first element comes before the second, and a positive value if the second element comes before the first.
Returns true if the queue is empty.
true if the queue is empty
Returns the first element of the queue.
the data of the first element in the queue, or null if the queue is empty
Since 2.4peek_Returns the last element of the queue.
the data of the last element in the queue, or null if the queue is empty
Removes the first element of the queue and returns its data.
the data of the first element in the queue, or null if the queue is empty
Since 2.4pop_Removes the last element of the queue and returns its data.
the data of the last element in the queue, or null if the queue is empty
Adds a new element at the head of the queue.
the data for the new element.
Since 2.4push_Adds a new element at the tail of the queue.
the data for the new element
Since 2.4removeSince 2.4remove_Since 2.4reverseSince 2.4sortSorts queue using compare_func.
the GLib.CompareDataFunc used to sort queue. This function is passed two elements of the queue and should return 0 if they are equal, a negative value if the first comes before the second, and a positive value if the second comes before the first.
Contains the public fields of a Queue.