| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GLib.Structs.Cache
Description
A GCache allows sharing of complex data structures, in order to
save system resources.
GCache uses keys and values. A GCache key describes the properties
of a particular resource. A GCache value is the actual resource.
GCache has been marked as deprecated, since this API is rarely
used and not very actively maintained.
Synopsis
- newtype Cache = Cache (ManagedPtr Cache)
- type family ResolveCacheMethod (t :: Symbol) o where ...
- data CacheDestroyMethodInfo
- cacheDestroy :: (HasCallStack, MonadIO m) => Cache -> m ()
- data CacheInsertMethodInfo
- cacheInsert :: (HasCallStack, MonadIO m) => Cache -> Ptr () -> m (Ptr ())
- data CacheKeyForeachMethodInfo
- cacheKeyForeach :: (HasCallStack, MonadIO m) => Cache -> HFunc -> m ()
- data CacheRemoveMethodInfo
- cacheRemove :: (HasCallStack, MonadIO m) => Cache -> Ptr () -> m ()
- data CacheValueForeachMethodInfo
- cacheValueForeach :: (HasCallStack, MonadIO m) => Cache -> HFunc -> m ()
Exported types
Memory-managed wrapper type.
Constructors
| Cache (ManagedPtr Cache) |
Instances
Methods
Click to display all available methods, including inherited ones
type family ResolveCacheMethod (t :: Symbol) o where ... Source #
Equations
| ResolveCacheMethod "destroy" o = CacheDestroyMethodInfo | |
| ResolveCacheMethod "insert" o = CacheInsertMethodInfo | |
| ResolveCacheMethod "keyForeach" o = CacheKeyForeachMethodInfo | |
| ResolveCacheMethod "remove" o = CacheRemoveMethodInfo | |
| ResolveCacheMethod "valueForeach" o = CacheValueForeachMethodInfo | |
| ResolveCacheMethod l o = MethodResolutionFailed l o :: Type |
destroy
data CacheDestroyMethodInfo Source #
Instances
| (signature ~ m (), MonadIO m) => OverloadedMethod CacheDestroyMethodInfo Cache signature Source # | |
Defined in GI.GLib.Structs.Cache Methods overloadedMethod :: Cache -> signature # | |
| OverloadedMethodInfo CacheDestroyMethodInfo Cache Source # | |
Defined in GI.GLib.Structs.Cache Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Cache |
|
| -> m () |
insert
data CacheInsertMethodInfo Source #
Instances
| (signature ~ (Ptr () -> m (Ptr ())), MonadIO m) => OverloadedMethod CacheInsertMethodInfo Cache signature Source # | |
Defined in GI.GLib.Structs.Cache Methods overloadedMethod :: Cache -> signature # | |
| OverloadedMethodInfo CacheInsertMethodInfo Cache Source # | |
Defined in GI.GLib.Structs.Cache Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Cache |
|
| -> Ptr () |
|
| -> m (Ptr ()) | Returns: a pointer to a |
Deprecated: (Since version 2.32)Use a HashTable instead
Gets the value corresponding to the given key, creating it if
necessary. It first checks if the value already exists in the
Cache, by using the keyEqualFunc function passed to
g_cache_new(). If it does already exist it is returned, and its
reference count is increased by one. If the value does not currently
exist, if is created by calling the valueNewFunc. The key is
duplicated by calling keyDupFunc and the duplicated key and value
are inserted into the Cache.
keyForeach
data CacheKeyForeachMethodInfo Source #
Instances
| (signature ~ (HFunc -> m ()), MonadIO m) => OverloadedMethod CacheKeyForeachMethodInfo Cache signature Source # | |
Defined in GI.GLib.Structs.Cache Methods overloadedMethod :: Cache -> signature # | |
| OverloadedMethodInfo CacheKeyForeachMethodInfo Cache Source # | |
Defined in GI.GLib.Structs.Cache Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Cache |
|
| -> HFunc |
|
| -> m () |
Deprecated: (Since version 2.32)Use a HashTable instead
Calls the given function for each of the keys in the Cache.
NOTE func is passed three parameters, the value and key of a cache
entry and the userData. The order of value and key is different
from the order in which hashTableForeach passes key-value
pairs to its callback function !
remove
data CacheRemoveMethodInfo Source #
Instances
| (signature ~ (Ptr () -> m ()), MonadIO m) => OverloadedMethod CacheRemoveMethodInfo Cache signature Source # | |
Defined in GI.GLib.Structs.Cache Methods overloadedMethod :: Cache -> signature # | |
| OverloadedMethodInfo CacheRemoveMethodInfo Cache Source # | |
Defined in GI.GLib.Structs.Cache Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Cache |
|
| -> Ptr () |
|
| -> m () |
Deprecated: (Since version 2.32)Use a HashTable instead
Decreases the reference count of the given value. If it drops to 0
then the value and its corresponding key are destroyed, using the
valueDestroyFunc and keyDestroyFunc passed to g_cache_new().
valueForeach
data CacheValueForeachMethodInfo Source #
Instances
| (signature ~ (HFunc -> m ()), MonadIO m) => OverloadedMethod CacheValueForeachMethodInfo Cache signature Source # | |
Defined in GI.GLib.Structs.Cache Methods overloadedMethod :: Cache -> signature # | |
| OverloadedMethodInfo CacheValueForeachMethodInfo Cache Source # | |
Defined in GI.GLib.Structs.Cache Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Cache |
|
| -> HFunc |
|
| -> m () |
Deprecated: (Since version 2.10)The reason is that it passes pointers to internaldata structures to func; use cacheKeyForeach instead
Calls the given function for each of the values in the Cache.