gi-glib-0.2.44.12: GI/GLib/Structs/AsyncQueue.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
The GAsyncQueue struct is an opaque data structure which represents
an asynchronous queue. It should only be accessed through the
g_async_queue_* functions.
-}
module GI.GLib.Structs.AsyncQueue
(
-- * Exported types
AsyncQueue(..) ,
noAsyncQueue ,
-- * Methods
-- ** asyncQueueLength
asyncQueueLength ,
-- ** asyncQueueLengthUnlocked
asyncQueueLengthUnlocked ,
-- ** asyncQueueLock
asyncQueueLock ,
-- ** asyncQueuePush
asyncQueuePush ,
-- ** asyncQueuePushUnlocked
asyncQueuePushUnlocked ,
-- ** asyncQueueRefUnlocked
asyncQueueRefUnlocked ,
-- ** asyncQueueUnlock
asyncQueueUnlock ,
-- ** asyncQueueUnref
asyncQueueUnref ,
-- ** asyncQueueUnrefAndUnlock
asyncQueueUnrefAndUnlock ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.GLib.Types
import GI.GLib.Callbacks
newtype AsyncQueue = AsyncQueue (ForeignPtr AsyncQueue)
noAsyncQueue :: Maybe AsyncQueue
noAsyncQueue = Nothing
-- method AsyncQueue::length
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TInt32
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_length" g_async_queue_length ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO Int32
asyncQueueLength ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m Int32
asyncQueueLength _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- g_async_queue_length _obj'
touchManagedPtr _obj
return result
-- method AsyncQueue::length_unlocked
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TInt32
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_length_unlocked" g_async_queue_length_unlocked ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO Int32
asyncQueueLengthUnlocked ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m Int32
asyncQueueLengthUnlocked _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- g_async_queue_length_unlocked _obj'
touchManagedPtr _obj
return result
-- method AsyncQueue::lock
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_lock" g_async_queue_lock ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO ()
asyncQueueLock ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m ()
asyncQueueLock _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_lock _obj'
touchManagedPtr _obj
return ()
-- method AsyncQueue::push
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_push" g_async_queue_push ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
Ptr () -> -- data : TBasicType TVoid
IO ()
asyncQueuePush ::
(MonadIO m) =>
AsyncQueue -> -- _obj
Ptr () -> -- data
m ()
asyncQueuePush _obj data_ = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_push _obj' data_
touchManagedPtr _obj
return ()
-- method AsyncQueue::push_unlocked
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_push_unlocked" g_async_queue_push_unlocked ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
Ptr () -> -- data : TBasicType TVoid
IO ()
asyncQueuePushUnlocked ::
(MonadIO m) =>
AsyncQueue -> -- _obj
Ptr () -> -- data
m ()
asyncQueuePushUnlocked _obj data_ = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_push_unlocked _obj' data_
touchManagedPtr _obj
return ()
-- method AsyncQueue::ref_unlocked
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_ref_unlocked" g_async_queue_ref_unlocked ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO ()
{-# DEPRECATED asyncQueueRefUnlocked ["(Since version 2.8)","Reference counting is done atomically.","so g_async_queue_ref() can be used regardless of the @queue's","lock."]#-}
asyncQueueRefUnlocked ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m ()
asyncQueueRefUnlocked _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_ref_unlocked _obj'
touchManagedPtr _obj
return ()
-- method AsyncQueue::unlock
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_unlock" g_async_queue_unlock ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO ()
asyncQueueUnlock ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m ()
asyncQueueUnlock _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_unlock _obj'
touchManagedPtr _obj
return ()
-- method AsyncQueue::unref
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_unref" g_async_queue_unref ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO ()
asyncQueueUnref ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m ()
asyncQueueUnref _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_unref _obj'
touchManagedPtr _obj
return ()
-- method AsyncQueue::unref_and_unlock
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "GLib" "AsyncQueue", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "g_async_queue_unref_and_unlock" g_async_queue_unref_and_unlock ::
Ptr AsyncQueue -> -- _obj : TInterface "GLib" "AsyncQueue"
IO ()
{-# DEPRECATED asyncQueueUnrefAndUnlock ["(Since version 2.8)","Reference counting is done atomically.","so g_async_queue_unref() can be used regardless of the @queue's","lock."]#-}
asyncQueueUnrefAndUnlock ::
(MonadIO m) =>
AsyncQueue -> -- _obj
m ()
asyncQueueUnrefAndUnlock _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
g_async_queue_unref_and_unlock _obj'
touchManagedPtr _obj
return ()