Optionalproperties: Partial<{ length: number }>Removes all the elements in queue. If queue elements contain
dynamically-allocated memory, they should be freed first.
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.
Optionalfree_func: DestroyNotifythe function to be called to free memory allocated
Calls 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.
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).
Returns the number of items in queue.
the number of items in queue
Returns the position of the first element in queue which contains data.
Optionaldata: anythe data to find
the position of the first element in queue which contains data, or -1 if no element in queue contains data
A 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().
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
Returns the n'th element of queue.
the position of the element
the data for the n'th element of queue, or null if n is off the end of queue
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
Removes the n'th element of queue and returns its data.
the position of the element
the element's data, or null if n is off the end of queue
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.
Optionaldata: anythe data for the new element.
Inserts a new element into queue at the given position.
the data for the new element
the position to insert the new element. If n is negative or larger than the number of elements in the queue, the element is added to the end of the queue.
Adds a new element at the tail of the queue.
Optionaldata: anythe data for the new element
Removes the first element in queue that contains data.
Optionaldata: anythe data to remove
true if data was found and removed from queue
Remove all elements whose data equals data from queue.
Optionaldata: anythe data to remove
the number of elements removed from queue
Reverses the order of the items in queue.
Sorts 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.