]> git.decadent.org.uk Git - ion3-doc.git/blob - ionnotes/node3.html
[svn-inject] Installing original source of ion3
[ion3-doc.git] / ionnotes / node3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3 <!--Converted with LaTeX2HTML 2002-2-1 (1.71)
4 original version by:  Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7   Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8 <HTML>
9 <HEAD>
10 <TITLE>2 Object system implementation</TITLE>
11 <META NAME="description" CONTENT="2 Object system implementation">
12 <META NAME="keywords" CONTENT="ionnotes">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
15
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19
20 <LINK REL="STYLESHEET" HREF="ionnotes.css">
21
22 <LINK REL="next" HREF="node4.html">
23 <LINK REL="previous" HREF="node2.html">
24 <LINK REL="up" HREF="ionnotes.html">
25 <LINK REL="next" HREF="node4.html">
26 </HEAD>
27
28 <BODY >
29
30 <DIV CLASS="navigation"><!--Navigation Panel-->
31 <A NAME="tex2html101"
32   HREF="node4.html">
33 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
34 <A NAME="tex2html95"
35   HREF="ionnotes.html">
36 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
37 <A NAME="tex2html89"
38   HREF="node2.html">
39 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
40 <A NAME="tex2html97"
41   HREF="node1.html">
42 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
43 <A NAME="tex2html99"
44   HREF="node8.html">
45 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
46 <BR>
47 <B> Next:</B> <A NAME="tex2html102"
48   HREF="node4.html">3 The Lua interface</A>
49 <B> Up:</B> <A NAME="tex2html96"
50   HREF="ionnotes.html">Ion: Notes for the</A>
51 <B> Previous:</B> <A NAME="tex2html90"
52   HREF="node2.html">1 Class and object</A>
53  &nbsp; <B>  <A NAME="tex2html98"
54   HREF="node1.html">Contents</A></B> 
55  &nbsp; <B>  <A NAME="tex2html100"
56   HREF="node8.html">Index</A></B> 
57 <BR>
58 <BR></DIV>
59 <!--End of Navigation Panel-->
60
61 <H1><A NAME="SECTION00030000000000000000">
62 <SPAN CLASS="arabic">2</SPAN> Object system implementation</A>
63 </H1>
64
65 <P>
66 First, to get things clear, what are considered objects here are C
67 structures containing a properly initialized <A NAME="428"></A>
68 structure defined in <SPAN  CLASS="textit">ioncore/obj.h</SPAN> as the first element (or the
69 first element of the structure which is the first element and so on which
70 gives rise to inheritance). The WObj structure contains a pointer
71 to a WObjDescr<A NAME="430"></A> class type info structure and
72 a list of so called ''watches''. The WObjDescr structure simply
73 lists the class name, a table of dynamic functions and a pointer to
74 deinitialisation function (or ''destructor'').
75
76 <P>
77 Ion does not do any reference counting, garbage collecting or other
78 fancy things related to automatic safe freeing of objects with its
79 simplistic object system. Instead special watches (the WWatch
80 <A NAME="431"></A> structure) may be used to create safe references to
81 objects that might be destroyed during the time the specific pointer is
82 needed. When an object is destroyed, its list of watches is processed,
83 setting the pointers in the watches to NULL and the watch handlers for
84 each watch are called. 
85
86 <P>
87
88 <P>
89
90 <DIV CLASS="navigation"><HR>
91 <!--Navigation Panel-->
92 <A NAME="tex2html101"
93   HREF="node4.html">
94 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
95 <A NAME="tex2html95"
96   HREF="ionnotes.html">
97 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
98 <A NAME="tex2html89"
99   HREF="node2.html">
100 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
101 <A NAME="tex2html97"
102   HREF="node1.html">
103 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
104 <A NAME="tex2html99"
105   HREF="node8.html">
106 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
107 <BR>
108 <B> Next:</B> <A NAME="tex2html102"
109   HREF="node4.html">3 The Lua interface</A>
110 <B> Up:</B> <A NAME="tex2html96"
111   HREF="ionnotes.html">Ion: Notes for the</A>
112 <B> Previous:</B> <A NAME="tex2html90"
113   HREF="node2.html">1 Class and object</A>
114  &nbsp; <B>  <A NAME="tex2html98"
115   HREF="node1.html">Contents</A></B> 
116  &nbsp; <B>  <A NAME="tex2html100"
117   HREF="node8.html">Index</A></B> </DIV>
118 <!--End of Navigation Panel-->
119
120 </BODY>
121 </HTML>