GopPersist

GopPersist — Common interface for persistence layer implementations.

Synopsis




void        gop_persist_register_object     (GopPersist *self,
                                             gchar const *key,
                                             GObject *object);
void        gop_persist_unregister_object   (GopPersist *self,
                                             gchar const *key);
GObject*    gop_persist_get_object          (GopPersist *self,
                                             gchar const *key);
void        gop_persist_load                (GopPersist *self);
void        gop_persist_save                (GopPersist *self);

Description

GopPersist is the common interface through which all persistence layer implementations are accessed.

Details

gop_persist_register_object ()

void        gop_persist_register_object     (GopPersist *self,
                                             gchar const *key,
                                             GObject *object);

Register an object for serialisation.

self : Self instance.
key : Unique string that identifies the object, e.g. for later retrieval.
object : The object that should be persisted.

gop_persist_unregister_object ()

void        gop_persist_unregister_object   (GopPersist *self,
                                             gchar const *key);

Remove an object instance so it will not be serialised.

self : Self instance.
key : Unique string that identifies the object.

gop_persist_get_object ()

GObject*    gop_persist_get_object          (GopPersist *self,
                                             gchar const *key);

Retrieve an object that has been deserialised by gopersist.

self : Self instance.
key : Unique string that identifies the object.
Returns : The object instance or NULL if the key is unknown. g_object_unref() must be called on the returned object when it's no longer referenced.

gop_persist_load ()

void        gop_persist_load                (GopPersist *self);

Loads and instantiates all objects from the serialisation media specified at construction time.

self : Self instance.

gop_persist_save ()

void        gop_persist_save                (GopPersist *self);

Saves all objects to the serialisation media specified at construction time.

self : Self instance.