glib.queue

Module for [Queue] class

class Queue

Types 1

classQueue

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

Fields
GQueue _cInstance
Methods
void * _cPtr()
uint length() @propertyGet `length` field. Returns: the number of elements in the queue
void length(uint propval) @propertySet `length` field. Params: propval = the number of elements in the queue
void clear()Removes all the elements in queue. If queue elements contain dynamically-allocated memory, they should be freed first.
void clearFull(glib.types.DestroyNotify freeFunc = null)Convenience method, which frees all the memory used by a #GQueue, and calls the provided free_func on each item in the #GQueue.
void foreach_(glib.types.Func func)Calls func for each element in the queue passing user_data to the function.
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.
uint getLength()Returns the number of items in queue. Returns: the number of items in queue
int index(const(void) * data = null)Returns the position of the first element in queue which contains data.
void init_()A statically-allocated #GQueue must be initialized with this function before it can be used. Alternatively you can initialize it with `GQUEUEINIT`. It is not necessary to initialize queues created ...
void insertSorted(void * data, glib.types.CompareDataFunc func)Inserts data into queue using func to determine the new position.
bool isEmpty()Returns true if the queue is empty. Returns: true if the queue is empty
void * peekHead()Returns the first element of the queue. Returns: the data of the first element in the queue, or null if the queue is empty
void * peekNth(uint n)Returns the `n`'th element of queue.
void * peekTail()Returns the last element of the queue. Returns: the data of the last element in the queue, or null if the queue is empty
void * popHead()Removes the first element of the queue and returns its data. Returns: the data of the first element in the queue, or null if the queue is empty
void * popNth(uint n)Removes the `n`'th element of queue and returns its data.
void * popTail()Removes the last element of the queue and returns its data. Returns: the data of the last element in the queue, or null if the queue is empty
void pushHead(void * data = null)Adds a new element at the head of the queue.
void pushNth(void * data, int n)Inserts a new element into queue at the given position.
void pushTail(void * data = null)Adds a new element at the tail of the queue.
bool remove(const(void) * data = null)Removes the first element in queue that contains data.
uint removeAll(const(void) * data = null)Remove all elements whose data equals data from queue.
void reverse()Reverses the order of the items in queue.
void sort(glib.types.CompareDataFunc compareFunc)Sorts queue using compare_func.
Constructors
this(void * ptr, Flag!"Take" take)
Destructors