Top | ![]() |
![]() |
![]() |
![]() |
GckObjectCache is an interface implemented by derived classes of GckObject to indicate which attributes they'd like an enumerator to retrieve. These attributes are then cached on the object and can be retrieved through the “attributes” property.
GckAttributes *
gck_object_cache_get_attributes (GckObjectCache *object
);
void gck_object_cache_set_attributes (GckObjectCache *object
,GckAttributes *attrs
);
Sets the attributes cached on this object.
If the attrs
GckAttributes is floating, it is consumed.
void gck_object_cache_fill (GckObjectCache *object
,GckAttributes *attrs
);
Adds the attributes to the set cached on this object. If an attribute is already present in the cache it will be overridden by this value.
This will be done in a thread-safe manner.
If the attrs
GckAttributes is floating, it is consumed.
GckAttributes * gck_object_cache_lookup (GckObject *object
,const gulong *attr_types
,gint n_attr_types
,GCancellable *cancellable
,GError **error
);
Lookup attributes in the cache, or retrieve them from the object if necessary.
If object
is a GckObjectCache then this will lookup the attributes there
first if available, otherwise will read them from the object and update
the cache.
If object
is not a GckObjectCache, then the attributes will simply be
read from the object.
This may block, use the asynchronous version when this is not desirable
void gck_object_cache_lookup_async (GckObject *object
,const gulong *attr_types
,gint n_attr_types
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Lookup attributes in the cache, or retrieve them from the object if necessary.
If object
is a GckObjectCache then this will lookup the attributes there
first if available, otherwise will read them from the object and update
the cache.
If object
is not a GckObjectCache, then the attributes will simply be
read from the object.
This will return immediately and complete asynchronously
GckAttributes * gck_object_cache_lookup_finish (GckObject *object
,GAsyncResult *result
,GError **error
);
Complete an operation to lookup attributes in the cache or retrieve them from the object if necessary.
gboolean gck_object_cache_update (GckObjectCache *object
,const gulong *attr_types
,gint n_attr_types
,GCancellable *cancellable
,GError **error
);
Update the object cache with given attributes. If an attribute already exists in the cache, it will be updated, and if it doesn't it will be added.
This may block, use the asynchronous version when this is not desirable
void gck_object_cache_update_async (GckObjectCache *object
,const gulong *attr_types
,gint n_attr_types
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Update the object cache with given attributes. If an attribute already exists in the cache, it will be updated, and if it doesn't it will be added.
This call will return immediately and complete asynchronously.
gboolean gck_object_cache_update_finish (GckObjectCache *object
,GAsyncResult *result
,GError **error
);
Complete an asynchronous operation to update the object cache with given attributes.
typedef struct _GckObjectCache GckObjectCache;
An interface implemented on an GckObject which contains a cache of attributes.
struct GckObjectCacheIface { GTypeInterface interface; const gulong * default_types; gint n_default_types; void (* fill) (GckObjectCache *object, GckAttributes *attrs); };
Interface for GckObjectCache. If the default_types
field is set by
a implementing class, then the a GckEnumerator which has been setup using
gck_enumerator_set_object_type()
The implementation for populate
should add the attributes to the
cache. It must be thread safe.
GTypeInterface |
parent interface |
|
const gulong * |
attribute types that an enumerator should retrieve. |
[array length=n_default_types] |
gint |
number of attribute types to be retrieved |
|
virtual method to add attributes to the cache |
“attributes”
property“attributes” GckAttributes *
The attributes cached on this object.
Flags: Read / Write