Queue

class Queue(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null) : ProxyInstance

Contains the public fields of a glib-Double-ended-Queues.

Skipped during bindings generation

  • parameter free_func: DestroyNotify

  • parameter func: CompareFunc

  • parameter free_func: DestroyNotify

Constructors

Link copied to clipboard
constructor()

Allocate a new Queue.

constructor(scope: <Error class: unknown class>)

Allocate a new Queue using the provided AutofreeScope.

constructor(head: List?, tail: List?, length: <Error class: unknown class>)

Allocate a new Queue.

constructor(head: List?, tail: List?, length: <Error class: unknown class>, scope: <Error class: unknown class>)

Allocate a new Queue using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibQueuePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>?
Link copied to clipboard
var head: List?

a pointer to the first element of the queue

Link copied to clipboard
var length: <Error class: unknown class>

the number of elements in the queue

Link copied to clipboard
var tail: List?

a pointer to the last element of the queue

Functions

Link copied to clipboard
fun clear()

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

Link copied to clipboard
fun copy(): Queue

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.

Link copied to clipboard
fun deleteLink(link: List)

Removes @link_ from @queue and frees it.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
fun find(data: <Error class: unknown class>? = null): List

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

Link copied to clipboard
fun foreach(func: Func)

Calls @func for each element in the queue passing @user_data to the function.

Link copied to clipboard
fun 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.

Link copied to clipboard
fun getLength(): <Error class: unknown class>

Returns the number of items in @queue.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun index(data: <Error class: unknown class>? = null): <Error class: unknown class>

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

Link copied to clipboard
fun 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().

Link copied to clipboard
fun insertAfter(sibling: List? = null, data: <Error class: unknown class>? = null)

Inserts @data into @queue after @sibling.

Link copied to clipboard
fun insertAfterLink(sibling: List? = null, link: List)

Inserts @link_ into @queue after @sibling.

Link copied to clipboard
fun insertBefore(sibling: List? = null, data: <Error class: unknown class>? = null)

Inserts @data into @queue before @sibling.

Link copied to clipboard
fun insertBeforeLink(sibling: List? = null, link: List)

Inserts @link_ into @queue before @sibling.

Link copied to clipboard
fun insertSorted(data: <Error class: unknown class>? = null, func: CompareDataFunc)

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

Link copied to clipboard

Returns true if the queue is empty.

Link copied to clipboard
fun linkIndex(link: List): <Error class: unknown class>

Returns the position of @link_ in @queue.

Link copied to clipboard
fun peekHead(): <Error class: unknown class>?

Returns the first element of the queue.

Link copied to clipboard

Returns the first link in @queue.

Link copied to clipboard
fun peekNth(n: <Error class: unknown class>): <Error class: unknown class>?

Returns the @n'th element of @queue.

Link copied to clipboard
fun peekNthLink(n: <Error class: unknown class>): List

Returns the link at the given position

Link copied to clipboard
fun peekTail(): <Error class: unknown class>?

Returns the last element of the queue.

Link copied to clipboard

Returns the last link in @queue.

Link copied to clipboard
fun popHead(): <Error class: unknown class>?

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

Link copied to clipboard

Removes and returns the first element of the queue.

Link copied to clipboard
fun popNth(n: <Error class: unknown class>): <Error class: unknown class>?

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

Link copied to clipboard
fun popNthLink(n: <Error class: unknown class>): List

Removes and returns the link at the given position.

Link copied to clipboard
fun popTail(): <Error class: unknown class>?

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

Link copied to clipboard

Removes and returns the last element of the queue.

Link copied to clipboard
fun pushHead(data: <Error class: unknown class>? = null)

Adds a new element at the head of the queue.

Link copied to clipboard
fun pushHeadLink(link: List)

Adds a new element at the head of the queue.

Link copied to clipboard
fun pushNth(data: <Error class: unknown class>? = null, n: <Error class: unknown class>)

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

Link copied to clipboard
fun pushNthLink(n: <Error class: unknown class>, link: List)

Inserts @link into @queue at the given position.

Link copied to clipboard
fun pushTail(data: <Error class: unknown class>? = null)

Adds a new element at the tail of the queue.

Link copied to clipboard
fun pushTailLink(link: List)

Adds a new element at the tail of the queue.

Link copied to clipboard
fun remove(data: <Error class: unknown class>? = null): Boolean

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

Link copied to clipboard
fun removeAll(data: <Error class: unknown class>? = null): <Error class: unknown class>

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

Link copied to clipboard
fun reverse()

Reverses the order of the items in @queue.

Link copied to clipboard
fun sort(compareFunc: CompareDataFunc)

Sorts @queue using @compare_func.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unlink(link: List)

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