Queue

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

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

clear
void clear()

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

clearFull
void clearFull(glib.types.DestroyNotify freeFunc)

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

foreach_
void foreach_(glib.types.Func func)

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

freeFull
void freeFull(glib.types.DestroyNotify freeFunc)

Convenience method, which frees all the memory used by a #GQueue, and calls the specified destroy function on every element's data.

getLength
uint getLength()

Returns the number of items in queue.

index
int index(const(void)* data)

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

init_
void 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 glib.queue.Queue.new_.

insertSorted
void insertSorted(void* data, glib.types.CompareDataFunc func)

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

isEmpty
bool isEmpty()

Returns true if the queue is empty.

peekHead
void* peekHead()

Returns the first element of the queue.

peekNth
void* peekNth(uint n)

Returns the n'th element of queue.

peekTail
void* peekTail()

Returns the last element of the queue.

popHead
void* popHead()

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

popNth
void* popNth(uint n)

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

popTail
void* popTail()

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

pushHead
void pushHead(void* data)

Adds a new element at the head of the queue.

pushNth
void pushNth(void* data, int n)

Inserts a new element into queue at the given position.

pushTail
void pushTail(void* data)

Adds a new element at the tail of the queue.

remove
bool remove(const(void)* data)

Removes the first element in queue that contains data.

removeAll
uint removeAll(const(void)* data)

Remove all elements whose data equals data from queue.

reverse
void reverse()

Reverses the order of the items in queue.

sort
void sort(glib.types.CompareDataFunc compareFunc)

Sorts queue using compare_func.