Files | |
file | qofinstance.h |
Object instance holds common fields that most gnucash objects use. | |
Defines | |
#define | QOF_INSTANCE(object) ((QofInstance *)(object)) |
Typedefs | |
typedef QofInstance_s | QofInstance |
Functions | |
void | qof_instance_init (QofInstance *, QofIdType, QofBook *) |
void | qof_instance_release (QofInstance *inst) |
QofBook * | qof_instance_get_book (QofInstance *) |
const GUID * | qof_instance_get_guid (QofInstance *) |
KvpFrame * | qof_instance_get_slots (QofInstance *) |
gboolean | qof_instance_is_dirty (QofInstance *) |
void | qof_instance_gemini (QofInstance *to, QofInstance *from) |
QofInstance * | qof_instance_lookup_twin (QofInstance *src, QofBook *book) |
|
Pair things up. This routine inserts a kvp value into each instance containing the guid of the other. In this way, if one has one of the pair, one can always find the other by looking up it's guid. Typically, you will want to use qof_instance_lookup_twin() to find the twin. (The current implementation assumes the two instances belong to different books, and will not add gemini kvp's unless the books differ. Note that the gemini kvp includes the book guid as well, so that the right book can be found. |
|
Return the book pointer |
|
return the pointer to the kvp_data |
|
Initialise the memory associated with an instance |
|
return value of is_dirty flag |
|
The qof_instance_lookup_twin() routine will find the "twin" of this instance 'src' in the given other 'book' (if the twin exists). When instances are gemini'ed or cloned, both of the pair are marked with the guid of thier copy, thus allowing the sibling-copy of an instance to be found. Since the sibling may end up in a different book, we need a way of finding it, given only that we know the book, and that we know its twin. That's what this routine does. Given some book 'book', and an instance 'src', it will find the sibling instance of 'src' that is in 'book', and return it. If not found, it returns NULL. This routine uses the 'gemini' kvp values to do its work. |
|
release the data associated with this instance. Dont actually free the memory associated with the instance. |