Top | ![]() |
![]() |
![]() |
![]() |
void | (*DzlTaskCacheCallback) () |
DzlTaskCache * | dzl_task_cache_new () |
void | dzl_task_cache_set_name () |
void | dzl_task_cache_get_async () |
gpointer | dzl_task_cache_get_finish () |
gboolean | dzl_task_cache_evict () |
void | dzl_task_cache_evict_all () |
gpointer | dzl_task_cache_peek () |
GPtrArray * | dzl_task_cache_get_values () |
gpointer | key-copy-func | Write / Construct Only |
gpointer | key-destroy-func | Write / Construct Only |
gpointer | key-equal-func | Write / Construct Only |
gpointer | key-hash-func | Write / Construct Only |
gpointer | populate-callback | Write / Construct Only |
gpointer | populate-callback-data | Write / Construct Only |
gpointer | populate-callback-data-destroy | Write / Construct Only |
gint64 | time-to-live | Write / Construct Only |
gpointer | value-copy-func | Write / Construct Only |
gpointer | value-destroy-func | Write / Construct Only |
void (*DzlTaskCacheCallback) (DzlTaskCache *self
,gconstpointer key
,GTask *task
,gpointer user_data
);
DzlTaskCacheCallback is the prototype for a function to be executed to populate an item in the cache.
This function will be executed when a fault (cache miss) occurs from a caller requesting an item from the cache.
The callee may complete the operation asynchronously, but MUST return
either a GObject using g_task_return_pointer()
or a GError using
g_task_return_error()
or g_task_return_new_error()
.
self |
An DzlTaskCache. |
|
key |
the key to fetch |
|
task |
the task to be completed |
|
user_data |
user_data registered at initialization. |
DzlTaskCache * dzl_task_cache_new (GHashFunc key_hash_func
,GEqualFunc key_equal_func
,GBoxedCopyFunc key_copy_func
,GBoxedFreeFunc key_destroy_func
,GBoxedCopyFunc value_copy_func
,GBoxedFreeFunc value_free_func
,gint64 time_to_live_msec
,DzlTaskCacheCallback populate_callback
,gpointer populate_callback_data
,GDestroyNotify populate_callback_data_destroy
);
[skip]
void dzl_task_cache_get_async (DzlTaskCache *self
,gconstpointer key
,gboolean force_update
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gpointer dzl_task_cache_get_finish (DzlTaskCache *self
,GAsyncResult *result
,GError **error
);
Finish a call to dzl_task_cache_get_async()
.
gpointer dzl_task_cache_peek (DzlTaskCache *self
,gconstpointer key
);
Peeks to see key
is contained in the cache and returns the
matching GObject if it does.
The reference count of the resulting GObject is not incremented. For that reason, it is important to remember that this function may only be called from the main thread.
GPtrArray *
dzl_task_cache_get_values (DzlTaskCache *self
);
Gets all the values in the cache.
The caller owns the resulting GPtrArray, which itself owns a reference to the children.
[skip]
“key-destroy-func”
property “key-destroy-func” gpointer
Key Destroy Func.
Flags: Write / Construct Only
“key-equal-func”
property “key-equal-func” gpointer
Key Equal Func.
Flags: Write / Construct Only
“populate-callback”
property “populate-callback” gpointer
Populate Callback.
Flags: Write / Construct Only
“populate-callback-data”
property “populate-callback-data” gpointer
Populate Callback Data.
Flags: Write / Construct Only
“populate-callback-data-destroy”
property “populate-callback-data-destroy” gpointer
Populate Callback Data Destroy.
Flags: Write / Construct Only
“time-to-live”
property “time-to-live” gint64
This is the number of milliseconds before an item should be evicted from the cache.
A value of zero indicates no eviction.
Flags: Write / Construct Only
Allowed values: >= 0
Default value: 30000
“value-copy-func”
property “value-copy-func” gpointer
Value Copy Func.
Flags: Write / Construct Only