1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>QOF: Instance</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6-20040222 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>Instance<br>
<small>
[<a class="el" href="group__Entity.html">Entity: Types, Identity and Instance Framework</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Qof Instances are a derived type of QofEntity. The Instance adds some common features and functions that most objects will want to use.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="qofinstance_8h.html">qofinstance.h</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Object instance holds common fields that most gnucash objects use. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga9" doxytag="Instance::QOF_INSTANCE" ></a>
#define </td><td class="memItemRight" valign=bottom><b>QOF_INSTANCE</b>(object) ((<a class="el" href="structQofInstance__s.html">QofInstance</a> *)(object))</td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga0" doxytag="Instance::QofInstance" ></a>
typedef <a class="el" href="structQofInstance__s.html">QofInstance_s</a> </td><td class="memItemRight" valign=bottom><b>QofInstance</b></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga1">qof_instance_init</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *, QofIdType, <a class="el" href="struct__QofBook.html">QofBook</a> *)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga2">qof_instance_release</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *inst)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="struct__QofBook.html">QofBook</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga3">qof_instance_get_book</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga4" doxytag="Instance::qof_instance_get_guid" ></a>
const <a class="el" href="union__GUID.html">GUID</a> * </td><td class="memItemRight" valign=bottom><b>qof_instance_get_guid</b> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__KVP.html#ga0">KvpFrame</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga5">qof_instance_get_slots</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga6">qof_instance_is_dirty</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga7">qof_instance_gemini</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *to, <a class="el" href="structQofInstance__s.html">QofInstance</a> *from)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__Instance.html#ga8">qof_instance_lookup_twin</a> (<a class="el" href="structQofInstance__s.html">QofInstance</a> *src, <a class="el" href="struct__QofBook.html">QofBook</a> *book)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga7" doxytag="qofinstance.h::qof_instance_gemini" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void qof_instance_gemini </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname" nowrap> <em>to</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname" nowrap> <em>from</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
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 <a class="el" href="group__Instance.html#ga10">qof_instance_lookup_twin()</a> 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. </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="qofinstance.h::qof_instance_get_book" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="struct__QofBook.html">QofBook</a>* qof_instance_get_book </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Return the book pointer </td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="qofinstance.h::qof_instance_get_slots" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="group__KVP.html#ga0">KvpFrame</a>* qof_instance_get_slots </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
return the pointer to the kvp_data </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="qofinstance.h::qof_instance_init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void qof_instance_init </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname" nowrap>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>QofIdType </td>
<td class="mdname" nowrap>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="struct__QofBook.html">QofBook</a> * </td>
<td class="mdname" nowrap></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Initialise the memory associated with an instance </td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="qofinstance.h::qof_instance_is_dirty" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> gboolean qof_instance_is_dirty </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
return value of is_dirty flag </td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="qofinstance.h::qof_instance_lookup_twin" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="structQofInstance__s.html">QofInstance</a>* qof_instance_lookup_twin </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname" nowrap> <em>src</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="struct__QofBook.html">QofBook</a> * </td>
<td class="mdname" nowrap> <em>book</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__Instance.html#ga10">qof_instance_lookup_twin()</a> routine will find the "twin" of this instance 'src' in the given other 'book' (if the twin exists).<p>
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.<p>
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. </td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="qofinstance.h::qof_instance_release" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void qof_instance_release </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structQofInstance__s.html">QofInstance</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>inst</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
release the data associated with this instance. Dont actually free the memory associated with the instance. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun May 23 15:41:48 2004 for QOF by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6-20040222 </small></address>
</body>
</html>
|