Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Contains the public fields of a [Queue][glib-Double-ended-Queues].
Synopsis
- newtype Queue = Queue (ManagedPtr Queue)
- newZeroQueue :: MonadIO m => m Queue
- noQueue :: Maybe Queue
- queueClear :: (HasCallStack, MonadIO m) => Queue -> m ()
- queueClearFull :: (HasCallStack, MonadIO m) => Queue -> Maybe DestroyNotify -> m ()
- queueFree :: (HasCallStack, MonadIO m) => Queue -> m ()
- queueFreeFull :: (HasCallStack, MonadIO m) => Queue -> DestroyNotify -> m ()
- queueGetLength :: (HasCallStack, MonadIO m) => Queue -> m Word32
- queueIndex :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> m Int32
- queueInit :: (HasCallStack, MonadIO m) => Queue -> m ()
- queueIsEmpty :: (HasCallStack, MonadIO m) => Queue -> m Bool
- queuePeekHead :: (HasCallStack, MonadIO m) => Queue -> m (Ptr ())
- queuePeekNth :: (HasCallStack, MonadIO m) => Queue -> Word32 -> m (Ptr ())
- queuePeekTail :: (HasCallStack, MonadIO m) => Queue -> m (Ptr ())
- queuePopHead :: (HasCallStack, MonadIO m) => Queue -> m (Ptr ())
- queuePopNth :: (HasCallStack, MonadIO m) => Queue -> Word32 -> m (Ptr ())
- queuePopTail :: (HasCallStack, MonadIO m) => Queue -> m (Ptr ())
- queuePushHead :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> m ()
- queuePushNth :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> Int32 -> m ()
- queuePushTail :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> m ()
- queueRemove :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> m Bool
- queueRemoveAll :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> m Word32
- queueReverse :: (HasCallStack, MonadIO m) => Queue -> m ()
- clearQueueHead :: MonadIO m => Queue -> m ()
- getQueueHead :: MonadIO m => Queue -> m [Ptr ()]
- setQueueHead :: MonadIO m => Queue -> Ptr (GList (Ptr ())) -> m ()
- getQueueLength :: MonadIO m => Queue -> m Word32
- setQueueLength :: MonadIO m => Queue -> Word32 -> m ()
- clearQueueTail :: MonadIO m => Queue -> m ()
- getQueueTail :: MonadIO m => Queue -> m [Ptr ()]
- setQueueTail :: MonadIO m => Queue -> Ptr (GList (Ptr ())) -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Queue Source # | |
WrappedPtr Queue Source # | |
Defined in GI.GLib.Structs.Queue wrappedPtrCalloc :: IO (Ptr Queue) # wrappedPtrCopy :: Queue -> IO Queue # | |
tag ~ 'AttrSet => Constructible Queue tag Source # | |
Defined in GI.GLib.Structs.Queue |
Methods
Overloaded methods
clear
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m () |
Removes all the elements in queue
. If queue elements contain
dynamically-allocated memory, they should be freed first.
Since: 2.14
clearFull
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Maybe DestroyNotify |
|
-> m () |
free
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m () |
Frees the memory allocated for the Queue
. 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 queueFreeFull
or free them manually first.
freeFull
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> DestroyNotify |
|
-> m () |
Convenience method, which frees all the memory used by a Queue
,
and calls the specified destroy function on every element's data.
freeFunc
should not modify the queue (eg, by removing the freed
element from it).
Since: 2.32
getLength
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m Word32 | Returns: the number of items in |
Returns the number of items in queue
.
Since: 2.4
index
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> m Int32 | Returns: the position of the first element in |
Returns the position of the first element in queue
which contains data
.
Since: 2.4
init
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m () |
A statically-allocated Queue
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()
.
Since: 2.14
isEmpty
Returns True
if the queue is empty.
peekHead
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m (Ptr ()) | Returns: the data of the first element in the queue, or |
Returns the first element of the queue.
peekNth
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Word32 |
|
-> m (Ptr ()) | Returns: the data for the |
Returns the n
'th element of queue
.
Since: 2.4
peekTail
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m (Ptr ()) | Returns: the data of the last element in the queue, or |
Returns the last element of the queue.
popHead
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m (Ptr ()) | Returns: the data of the first element in the queue, or |
Removes the first element of the queue and returns its data.
popNth
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Word32 |
|
-> m (Ptr ()) | Returns: the element's data, or |
Removes the n
'th element of queue
and returns its data.
Since: 2.4
popTail
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m (Ptr ()) | Returns: the data of the last element in the queue, or |
Removes the last element of the queue and returns its data.
pushHead
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> m () |
Adds a new element at the head of the queue.
pushNth
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> Int32 |
|
-> m () |
Inserts a new element into queue
at the given position.
Since: 2.4
pushTail
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> m () |
Adds a new element at the tail of the queue.
remove
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> m Bool | Returns: |
Removes the first element in queue
that contains data
.
Since: 2.4
removeAll
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> Ptr () |
|
-> m Word32 | Returns: the number of elements removed from |
Remove all elements whose data equals data
from queue
.
Since: 2.4
reverse
:: (HasCallStack, MonadIO m) | |
=> Queue |
|
-> m () |
Reverses the order of the items in queue
.
Since: 2.4
Properties
head
a pointer to the first element of the queue
clearQueueHead :: MonadIO m => Queue -> m () Source #
Set the value of the “head
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#head
getQueueHead :: MonadIO m => Queue -> m [Ptr ()] Source #
Get the value of the “head
” field.
When overloading is enabled, this is equivalent to
get
queue #head
setQueueHead :: MonadIO m => Queue -> Ptr (GList (Ptr ())) -> m () Source #
Set the value of the “head
” field.
When overloading is enabled, this is equivalent to
set
queue [ #head:=
value ]
length
the number of elements in the queue
getQueueLength :: MonadIO m => Queue -> m Word32 Source #
Get the value of the “length
” field.
When overloading is enabled, this is equivalent to
get
queue #length
setQueueLength :: MonadIO m => Queue -> Word32 -> m () Source #
Set the value of the “length
” field.
When overloading is enabled, this is equivalent to
set
queue [ #length:=
value ]
tail
a pointer to the last element of the queue
clearQueueTail :: MonadIO m => Queue -> m () Source #
Set the value of the “tail
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#tail
getQueueTail :: MonadIO m => Queue -> m [Ptr ()] Source #
Get the value of the “tail
” field.
When overloading is enabled, this is equivalent to
get
queue #tail