QueueG

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

Constructors

this
this(GQueue* gQueue, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new GQueue

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(GDestroyNotify freeFunc)

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

copy
QueueG 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.

deleteLink
void deleteLink(ListG link)

Removes link_ from queue and frees it.

find
ListG find(void* data)

Finds the first link in queue which contains data.

findCustom
ListG findCustom(void* data, GCompareFunc 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.

foreach_
void foreach_(GFunc func, void* userData)

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

free
void 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.

freeFull
void freeFull(GDestroyNotify 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.

getQueueGStruct
GQueue* getQueueGStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

index
int index(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 g_queue_new().

insertAfter
void insertAfter(ListG sibling, void* data)

Inserts data into queue after sibling.

insertAfterLink
void insertAfterLink(ListG sibling, ListG link)

Inserts link_ into queue after sibling.

insertBefore
void insertBefore(ListG sibling, void* data)

Inserts data into queue before sibling.

insertBeforeLink
void insertBeforeLink(ListG sibling, ListG link)

Inserts link_ into queue before sibling.

insertSorted
void insertSorted(void* data, GCompareDataFunc func, void* userData)

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

isEmpty
bool isEmpty()

Returns TRUE if the queue is empty.

linkIndex
int linkIndex(ListG link)

Returns the position of link_ in queue.

peekHead
void* peekHead()

Returns the first element of the queue.

peekHeadLink
ListG peekHeadLink()

Returns the first link in queue.

peekNth
void* peekNth(uint n)

Returns the n'th element of queue.

peekNthLink
ListG peekNthLink(uint n)

Returns the link at the given position

peekTail
void* peekTail()

Returns the last element of the queue.

peekTailLink
ListG peekTailLink()

Returns the last link in queue.

popHead
void* popHead()

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

popHeadLink
ListG popHeadLink()

Removes and returns the first element of the queue.

popNth
void* popNth(uint n)

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

popNthLink
ListG popNthLink(uint n)

Removes and returns the link at the given position.

popTail
void* popTail()

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

popTailLink
ListG popTailLink()

Removes and returns the last element of the queue.

pushHead
void pushHead(void* data)

Adds a new element at the head of the queue.

pushHeadLink
void pushHeadLink(ListG link)

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.

pushNthLink
void pushNthLink(int n, ListG link)

Inserts link into queue at the given position.

pushTail
void pushTail(void* data)

Adds a new element at the tail of the queue.

pushTailLink
void pushTailLink(ListG link)

Adds a new element at the tail of the queue.

remove
bool remove(void* data)

Removes the first element in queue that contains data.

removeAll
uint removeAll(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(GCompareDataFunc compareFunc, void* userData)

Sorts queue using compare_func.

unlink
void unlink(ListG link)

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

Variables

gQueue
GQueue* gQueue;

the main Gtk struct