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

Instance
[Entity: Types, Identity and Instance Framework]


Detailed Description

Qof Instances are a derived type of QofEntity. The Instance adds some common features and functions that most objects will want to use.


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)
QofBookqof_instance_get_book (QofInstance *)
const GUIDqof_instance_get_guid (QofInstance *)
KvpFrameqof_instance_get_slots (QofInstance *)
gboolean qof_instance_is_dirty (QofInstance *)
void qof_instance_gemini (QofInstance *to, QofInstance *from)
QofInstanceqof_instance_lookup_twin (QofInstance *src, QofBook *book)


Function Documentation

void qof_instance_gemini QofInstance to,
QofInstance from
 

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.

QofBook* qof_instance_get_book QofInstance  ) 
 

Return the book pointer

KvpFrame* qof_instance_get_slots QofInstance  ) 
 

return the pointer to the kvp_data

void qof_instance_init QofInstance ,
QofIdType  ,
QofBook
 

Initialise the memory associated with an instance

gboolean qof_instance_is_dirty QofInstance  ) 
 

return value of is_dirty flag

QofInstance* qof_instance_lookup_twin QofInstance src,
QofBook book
 

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.

void qof_instance_release QofInstance inst  ) 
 

release the data associated with this instance. Dont actually free the memory associated with the instance.


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