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.
- 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.
All known members inherited from class GLib.Object