Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Objects
[Object: Dynamic Object Class Framework]


Detailed Description

QOF Objects provide the means for associating a storage backend to a set of QOF Entities. While an entity can be though of as an identified instance of some thing, the QOF Object provides for a way to associate instances with a storage backend. Storage might be file or SQL storage.

QOF Objects are also used by the query system ....

XXX todo, we should split out the storage aspects of this thing from the 'foreach' that query depends on. These are kinad unrelated concepts.


Files

file  qofobject.h
 the Core Object Registration/Lookup Interface


Data Structures

struct  _QofObject

Initialize the object registration subsystem

void qof_object_initialize (void)
void qof_object_shutdown (void)

Defines

#define QOF_OBJECT_VERSION   1

Typedefs

typedef _QofObject QofObject
typedef void(* QofForeachCB )(gpointer obj, gpointer user_data)
typedef void(* QofForeachTypeCB )(QofObject *type, gpointer user_data)
typedef void(* QofForeachBackendTypeCB )(QofIdTypeConst type, gpointer backend_data, gpointer user_data)

Functions

gboolean qof_object_register (const QofObject *object)
const QofObjectqof_object_lookup (QofIdTypeConst type_name)
gpointer qof_object_new_instance (QofIdTypeConst type_name, QofBook *book)
const char * qof_object_get_type_label (QofIdTypeConst type_name)
const char * qof_object_printable (QofIdTypeConst type_name, gpointer instance)
void qof_object_foreach_type (QofForeachTypeCB cb, gpointer user_data)
void qof_object_foreach (QofIdTypeConst type_name, QofBook *book, QofEntityForeachCB cb, gpointer user_data)
gboolean qof_object_register_backend (QofIdTypeConst type_name, const char *backend_name, gpointer be_data)
gpointer qof_object_lookup_backend (QofIdTypeConst type_name, const char *backend_name)
void qof_object_foreach_backend (const char *backend_name, QofForeachBackendTypeCB cb, gpointer user_data)


Define Documentation

#define QOF_OBJECT_VERSION   1
 

Defines the version of the core object object registration interface. Only object modules compiled against this version of the interface will load properly


Function Documentation

void qof_object_foreach QofIdTypeConst  type_name,
QofBook book,
QofEntityForeachCB  cb,
gpointer  user_data
 

Invoke the callback 'cb' on every instance ov a particular object type. It is presumed that the 'book' stores or somehow identifies a colllection of instances; thus the callback will be invoked only for those instances stored in the book.

void qof_object_foreach_type QofForeachTypeCB  cb,
gpointer  user_data
 

Invoke the callback 'cb' on every object class definition. The user_data pointer is passed back to the callback.

const char* qof_object_get_type_label QofIdTypeConst  type_name  ) 
 

Get the printable label for a type. This label is *not* translated; you must use _() on it if you want a translated version.

const QofObject* qof_object_lookup QofIdTypeConst  type_name  ) 
 

Lookup an object definition

gpointer qof_object_new_instance QofIdTypeConst  type_name,
QofBook book
 

Create an instance of the indicated type, returning a pointer to that instance. This routine just calls the (*new) callback on the object definition.

const char* qof_object_printable QofIdTypeConst  type_name,
gpointer  instance
 

Returns:
a Human-readable string name for an instance

gboolean qof_object_register const QofObject object  ) 
 

Register new types of object objects

gboolean qof_object_register_backend QofIdTypeConst  type_name,
const char *  backend_name,
gpointer  be_data
 

Register and lookup backend-specific data for this particular object


Generated on Sun May 23 15:41:48 2004 for QOF by doxygen 1.3.6-20040222