GnuCash  4.10-100-g8b5b6256d+
Macros
gnc-gobject-utils.h File Reference

Gobject helper routines. More...

#include <glib.h>
#include <glib-object.h>

Go to the source code of this file.

Macros

#define GNC_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)
 Some macros derived from glib type macros. More...
 
#define GNC_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)   _GNC_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _GNC_DEFINE_TYPE_EXTENDED_END()
 
#define _GNC_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags)
 
#define _GNC_DEFINE_TYPE_EXTENDED_END()
 

Functions

Gobject Tracking Functions

This set of functions is used to maintain a "database" of objects that are built on top of a GObject (any level of nesting).

This database is simply a hash table of lists. The hash table takes the object name as its key and returns a list of all objects of that type. The object is then added to, deleted from, or looked up in the list. The database can also be queried for a list of all objects of a specified type. This can be used to find pre-existing GncTreeModels, etc. (In this case performing a search for a specific object wouldn't help because the information being inspected is private to the object.)

Any object added to this database during the execution of gnucash should be deleted from it before completion of the program. WHen the program shuts down, a list of all objects still in the database will be dumped out to the logfile. This should help developers find memory leaks in their code where an object is lost, or is not release because it gained an extra reference at some point during its lifetime.

void gnc_gobject_tracking_remember (GObject *object, GObjectClass *klass)
 Tell gnucash to remember this object in the database. More...
 
void gnc_gobject_tracking_forget (GObject *object)
 Tell gnucash to drop this object from the database. More...
 
const GList * gnc_gobject_tracking_get_list (const gchar *name)
 Get a list of all known objects of a specified type. More...
 
void gnc_gobject_tracking_dump (void)
 Dump the entire object tracking database via the g_log() family of functions. More...
 

Detailed Description

Gobject helper routines.

Author
Copyright (C) 2005 David Hampton hampt.nosp@m.on@e.nosp@m.mploy.nosp@m.ees..nosp@m.org

The APIs in this file are designed to provide additional functionality to GObjects, or to make it easier to use the Gobject system from within Gnucash.

Definition in file gnc-gobject-utils.h.