ObjectCache
Object Hierarchy:
Description:
public abstract class ObjectCache<T> : Object
A generic abstract cache for sets of objects. This can be used by subclasses to implement caching of homogeneous sets of objects.
Subclasses simply have to implement serialisation and deserialisation of the objects to and from GLib.Variants.
It's intended that this class be used for providing caching layers for
PersonaStores, for example.
Since:
0.6.0
Content:
Properties:
Methods:
- public async Set<T>? load_objects (Cancellable? cancellable = null)
Load a set of objects from the cache and return them as a new set. If
the cache file doesn't exist, null
will be returned. An empty set will be returned if the cache file existed but was
empty (i.e. was stored with an empty set originally).
- public async void store_objects (Set<T> objects, Cancellable? cancellable = null)
Store a set of objects to the cache file, overwriting any existing set
of objects in the cache, or creating the cache file from scratch if it didn't previously exist.
- public async void clear_cache ()
Clear this cache object, deleting its backing file.
Inherited Members:
All known members inherited from class GLib.Object
- @new
- newv
- new_valist
- get_type
- get_class
- @ref
- unref
- ref_sink
- weak_ref
- weak_unref
- add_weak_pointer
- remove_weak_pointer
- @get
- @set
- get_property
- set_property
- get_data
- set_data
- set_data_full
- steal_data
- get_qdata
- set_qdata
- set_qdata_full
- steal_qdata
- freeze_notify
- thaw_notify
- dispose
- constructed
- notify_property
- connect
- disconnect
- add_toggle_ref
- remove_toggle_ref
- bind_property
- notify
- ref_count