Cache

class Cache(pointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance

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.

Skipped during bindings generation

  • parameter value_new_func: CacheNewFunc

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Properties

Link copied to clipboard
val glibCachePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>?

Functions

Link copied to clipboard
fun destroy()

Frees the memory allocated for the #GCache.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun insert(key: <Error class: unknown class>? = null): <Error class: unknown class>?

Gets the value corresponding to the given key, creating it if necessary. It first checks if the value already exists in the #GCache, by using the @key_equal_func 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 @value_new_func. The key is duplicated by calling @key_dup_func and the duplicated key and value are inserted into the #GCache.

Link copied to clipboard
fun keyForeach(func: HFunc)

Calls the given function for each of the keys in the #GCache.

Link copied to clipboard
fun remove(value: <Error class: unknown class>? = null)

Decreases the reference count of the given value. If it drops to 0 then the value and its corresponding key are destroyed, using the

Link copied to clipboard
fun valueForeach(func: HFunc)

Calls the given function for each of the values in the #GCache.