### Interface

# Gck ObjectCache

#### Description [src]

    interface Gck.ObjectCache : Gck.Object

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 `GckObjectCache:attributes` property.

#### Prerequisite

In order to implement ObjectCache, your type must inherit from`GckObject`.

#### Instance methods

###### gck_object_cache_fill

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.

###### gck_object_cache_get_attributes

Gets the attributes cached on this object.

###### gck_object_cache_set_attributes

Sets the attributes cached on this object.

###### gck_object_cache_update

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.

###### gck_object_cache_update_async

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.

###### gck_object_cache_update_finish

Complete an asynchronous operation to update the object cache with given attributes.

#### Properties

###### Gck.ObjectCache:attributes

The attributes cached on this object.

#### Interface structure

    struct GckObjectCacheInterface {
      GTypeInterface interface;
      gulong default_types;
      gint n_default_types;
      void (* fill) (
        GckObjectCache* object,
        GckAttributes* attrs
      );

    }

Interface for `GckObjectCache`. If the `default_types` field is implemented by a implementing class, then that will be used by 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.

###### Interface members

`interface`

    GTypeInterface

| Parent interface.

`default_types`

    gulong

| Attribute types that an enumerator should retrieve.

`n_default_types`

    gint

| Number of attribute types to be retrieved.

`fill`

    void (* fill) (
        GckObjectCache* object,
        GckAttributes* attrs
      )

| Virtual method to add attributes to the cache.

#### Virtual methods

###### Gck.ObjectCache.fill

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.