![]() |
![]() |
![]() |
GNOME Data Access 3.0 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Known Derived Interfaces | Properties | Signals |
GdaObject; GdaDict * gda_object_get_dict (GdaObject *gdaobj
); void gda_object_set_id (GdaObject *gdaobj
,const gchar *strid
); void gda_object_set_name (GdaObject *gdaobj
,const gchar *name
); void gda_object_set_description (GdaObject *gdaobj
,const gchar *descr
); void gda_object_set_owner (GdaObject *gdaobj
,const gchar *owner
); const gchar * gda_object_get_id (GdaObject *gdaobj
); const gchar * gda_object_get_name (GdaObject *gdaobj
); const gchar * gda_object_get_description (GdaObject *gdaobj
); const gchar * gda_object_get_owner (GdaObject *gdaobj
); void gda_object_destroy (GdaObject *gdaobj
); void gda_object_destroy_check (GdaObject *gdaobj
); gulong gda_object_connect_destroy (gpointer gdaobj
,GCallback callback
,gpointer data
); void gda_object_block_changed (GdaObject *gdaobj
); void gda_object_unblock_changed (GdaObject *gdaobj
); void gda_object_dump (GdaObject *gdaobj
,guint offset
);
GObject +----GdaObject +----GdaHandlerTime +----GdaHandlerBoolean +----GdaHandlerString +----GdaHandlerNumerical +----GdaHandlerBin +----GdaHandlerType +----GdaDataModelRow +----GdaDataModelBdb +----GdaDataModelDir +----GdaDataModelImport +----GdaParameterList +----GdaDataModelQuery +----GdaDataAccessWrapper +----GdaDataProxy +----GdaDictAggregate +----GdaDictConstraint +----GdaDictDatabase +----GdaDictField +----GdaDictFunction +----GdaDictTable +----GdaDictType +----GdaGraphviz +----GdaObjectRef +----GdaParameter +----GdaQueryObject +----GdaGraph +----GdaGraphItem
GdaObject is required by GdaDataModel, GdaEntity, GdaEntityField and GdaXmlStorage.
"changed-blocked" gboolean : Read / Write "dict" GdaDict* : Read / Write / Construct Only "string-id" gchar* : Read / Write
"changed" :Run First
"descr-changed" :Run First
"destroyed" :Run First
"id-changed" :Run First
"name-changed" :Run First
"owner-changed" :Run First
"to-be-destroyed" :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 GdaDictType must be destroyed since it does not represent a valid data type anymore.
GdaDictType object are all managed by a GdaDict which has a reference on them.
When the GdaDict object does a metadata sychronization (using gda_dict_update_dbms_meta_data()
), it calls
gda_object_destroy()
on the proper GdaDictType which must be destroyed. The other objects which did use
tha particular GdaDictType object (such as GdaDictField and GdaDictFunction for example) catch the
"destroy" signal which is emitted by the GdaDictType object being destroyed and take appropriate actions
(in this case both these objects will destroy themselves and release any reference they had on the
GdaDictType object).
The reference count of the GdaDictType object being destroyed then should normally reach 0 and the
destruction occur as for any other GObject object.
This class also introduces common attributes that can be exploited by the classes inheriting that class, such as:
GdaDict * gda_object_get_dict (GdaObject *gdaobj
);
Fetch the corresponding GdaDict object.
void gda_object_set_id (GdaObject *gdaobj
,const gchar *strid
);
Sets the string ID of the gdaobj
object.
The string ID must be unique for all the objects related to a given GdaDict object.
|
a GdaObject object |
|
the string Identifier |
void gda_object_set_name (GdaObject *gdaobj
,const gchar *name
);
Sets the name of the GdaObject object. If the name is changed, then the "name_changed" signal is emitted.
|
a GdaObject object |
void gda_object_set_description (GdaObject *gdaobj
,const gchar *descr
);
Sets the description of the GdaObject object. If the description is changed, then the "descr_changed" signal is emitted.
|
a GdaObject object |
void gda_object_set_owner (GdaObject *gdaobj
,const gchar *owner
);
Sets the owner of the GdaObject object. If the owner is changed, then the "owner_changed" signal is emitted.
|
a GdaObject object |
const gchar * gda_object_get_id (GdaObject *gdaobj
);
Fetch the string ID of the GdaObject object.
|
a GdaObject object |
Returns : |
the id. |
const gchar * gda_object_get_name (GdaObject *gdaobj
);
Fetch the name of the GdaObject object.
|
a GdaObject object |
Returns : |
the object's name. |
const gchar * gda_object_get_description (GdaObject *gdaobj
);
Fetch the description of the GdaObject object.
|
a GdaObject object |
Returns : |
the object's description. |
const gchar * gda_object_get_owner (GdaObject *gdaobj
);
Fetch the owner of the GdaObject object.
|
a GdaObject object |
Returns : |
the object's owner. |
void gda_object_destroy (GdaObject *gdaobj
);
Force the gdaobj
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 "destroyed" 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.
When this method returns, gdaobj
should have been destroyed and should not be used anymore.
|
a GdaObject object |
void gda_object_destroy_check (GdaObject *gdaobj
);
Checks that the object has been destroyed, and if not, then calls gda_object_destroy()
on it.
This is usefull for objects inheriting the GdaObject object to be called first line in their
dispose()
method.
|
a GdaObject object |
gulong gda_object_connect_destroy (gpointer gdaobj
,GCallback callback
,gpointer data
);
Connects the "destroy" signal of the gdaobj
object but first cheks that
gdaobj
exists and has not yet been destroyed.
|
a GdaObject object |
Returns : |
the handler id of the signal |
void gda_object_block_changed (GdaObject *gdaobj
);
No "changed" signal will be emitted.
|
a GdaObject object |
void gda_object_unblock_changed (GdaObject *gdaobj
);
The "changed" signal will again be emitted.
|
a GdaObject object |
void gda_object_dump (GdaObject *gdaobj
,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.
|
a GdaObject object |
|
the offset (in caracters) at which the dump will start |
"dict"
property"dict" GdaDict* : Read / Write / Construct Only
Dictionary to which the object is related.
"changed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"descr-changed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"destroyed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"id-changed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"name-changed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"owner-changed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"to-be-destroyed"
signalvoid user_function (GdaObject *gdaobject,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |