Modules | |
GUID | |
Entities | |
Instance | |
QOF Entity Initialization & Shutdown | |
void | qof_entity_init (QofEntity *, QofIdType, QofCollection *) |
void | qof_entity_release (QofEntity *) |
Functions | |
const GUID * | qof_entity_get_guid (QofEntity *) |
|
Return the GUID of this entity Definition at line 101 of file qofid.c. 00102 { 00103 if (!ent) return guid_null(); 00104 return &ent->guid; 00105 }
|
|
Initialise the memory associated with an entity Definition at line 49 of file qofid.c. 00050 { 00051 g_return_if_fail (NULL != tab); 00052 00053 /* XXX We passed redundant info to this routine ... but I think that's 00054 * OK, it might eliminate programming errors. */ 00055 if (safe_strcmp(tab->e_type, type)) 00056 { 00057 PERR ("attempt to insert \"%s\" into \"%s\"", type, tab->e_type); 00058 return; 00059 } 00060 ent->e_type = CACHE_INSERT (type); 00061 00062 do 00063 { 00064 guid_new(&ent->guid); 00065 00066 if (NULL == qof_collection_lookup_entity (tab, &ent->guid)) break; 00067 00068 PWARN("duplicate id created, trying again"); 00069 } while(1); 00070 00071 ent->collection = tab; 00072 00073 qof_collection_insert_entity (tab, ent); 00074 }
|
|
Release the data associated with this entity. Dont actually free the memory associated with the instance. Definition at line 77 of file qofid.c. 00078 { 00079 if (!ent->collection) return; 00080 qof_collection_remove_entity (ent); 00081 CACHE_REMOVE (ent->e_type); 00082 ent->e_type = NULL; 00083 }
|