source: NonGTP/FCollada/Documentation/_f_u_object_8h-source.html @ 964

Revision 964, 7.9 KB checked in by igarcia, 19 years ago (diff)
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>FCollada: FUtils/FUObject.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.4.6-NO -->
8<div class="tabs">
9  <ul>
10    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11    <li><a href="modules.html"><span>Modules</span></a></li>
12    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
13    <li><a href="classes.html"><span>Classes</span></a></li>
14    <li id="current"><a href="files.html"><span>Files</span></a></li>
15    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
16  </ul></div>
17<div class="tabs">
18  <ul>
19    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
20    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
21  </ul></div>
22<h1>FUtils/FUObject.h</h1><a href="_f_u_object_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
23<a name="l00002"></a>00002 <span class="comment">    Copyright (C) 2005-2006 Feeling Software Inc.</span>
24<a name="l00003"></a>00003 <span class="comment">    MIT License: http://www.opensource.org/licenses/mit-license.php</span>
25<a name="l00004"></a>00004 <span class="comment">*/</span>
26<a name="l00005"></a>00005 <span class="comment">/*</span>
27<a name="l00006"></a>00006 <span class="comment">    The idea is simple: the object registers itself in the constructor, with one container.</span>
28<a name="l00007"></a>00007 <span class="comment">    It may register/unregister itself with other containers subsequently.</span>
29<a name="l00008"></a>00008 <span class="comment"></span>
30<a name="l00009"></a>00009 <span class="comment">    It keeps a list of the containers and a pointer to the main container so that the up-classes</span>
31<a name="l00010"></a>00010 <span class="comment">    can easily access it. In the destructor, the object unregisters itself with the container(s).</span>
32<a name="l00011"></a>00011 <span class="comment"></span>
33<a name="l00012"></a>00012 <span class="comment">    The object has a RTTI-like static class structure so that the container(s) know which</span>
34<a name="l00013"></a>00013 <span class="comment">    object type list to remove this object from when it is deleted.</span>
35<a name="l00014"></a>00014 <span class="comment">*/</span>
36<a name="l00015"></a>00015
37<a name="l00021"></a>00021 <span class="preprocessor">#ifndef _FU_OBJECT_H_</span>
38<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define _FU_OBJECT_H_</span>
39<a name="l00023"></a>00023 <span class="preprocessor"></span>
40<a name="l00024"></a>00024 <span class="keyword">class </span><a class="code" href="class_f_u_object_container.html">FUObjectContainer</a>;
41<a name="l00025"></a>00025
42<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="_f_u_object_type_8h.html">FUtils/FUObjectType.h</a>"</span>
43<a name="l00027"></a>00027
44<a name="l00035"></a><a class="code" href="class_f_u_object.html">00035</a> <span class="keyword">class </span>FCOLLADA_EXPORT <a class="code" href="class_f_u_object.html">FUObject</a>
45<a name="l00036"></a>00036 {
46<a name="l00037"></a>00037 <span class="keyword">private</span>:
47<a name="l00038"></a>00038     <a class="code" href="class_f_u_object_container.html">FUObjectContainer</a>* container;
48<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keyword">class </span><a class="code" href="class_f_u_object_type.html">FUObjectType</a>* baseObjectType;
49<a name="l00040"></a>00040
50<a name="l00041"></a>00041 <span class="keyword">protected</span>:
51<a name="l00044"></a><a class="code" href="class_f_u_object.html#59dae6757453a8aca0e1aa43c83a3b1b">00044</a>     <span class="keyword">inline</span> <a class="code" href="class_f_u_object_container.html">FUObjectContainer</a>* GetContainer() { <span class="keywordflow">return</span> container; }
52<a name="l00045"></a><a class="code" href="class_f_u_object.html#c689ce547471884f39908e82ea154c55">00045</a>     <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="class_f_u_object_container.html">FUObjectContainer</a>* GetContainer()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> container; }
53<a name="l00047"></a>00047 <span class="keyword">public</span>:
54<a name="l00053"></a>00053     <a class="code" href="class_f_u_object.html">FUObject</a>(<a class="code" href="class_f_u_object_container.html">FUObjectContainer</a>* container);
55<a name="l00054"></a>00054
56<a name="l00057"></a>00057     ~<a class="code" href="class_f_u_object.html">FUObject</a>();
57<a name="l00058"></a>00058
58<a name="l00061"></a><a class="code" href="class_f_u_object.html#907d4f6d284b3ac4f8203d557af41668">00061</a>     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="class_f_u_object_type.html">FUObjectType</a>&amp; GetClassType() { <span class="keywordflow">return</span> *baseObjectType; }
59<a name="l00062"></a>00062
60<a name="l00065"></a><a class="code" href="class_f_u_object.html#f41252d8da713eae73cd7c1e9a95a9da">00065</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="class_f_u_object_type.html">FUObjectType</a>&amp; GetObjectType()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *baseObjectType; }
61<a name="l00066"></a>00066 };
62<a name="l00067"></a>00067
63<a name="l00069"></a><a class="code" href="_f_u_object_8h.html#12a81202139b7556c06eeb10966ccd71">00069</a> <span class="keyword">typedef</span> <a class="code" href="classvector.html">vector&lt;FUObject*&gt;</a> <a class="code" href="classvector.html">FUObjectList</a>;
64<a name="l00070"></a>00070
65<a name="l00078"></a><a class="code" href="class_f_u_object_container.html">00078</a> <span class="keyword">class </span>FCOLLADA_EXPORT FUObjectContainer
66<a name="l00079"></a>00079 {
67<a name="l00080"></a>00080 <span class="keyword">private</span>:
68<a name="l00081"></a>00081 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_f_u_object.html">FUObject</a>;
69<a name="l00082"></a>00082 <a class="code" href="classvector.html">FUObjectList</a> objects;
70<a name="l00083"></a>00083
71<a name="l00084"></a>00084 <span class="keywordtype">void</span> RegisterObject(<a class="code" href="class_f_u_object.html">FUObject</a>* object);
72<a name="l00085"></a>00085 <span class="keywordtype">void</span> UnregisterObject(<a class="code" href="class_f_u_object.html">FUObject</a>* object);
73<a name="l00086"></a>00086
74<a name="l00087"></a>00087 <span class="keyword">public</span>:
75<a name="l00089"></a><a class="code" href="class_f_u_object_container.html#7b6c42bc340e0971f21704857761372c">00089</a>     FUObjectContainer() {}
76<a name="l00090"></a>00090
77<a name="l00093"></a>00093 <span class="keyword">virtual</span> ~FUObjectContainer();
78<a name="l00094"></a>00094
79<a name="l00095"></a>00095 <span class="keyword">protected</span>:
80<a name="l00099"></a><a class="code" href="class_f_u_object_container.html#fd1a7b172a7e58e418315494ccfd0c85">00099</a>     <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classvector.html">FUObjectList</a>&amp; GetObjects()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> objects; }
81<a name="l00100"></a>00100 };
82<a name="l00101"></a>00101
83<a name="l00102"></a>00102 <span class="preprocessor">#endif // _FU_OBJECT_H_</span>
84</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:39 2006 for FCollada by&nbsp;
85<a href="http://www.doxygen.org/index.html">
86<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address>
87</body>
88</html>
Note: See TracBrowser for help on using the repository browser.