Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GQueue

[13:7] extends: object

Contains the public fields of a Queue.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GQueue (Handle = null)

    Creates a new Queue by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • clear ()

    Removes all the elements in @queue. If queue elements contain dynamically-allocated memory, they should be freed first.

    • @r None.
  • clear_full (object free_func)

    Convenience method, which frees all the memory used by a #GQueue, and calls the provided @free_func on each item in the #GQueue.

    • @p free_func is the function to be called to free memory allocated.
    • @r None.
  • copy ()

    Copies 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.

    • @r a copy of @queue.
  • delete_link (list link_)

    Removes @link_ from @queue and frees it. @link_ must be part of @queue.

    • @p link_ is a #GList link that must be part of @queue.
    • @r None.
  • find (data)

    Finds the first link in @queue which contains @data.

    • @p data is data to find.
    • @r the first link in @queue which contains @data.
  • find_custom (data, object func)

    Finds an element in a #GQueue, using a supplied function to find the desired element. It iterates over the queue, calling the given function which should return 0 when the desired element is found. The function takes two gconstpointer arguments, the #GQueue element's data as the first argument and the given user data as the second argument.

    • @p data is user data passed to @func.
    • @p func is a #GCompareFunc to call for each element. It should return 0 when the desired element is found.
    • @r the found link, or %NULL if it wasn't found.
  • foreach (user_data)

    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.

    • @p func is the function to call for each element's data.
    • @p user_data is user data to pass to @func.
    • @r None.
  • free ()

    Frees the memory allocated for the #GQueue. 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.
    • @r None.
  • free_full (object free_func)

    Convenience method, which frees all the memory used by a #GQueue, 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).

    • @p free_func is the function to be called to free each element's data.
    • @r None.
  • get_length ()

    Returns the number of items in @queue.

    • @r the number of items in @queue.
  • index (data)

    Returns the position of the first element in @queue which contains @data.

    • @p data is the data to find.
    • @r the position of the first element in @queue which contains @data, or -1 if no element in @queue contains @data.
  • init ()

    A statically-allocated #GQueue 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().

    • @r None.
  • insert_after (list sibling, data)

    Inserts @data into @queue after @sibling. @sibling must be part of

    • @queue. Since GLib 2.44 a %NULL sibling pushes the data at the head of the queue.
    • @p sibling is a #GList link that must be part of @queue, or %NULL to push at the head of the queue..
    • @p data is the data to insert.
    • @r None.
  • insert_after_link (list sibling, list link_)

    Inserts @link_ into @queue after @sibling. @sibling must be part of

    • @queue. ``
    • @p sibling is a #GList link that must be part of @queue, or %NULL to push at the head of the queue..
    • @p link_ is a #GList link to insert which must not be part of any other list..
    • @r None.
  • insert_before (list sibling, data)

    Inserts @data into @queue before @sibling. @sibling must be part of

    • @queue. Since GLib 2.44 a %NULL sibling pushes the data at the tail of the queue.
    • @p sibling is a #GList link that must be part of @queue, or %NULL to push at the tail of the queue..
    • @p data is the data to insert.
    • @r None.
  • insert_before_link (list sibling, list link_)

    Inserts @link_ into @queue before @sibling. @sibling must be part of

    • @queue. ``
    • @p sibling is a #GList link that must be part of @queue, or %NULL to push at the tail of the queue..
    • @p link_ is a #GList link to insert which must not be part of any other list..
    • @r None.
  • insert_sorted (data, user_data)

    Inserts @data into @queue using @func to determine the new position.

    • @p data is the data to insert.
    • @p func is the #GCompareDataFunc 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..
    • @p user_data is user data passed to @func.
    • @r None.
  • is_empty ()

    Returns %TRUE if the queue is empty.

    • @r %TRUE if the queue is empty.
  • link_index (list link_)

    Returns the position of @link_ in @queue.

    • @p link_ is a #GList link.
    • @r the position of @link_, or -1 if the link is not part of @queue.
  • peek_head ()

    Returns the first element of the queue.

    • @r the data of the first element in the queue, or %NULL if the queue is empty.
  • peek_head_link ()

    Returns the first link in @queue.

    • @r the first link in @queue, or %NULL if @queue is empty.
  • peek_nth (int n)

    Returns the @n'th element of @queue.

    • @p n is the position of the element.
    • @r the data for the @n'th element of @queue, or %NULL if @n is off the end of @queue.
  • peek_nth_link (int n)

    Returns the link at the given position

    • @p n is the position of the link.
    • @r the link at the @n'th position, or %NULL if @n is off the end of the list.
  • peek_tail ()

    Returns the last element of the queue.

    • @r the data of the last element in the queue, or %NULL if the queue is empty.
  • peek_tail_link ()

    Returns the last link in @queue.

    • @r the last link in @queue, or %NULL if @queue is empty.
  • pop_head ()

    Removes the first element of the queue and returns its data.

    • @r the data of the first element in the queue, or %NULL if the queue is empty.
  • pop_head_link ()

    Removes and returns the first element of the queue.

    • @r the #GList element at the head of the queue, or %NULL if the queue is empty.
  • pop_nth (int n)

    Removes the @n'th element of @queue and returns its data.

    • @p n is the position of the element.
    • @r the element's data, or %NULL if @n is off the end of @queue.
  • pop_nth_link (int n)

    Removes and returns the link at the given position.

    • @p n is the link's position.
    • @r the @n'th link, or %NULL if @n is off the end of @queue.
  • pop_tail ()

    Removes the last element of the queue and returns its data.

    • @r the data of the last element in the queue, or %NULL if the queue is empty.
  • pop_tail_link ()

    Removes and returns the last element of the queue.

    • @r the #GList element at the tail of the queue, or %NULL if the queue is empty.
  • push_head (data)

    Adds a new element at the head of the queue.

    • @p data is the data for the new element..
    • @r None.
  • push_head_link (list link_)

    Adds a new element at the head of the queue.

    • @p link_ is a single #GList element, not a list with more than one element.
    • @r None.
  • push_nth (data, int n)

    Inserts a new element into @queue at the given position.

    • @p data is the data for the new element.
    • @p n is 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..
    • @r None.
  • push_nth_link (int n, list link_)

    Inserts @link into @queue at the given position.

    • @p n is the position to insert the link. If this is negative or larger than the number of elements in @queue, the link is added to the end of
    • @queue.. ``
    • @p link_ is the link to add to @queue.
    • @r None.
  • push_tail (data)

    Adds a new element at the tail of the queue.

    • @p data is the data for the new element.
    • @r None.
  • push_tail_link (list link_)

    Adds a new element at the tail of the queue.

    • @p link_ is a single #GList element, not a list with more than one element.
    • @r None.
  • remove (data)

    Removes the first element in @queue that contains @data.

    • @p data is the data to remove.
    • @r %TRUE if @data was found and removed from @queue.
  • remove_all (data)

    Remove all elements whose data equals @data from @queue.

    • @p data is the data to remove.
    • @r the number of elements removed from @queue.
  • reverse ()

    Reverses the order of the items in @queue.

    • @r None.
  • sort (user_data)

    Sorts @queue using @compare_func.

    • @p compare_func is the #GCompareDataFunc 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..
    • @p user_data is user data passed to @compare_func.
    • @r None.
  • unlink (list link_)

    Unlinks @link_ so that it will no longer be part of @queue. The link is not freed. @link_ must be part of @queue.

    • @p link_ is a #GList link that must be part of @queue.
    • @r None.
  • find_list ()

    Returns find as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use find() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • find_custom_list ()

    Returns find_custom as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use find_custom() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • peek_head_link_list ()

    Returns peek_head_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use peek_head_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • peek_nth_link_list ()

    Returns peek_nth_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use peek_nth_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • peek_tail_link_list ()

    Returns peek_tail_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use peek_tail_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • pop_head_link_list ()

    Returns pop_head_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use pop_head_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • pop_nth_link_list ()

    Returns pop_nth_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use pop_nth_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.
  • pop_tail_link_list ()

    Returns pop_tail_link as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use pop_tail_link() when lazy or change-notify access is required.

    • @r An Aussom list of elements.