struct GskDbiSynchronizedObjectIface

struct _GskDbiSynchronizedObjectIface {
                          (* class_create)
                               (GskDbh                                * dbh,
                                GskDbiSynchronizedClassCreateCallback callback,
                                gpointer             callback_data);
                          (* create)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        create_data,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
                          (* load)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        primary_key,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
                          (* signature)
                               (GskDbiSynchronizedObject              * object,
                                GskDbiSynchronizedObjectDigestFunction digest_func,
                                gpointer             digest_data);
                          (* save)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
                          (* destroy)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        destroy_data,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
};
Interface for synchronized objects. Note manual chaining to parent interfaces is often required (and is not done automatically in the gsk interface system).

Methods:

class_create

                          (* class_create)
                               (GskDbh                                * dbh,
                                GskDbiSynchronizedClassCreateCallback callback,
                                gpointer             callback_data);
      
Initialize the synchronized object class in the persistent store. This virtual is called at most once per class per program instance, but note by definition the persistent store outlives the lifetime of the program instance, so virtuals should be prepared to properly deal with prior initialization.

GskDbh * dbh

The database handle associated with the persistent store.

GskDbiSynchronizedClassCreateCallback callback

Callback to execute when finished. Note the callback is executed whether or not creation succeeds.

gpointer callback_data

Data passed unmodified to callback.

create

                          (* create)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        create_data,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
      
Create a synchronized object.

GskDbiSynchronizedObject * object

A synchronized object of the appropriate type, constructed via gsk_gtk_object_new ().

GskDbh * dbh

The database handle associated with the persistent store.

gconstpointer create_data

Interface dependent creation data. Caller must manage this memory until the callback is executed.

GskDbiSynchronizedObjectCallback callback

Callback to execute when finished. Note the callback is executed whether or not creation succeeds.

gpointer callback_data

Data passed unmodified to callback.

load

                          (* load)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        primary_key,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
      
Load a synchronized object.

GskDbiSynchronizedObject * object

A synchronized object of the appropriate type, constructed via gsk_gtk_object_new (), which is to be filled in.

GskDbh * dbh

The database handle associated with the persistent store.

gconstpointer primary_key

Interface dependent load data. Caller must manage this memory until the callback is executed.

GskDbiSynchronizedObjectCallback callback

Callback to execute when finished. Note the callback is executed whether or not loading succeeds.

gpointer callback_data

Data passed unmodified to callback.

signature

                          (* signature)
                               (GskDbiSynchronizedObject              * object,
                                GskDbiSynchronizedObjectDigestFunction digest_func,
                                gpointer             digest_data);
      
Compute the signature of the synchronized object (e.g., to determine if it needs to be saved).

GskDbiSynchronizedObject * object

The object to compute the signature of.

GskDbiSynchronizedObjectDigestFunction digest_func

Digest function that implementations should call to update the signature.

gpointer digest_data

Digest state, which implementations should pass unmodified to digest_func.

save

                          (* save)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
      
Save a synchronized object.

GskDbiSynchronizedObject * object

The object to save.

GskDbh * dbh

The database handle associated with the persistent store.

GskDbiSynchronizedObjectCallback callback

Callback to execute when finished. Note the callback is executed whether or not saving succeeds.

gpointer callback_data

Additional data passed through unmodified.

destroy

                          (* destroy)
                               (GskDbiSynchronizedObject              * object,
                                GskDbh                                * dbh,
                                gconstpointer        destroy_data,
                                GskDbiSynchronizedObjectCallback callback,
                                gpointer             callback_data);
      
Remove a synchronized object from the persistent store.

GskDbiSynchronizedObject * object

The object to destroy. This object will have already been loaded via the load interface virtual.

GskDbh * dbh

The database handle associated with the persistent store.

gconstpointer destroy_data

Interface dependent destroy data. Caller must manage this memory until the callback is executed.

GskDbiSynchronizedObjectCallback callback

Callback to execute when finished. Note the callback is executed whether or not destruction succeeds.

gpointer callback_data

Additional data passed through unmodified.