source: NonGTP/FCollada/Documentation/_f_utils_8h.html @ 964

Revision 964, 14.7 KB checked in by igarcia, 18 years ago (diff)
RevLine 
[964]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/FUtils.h File Reference</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/FUtils.h File Reference</h1>Includes the common utilities classes and macros. <a href="#_details">More...</a>
23<p>
24<code>#include &lt;string&gt;</code><br>
25<code>#include &lt;vector&gt;</code><br>
26<code>#include &lt;set&gt;</code><br>
27<code>#include &lt;xtree&gt;</code><br>
28<code>#include &lt;map&gt;</code><br>
29<code>#include &lt;algorithm&gt;</code><br>
30<code>#include &quot;FUtils/Platforms.h&quot;</code><br>
31<code>#include &quot;<a class="el" href="_f_u_assert_8h-source.html">FUtils/FUAssert.h</a>&quot;</code><br>
32<code>#include &quot;<a class="el" href="_f_math_8h-source.html">FMath/FMath.h</a>&quot;</code><br>
33<code>#include &lt;libxml/tree.h&gt;</code><br>
34<code>#include &quot;<a class="el" href="_f_u_string_8h-source.html">FUtils/FUString.h</a>&quot;</code><br>
35<code>#include &quot;<a class="el" href="_f_u_crc32_8h-source.html">FUtils/FUCrc32.h</a>&quot;</code><br>
36<code>#include &quot;<a class="el" href="_f_u_debug_8h-source.html">FUtils/FUDebug.h</a>&quot;</code><br>
37<code>#include &quot;<a class="el" href="_f_u_status_8h-source.html">FUtils/FUStatus.h</a>&quot;</code><br>
38
39<p>
40<a href="_f_utils_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
41<tr><td></td></tr>
42<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
43<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d8322263932e6afc58f7974548e7291a"></a><!-- doxytag: member="FUtils.h::HAS_VECTORTYPES" ref="d8322263932e6afc58f7974548e7291a" args="" -->
44#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#d8322263932e6afc58f7974548e7291a">HAS_VECTORTYPES</a></td></tr>
45
46<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used by <a class="el" href="namespace_f_collada.html">FCollada</a>, this define implies that we are including all the common dynamically-sized arrays. <br></td></tr>
47<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cfecc34c0a408ce11eb1960853843007"></a><!-- doxytag: member="FUtils.h::HAS_LIBXML" ref="cfecc34c0a408ce11eb1960853843007" args="" -->
48#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#cfecc34c0a408ce11eb1960853843007">HAS_LIBXML</a></td></tr>
49
50<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used by <a class="el" href="namespace_f_collada.html">FCollada</a>, this define implies that we are including LibXML functions in the library interface. <br></td></tr>
51<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8909fa9da7ac1275420914bb77d5de59"></a><!-- doxytag: member="FUtils.h::LIBXML_STATIC" ref="8909fa9da7ac1275420914bb77d5de59" args="" -->
52#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#8909fa9da7ac1275420914bb77d5de59">LIBXML_STATIC</a></td></tr>
53
54<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used by LibXML, this define implies that we are statically-linking the LibXML. <br></td></tr>
55<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d45c5447fa213228e8493458c1770e91"></a><!-- doxytag: member="FUtils.h::SAFE_DELETE" ref="d45c5447fa213228e8493458c1770e91" args="(ptr)" -->
56#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#d45c5447fa213228e8493458c1770e91">SAFE_DELETE</a>(ptr)&nbsp;&nbsp;&nbsp;if ((ptr) != NULL) { delete (ptr); (ptr) = NULL; }</td></tr>
57
58<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro safely deletes a pointer and sets the given pointer to NULL. <br></td></tr>
59<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7541454697b30d05714aa6b2150500b1"></a><!-- doxytag: member="FUtils.h::SAFE_DELETE_ARRAY" ref="7541454697b30d05714aa6b2150500b1" args="(ptr)" -->
60#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#7541454697b30d05714aa6b2150500b1">SAFE_DELETE_ARRAY</a>(ptr)&nbsp;&nbsp;&nbsp;if (ptr != NULL) { delete [] ptr; ptr = NULL; }</td></tr>
61
62<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro safely deletes an heap array and sets the given pointer to NULL. <br></td></tr>
63<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5778427dcd0b3f99b0fc0be7018ec96c"></a><!-- doxytag: member="FUtils.h::SAFE_FREE" ref="5778427dcd0b3f99b0fc0be7018ec96c" args="(ptr)" -->
64#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#5778427dcd0b3f99b0fc0be7018ec96c">SAFE_FREE</a>(ptr)&nbsp;&nbsp;&nbsp;if (ptr != NULL) { free(ptr); ptr = NULL; }</td></tr>
65
66<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro safely frees a memory block and sets the given pointer to NULL. <br></td></tr>
67<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6c1219ddc02b0649489919776967e378"></a><!-- doxytag: member="FUtils.h::SAFE_RELEASE" ref="6c1219ddc02b0649489919776967e378" args="(ptr)" -->
68#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#6c1219ddc02b0649489919776967e378">SAFE_RELEASE</a>(ptr)&nbsp;&nbsp;&nbsp;if ((ptr) != NULL) { (ptr)-&gt;Release(); (ptr) = NULL; }</td></tr>
69
70<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro safely releases an interface and sets the given pointer to NULL. <br></td></tr>
71<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e98b3e13794565d9dc59353ac14afd9f"></a><!-- doxytag: member="FUtils.h::CLEAR_POINTER_VECTOR" ref="e98b3e13794565d9dc59353ac14afd9f" args="(a)" -->
72#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#e98b3e13794565d9dc59353ac14afd9f">CLEAR_POINTER_VECTOR</a>(a)&nbsp;&nbsp;&nbsp;{ size_t l = (a).size(); for (size_t i = 0; i &lt; l; ++i) SAFE_DELETE((a)[i]); (a).clear(); }</td></tr>
73
74<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro deletes all the object pointers contained within a vector and clears it. <br></td></tr>
75<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e9b018f015dbf9beda61c52effb34d6"></a><!-- doxytag: member="FUtils.h::CLEAR_POINTER_MAP" ref="2e9b018f015dbf9beda61c52effb34d6" args="(mapT, a)" -->
76#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#2e9b018f015dbf9beda61c52effb34d6">CLEAR_POINTER_MAP</a>(mapT, a)&nbsp;&nbsp;&nbsp;{ for (mapT::iterator it = (a).begin(); it != (a).end(); ++it) SAFE_DELETE((*it).second); (a).clear(); }</td></tr>
77
78<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This macro deletes all the object pointers contained within a map and clears it. <br></td></tr>
79<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#a2c1c2787f4fc780b0a902fc66d5c3ce">UNUSED</a>(a)</td></tr>
80
81<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes a piece of code during the pre-process.  <a href="#a2c1c2787f4fc780b0a902fc66d5c3ce"></a><br></td></tr>
82<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#987f4a817ed072818b8d8d98a6605e52">UNUSED_NDEBUG</a>(a)</td></tr>
83
84<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes a piece of debug code during the pre-process.  <a href="#987f4a817ed072818b8d8d98a6605e52"></a><br></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c6afabdc09a49a433ee19d8a9486056d"></a><!-- doxytag: member="FUtils.h::min" ref="c6afabdc09a49a433ee19d8a9486056d" args="(a, b)" -->
86#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#c6afabdc09a49a433ee19d8a9486056d">min</a>(a, b)&nbsp;&nbsp;&nbsp;std::min(a, b)</td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieves the smallest of two values. <br></td></tr>
89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ffe776513b24d84b39af8ab0930fef7f"></a><!-- doxytag: member="FUtils.h::max" ref="ffe776513b24d84b39af8ab0930fef7f" args="(a, b)" -->
90#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#ffe776513b24d84b39af8ab0930fef7f">max</a>(a, b)&nbsp;&nbsp;&nbsp;std::max(a, b)</td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieves the largest of two values. <br></td></tr>
93<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
94<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b7c70d14d0b677b37f9a65bdd51b8f77"></a><!-- doxytag: member="FUtils.h::xmlNodeList" ref="b7c70d14d0b677b37f9a65bdd51b8f77" args="" -->
95typedef <a class="el" href="classvector.html">vector</a>&lt; struct _xmlNode * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#b7c70d14d0b677b37f9a65bdd51b8f77">xmlNodeList</a></td></tr>
96
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A dynamically-sized array of XML nodes. <br></td></tr>
98<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
99<tr><td class="memTemplParams" nowrap colspan="2">template&lt;class T&gt; </td></tr>
100<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_f_utils_8h.html#a73b3f4c579c2e62ba4f4b5517a088b2">IsEquivalent</a> (const T &amp;v1, const T &amp;v2)</td></tr>
101
102<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieves whether two values are equivalent.  <a href="#a73b3f4c579c2e62ba4f4b5517a088b2"></a><br></td></tr>
103</table>
104<hr><a name="_details"></a><h2>Detailed Description</h2>
105Includes the common utilities classes and macros.
106<p>
107<hr><h2>Define Documentation</h2>
108<a class="anchor" name="a2c1c2787f4fc780b0a902fc66d5c3ce"></a><!-- doxytag: member="FUtils.h::UNUSED" ref="a2c1c2787f4fc780b0a902fc66d5c3ce" args="(a)" --><p>
109<table class="mdTable" cellpadding="2" cellspacing="0">
110  <tr>
111    <td class="mdRow">
112      <table cellpadding="0" cellspacing="0" border="0">
113        <tr>
114          <td class="md" nowrap valign="top">#define UNUSED          </td>
115          <td class="md" valign="top">(&nbsp;</td>
116          <td class="md" nowrap valign="top">a&nbsp;</td>
117          <td class="mdname1" valign="top" nowrap>          </td>
118          <td class="md" valign="top">&nbsp;)&nbsp;</td>
119          <td class="md" nowrap></td>
120        </tr>
121      </table>
122    </td>
123  </tr>
124</table>
125<table cellspacing="5" cellpadding="0" border="0">
126  <tr>
127    <td>
128      &nbsp;
129    </td>
130    <td>
131
132<p>
133Removes a piece of code during the pre-process.
134<p>
135This macro is useful for these pesky unused variable warnings.     </td>
136  </tr>
137</table>
138<a class="anchor" name="987f4a817ed072818b8d8d98a6605e52"></a><!-- doxytag: member="FUtils.h::UNUSED_NDEBUG" ref="987f4a817ed072818b8d8d98a6605e52" args="(a)" --><p>
139<table class="mdTable" cellpadding="2" cellspacing="0">
140  <tr>
141    <td class="mdRow">
142      <table cellpadding="0" cellspacing="0" border="0">
143        <tr>
144          <td class="md" nowrap valign="top">#define UNUSED_NDEBUG          </td>
145          <td class="md" valign="top">(&nbsp;</td>
146          <td class="md" nowrap valign="top">a&nbsp;</td>
147          <td class="mdname1" valign="top" nowrap>          </td>
148          <td class="md" valign="top">&nbsp;)&nbsp;</td>
149          <td class="md" nowrap></td>
150        </tr>
151      </table>
152    </td>
153  </tr>
154</table>
155<table cellspacing="5" cellpadding="0" border="0">
156  <tr>
157    <td>
158      &nbsp;
159    </td>
160    <td>
161
162<p>
163Removes a piece of debug code during the pre-process.
164<p>
165This macro is useful for these pesky unused variable warnings.     </td>
166  </tr>
167</table>
168<hr><h2>Function Documentation</h2>
169<a class="anchor" name="a73b3f4c579c2e62ba4f4b5517a088b2"></a><!-- doxytag: member="FUtils.h::IsEquivalent" ref="a73b3f4c579c2e62ba4f4b5517a088b2" args="(const T &amp;v1, const T &amp;v2)" --><p>
170<table class="mdTable" cellpadding="2" cellspacing="0">
171  <tr>
172    <td class="mdRow">
173      <table cellpadding="0" cellspacing="0" border="0">
174        <tr>
175          <td class="mdPrefix" colspan="4">
176template&lt;class T&gt; </td>
177        </tr>
178        <tr>
179          <td class="md" nowrap valign="top">bool IsEquivalent           </td>
180          <td class="md" valign="top">(&nbsp;</td>
181          <td class="md" nowrap valign="top">const T &amp;&nbsp;</td>
182          <td class="mdname" nowrap> <em>v1</em>, </td>
183        </tr>
184        <tr>
185          <td class="md" nowrap align="right"></td>
186          <td class="md"></td>
187          <td class="md" nowrap>const T &amp;&nbsp;</td>
188          <td class="mdname" nowrap> <em>v2</em></td>
189        </tr>
190        <tr>
191          <td class="md"></td>
192          <td class="md">)&nbsp;</td>
193          <td class="md" colspan="2"></td>
194        </tr>
195      </table>
196    </td>
197  </tr>
198</table>
199<table cellspacing="5" cellpadding="0" border="0">
200  <tr>
201    <td>
202      &nbsp;
203    </td>
204    <td>
205
206<p>
207Retrieves whether two values are equivalent.
208<p>
209This template simply calls the operator== on the two values. <dl compact><dt><b>Parameters:</b></dt><dd>
210  <table border="0" cellspacing="2" cellpadding="0">
211    <tr><td valign="top"></td><td valign="top"><em>v1</em>&nbsp;</td><td>A first value. </td></tr>
212    <tr><td valign="top"></td><td valign="top"><em>v2</em>&nbsp;</td><td>A second value. </td></tr>
213  </table>
214</dl>
215<dl compact><dt><b>Returns:</b></dt><dd>Whether the two values are equivalent. </dd></dl>
216    </td>
217  </tr>
218</table>
219<hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:40 2006 for FCollada by&nbsp;
220<a href="http://www.doxygen.org/index.html">
221<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address>
222</body>
223</html>
Note: See TracBrowser for help on using the repository browser.