![]() |
![]() |
![]() |
Libgnomedb Reference Manual | ![]() |
---|---|---|---|---|
GnomeDbBase; GType gnome_db_base_get_type (void); GObject* gnome_db_base_new (void); void gnome_db_base_set_dict (GnomeDbBase *base, GnomeDbDict *dict); GnomeDbDict* gnome_db_base_get_dict (GnomeDbBase *base); void gnome_db_base_set_id (GnomeDbBase *base, guint id); void gnome_db_base_set_name (GnomeDbBase *base, const gchar *name); void gnome_db_base_set_description (GnomeDbBase *base, const gchar *descr); void gnome_db_base_set_owner (GnomeDbBase *base, const gchar *owner); guint gnome_db_base_get_id (GnomeDbBase *base); const gchar* gnome_db_base_get_name (GnomeDbBase *base); const gchar* gnome_db_base_get_description (GnomeDbBase *base); const gchar* gnome_db_base_get_owner (GnomeDbBase *base); void gnome_db_base_nullify (GnomeDbBase *base); void gnome_db_base_nullify_check (GnomeDbBase *base); #define gnome_db_base_connect_nullify (base, callback, data) void gnome_db_base_changed (GnomeDbBase *base); void gnome_db_base_block_changed (GnomeDbBase *base); void gnome_db_base_unblock_changed (GnomeDbBase *base); void gnome_db_base_dump (GnomeDbBase *base, guint offset);
GObject +----GnomeDbBase +----GnomeDbCondition +----GnomeDbDatabase +----GnomeDbDataSet +----GnomeDbConstraint +----GnomeDbTableField +----GnomeDbTable +----GnomeDbGraphviz +----GnomeDbHandlerBoolean +----GnomeDbHandlerCidr +----GnomeDbHandlerNone +----GnomeDbHandlerNumerical +----GnomeDbHandlerPassmd5 +----GnomeDbHandlerString +----GnomeDbHandlerTime +----GnomeDbHandlerText +----GnomeDbJoin +----GnomeDbModelWrapper +----GnomeDbParameter +----GnomeDbQfield +----GnomeDbQuery +----GnomeDbRefBase +----GnomeDbResultSet +----GnomeDbServerAggregate +----GnomeDbServerDataType +----GnomeDbServerFunction +----GnomeDbTarget +----GnomeDbGraph +----GnomeDbGraphItem +----GnomeDbWrapperField +----GnomeDbDataProxy
GnomeDbBase is required by GnomeDbEntity, GnomeDbField and GnomeDbDataModel.
"changed-blocked" gboolean : Read / Write "dict" gpointer : Read / Write "string-id" gchararray : Read / Write
"changed" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first "descr-changed" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first "id-changed" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first "name-changed" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first "nullified" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first "owner-changed" void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
This class defines a common behaviour for most of the objects of this library. As the data dictionary is quite dynamic,
the default way by which GObjects are managed (referenced and unreferenced when not needed anymore using g_object_[un]ref()
)
is not enough: sometimes this behaviour should be kept, and sometimes an object's destruction should be forced and
all the other reference holders of that object should take appropriate actions and drop their reference on that object.
Just an example to illustrate this: suppose a data type has been removed from the database itself, then the corresponding
GnomeDbServerDataType must be destroyed since it does not represent a valid data type anymore. GnomeDbServerDataType object are all
managed by the corresponding GnomeDbServer (it has a reference on them); so the gnome_db_base_nullify()
method is called on that
object which will tell all the other users of that object (GnomeDbTableField, GnomeDbParameter, etc) to drop their reference on it
(if they had one) and take the appropriate actions (both GnomeDbTableField and GnomeDbParameter will destroy themselves in the same way).
GObject* gnome_db_base_new (void);
Creates a new GnomeDbBase object. This object class is normally not instantiated directly but through child classes objects' intantiation
Returns : | the newly created object |
void gnome_db_base_set_dict (GnomeDbBase *base, GnomeDbDict *dict);
Sets the GnomeDbDict to which base
is attached to. It has no other
action than to store it to easily be able to retreive it.
base : |
a GnomeDbBase object |
dict : |
the GnomeDbDict to which base is attached
|
GnomeDbDict* gnome_db_base_get_dict (GnomeDbBase *base);
Fetch the corresponding GnomeDbDict object.
base : |
a GnomeDbBase object |
Returns : | the GnomeDbDict object to which base is attached to
|
void gnome_db_base_set_id (GnomeDbBase *base, guint id);
Sets the id of the object. The id is set to 0 by default (which means the object does not use the id at all). WARNING: the id is not checked which means no search is made to see if the id is already used
base : |
a GnomeDbBase object |
id : |
void gnome_db_base_set_name (GnomeDbBase *base, const gchar *name);
Sets the name of the GnomeDbBase object. If the name is changed, then the "name_changed" signal is emitted.
base : |
a GnomeDbBase object |
name : |
void gnome_db_base_set_description (GnomeDbBase *base, const gchar *descr);
Sets the description of the GnomeDbBase object. If the description is changed, then the "descr_changed" signal is emitted.
base : |
a GnomeDbBase object |
descr : |
void gnome_db_base_set_owner (GnomeDbBase *base, const gchar *owner);
Sets the owner of the GnomeDbBase object. If the owner is changed, then the "owner_changed" signal is emitted.
base : |
a GnomeDbBase object |
owner : |
guint gnome_db_base_get_id (GnomeDbBase *base);
Fetch the id of the GnomeDbBase object.
base : |
a GnomeDbBase object |
Returns : | the id. |
const gchar* gnome_db_base_get_name (GnomeDbBase *base);
Fetch the name of the GnomeDbBase object.
base : |
a GnomeDbBase object |
Returns : | the object's name. |
const gchar* gnome_db_base_get_description (GnomeDbBase *base);
Fetch the description of the GnomeDbBase object.
base : |
a GnomeDbBase object |
Returns : | the object's description. |
const gchar* gnome_db_base_get_owner (GnomeDbBase *base);
Fetch the owner of the GnomeDbBase object.
base : |
a GnomeDbBase object |
Returns : | the object's owner. |
void gnome_db_base_nullify (GnomeDbBase *base);
Force the base
object to be destroyed, even if we don't have a reference on it
(we can't call g_object_unref()
then) and even if the object is referenced
multiple times by other objects.
The "nullified" signal is then emitted to tell the other reference holders that the object
must be destroyed and that they should give back their reference (using g_object_unref()
).
However if a reference is still present, the object will not actually be destroyed and will
still be alive, but its state may not be deterministic.
This is usefull because sometimes objects need to disappear even if they are referenced by other
objects. This usage is the same as with the gtk_widget_destroy()
function on widgets.
base : |
a GnomeDbBase object |
void gnome_db_base_nullify_check (GnomeDbBase *base);
Checks that the object has been nullified, and if not, then calls gnome_db_base_nullify()
on it.
This is usefull for objects inheriting the GnomeDbBase object to be called first line in their
dispose()
method.
base : |
a GnomeDbBase object |
#define gnome_db_base_connect_nullify(base, callback, data)
base : |
|
callback : |
|
data : |
void gnome_db_base_changed (GnomeDbBase *base);
Force emission of the "changed" signal, except if gnome_db_base_block_changed()
has
been called.
base : |
a GnomeDbBase object |
void gnome_db_base_block_changed (GnomeDbBase *base);
No "changed" signal will be emitted.
base : |
a GnomeDbBase object |
void gnome_db_base_unblock_changed (GnomeDbBase *base);
The "changed" signal will again be emitted.
base : |
a GnomeDbBase object |
void gnome_db_base_dump (GnomeDbBase *base, guint offset);
Writes a textual description of the object to STDOUT. This function only exists if libergeant is compiled with the "--enable-debug" option. This is a virtual function.
base : |
a GnomeDbBase object |
offset : |
the offset (in caracters) at which the dump will start |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (GnomeDbBase *dbbase, gpointer user_data) : Run first
dbbase : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |