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

Revision 964, 11.1 KB checked in by igarcia, 18 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/FUtils.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/FUtils.h</h1><a href="_f_utils_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">    Based on the FS Import classes:</span>
28<a name="l00007"></a>00007 <span class="comment">    Copyright (C) 2005-2006 Feeling Software Inc</span>
29<a name="l00008"></a>00008 <span class="comment">    Copyright (C) 2005-2006 Autodesk Media Entertainment</span>
30<a name="l00009"></a>00009 <span class="comment">    MIT License: http://www.opensource.org/licenses/mit-license.php</span>
31<a name="l00010"></a>00010 <span class="comment">*/</span>
32<a name="l00011"></a>00011
33<a name="l00019"></a>00019 <span class="preprocessor">#ifndef _F_UTILS_H_</span>
34<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define _F_UTILS_H_</span>
35<a name="l00021"></a>00021 <span class="preprocessor"></span>
36<a name="l00022"></a>00022 <span class="comment">// STL</span>
37<a name="l00023"></a>00023 <span class="preprocessor">#ifdef _WIN32</span>
38<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(disable:4702)</span>
39<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
40<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &lt;string&gt;</span>
41<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;vector&gt;</span>
42<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;set&gt;</span>
43<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;xtree&gt;</span>
44<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;map&gt;</span>
45<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;algorithm&gt;</span>
46<a name="l00032"></a>00032 <span class="preprocessor">#ifdef _WIN32</span>
47<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(default:4702)</span>
48<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
49<a name="l00035"></a>00035 <span class="preprocessor"></span>
50<a name="l00036"></a>00036 <span class="comment">// Pre-include the platform-specific macros and definitions</span>
51<a name="l00037"></a>00037 <span class="preprocessor">#include "FUtils/Platforms.h"</span>
52<a name="l00038"></a>00038 <span class="preprocessor">#include "<a class="code" href="_f_u_assert_8h.html">FUtils/FUAssert.h</a>"</span>
53<a name="l00039"></a>00039
54<a name="l00040"></a>00040 <span class="comment">// PLUG_CRT enforces CRT memory checks every 128 allocations</span>
55<a name="l00041"></a>00041 <span class="comment">// and CRT memory leaks output</span>
56<a name="l00042"></a>00042 <span class="preprocessor">#if defined(_DEBUG) &amp;&amp; defined(WIN32) &amp;&amp; defined(MEMORY_DEBUG)</span>
57<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define PLUG_CRT</span>
58<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#ifdef PLUG_CRT</span>
59<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#include &lt;crtdbg.h&gt;</span>
60<a name="l00046"></a>00046 <span class="preprocessor">#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)</span>
61<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define new DEBUG_CLIENTBLOCK</span>
62<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#endif // PLUG_CRT</span>
63<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#endif // _DEBUG &amp; WIN32 &amp; MEMORY_DEBUG</span>
64<a name="l00050"></a>00050 <span class="preprocessor"></span>
65<a name="l00051"></a>00051 <span class="comment">// FMath</span>
66<a name="l00052"></a><a class="code" href="_f_utils_8h.html#d8322263932e6afc58f7974548e7291a">00052</a> <span class="preprocessor">#define HAS_VECTORTYPES </span>
67<a name="l00053"></a>00053 <span class="preprocessor">#include "FMath/FMath.h"</span>
68<a name="l00054"></a>00054 <span class="preprocessor"></span>
69<a name="l00055"></a>00055 <span class="comment">// LibXML</span>
70<a name="l00056"></a>00056 <span class="preprocessor">#ifndef NO_LIBXML</span>
71<a name="l00057"></a><a class="code" href="_f_utils_8h.html#cfecc34c0a408ce11eb1960853843007">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define HAS_LIBXML </span>
72<a name="l00058"></a><a class="code" href="_f_utils_8h.html#8909fa9da7ac1275420914bb77d5de59">00058</a> <span class="preprocessor">#define LIBXML_STATIC </span>
73<a name="l00059"></a>00059 <span class="preprocessor">#include &lt;libxml/tree.h&gt;</span>
74<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#else</span>
75<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>_xmlNode xmlNode;
76<a name="l00062"></a>00062 <span class="preprocessor">#endif</span>
77<a name="l00063"></a><a class="code" href="_f_utils_8h.html#b7c70d14d0b677b37f9a65bdd51b8f77">00063</a> <span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="classvector.html">vector&lt;struct _xmlNode*&gt;</a> <a class="code" href="classvector.html">xmlNodeList</a>;
78<a name="l00065"></a>00065 <span class="comment">// SAFE_DELETE Macro set.</span>
79<a name="l00066"></a><a class="code" href="_f_utils_8h.html#d45c5447fa213228e8493458c1770e91">00066</a> <span class="preprocessor">#define SAFE_DELETE(ptr) if ((ptr) != NULL) { delete (ptr); (ptr) = NULL; } </span>
80<a name="l00067"></a><a class="code" href="_f_utils_8h.html#7541454697b30d05714aa6b2150500b1">00067</a> <span class="preprocessor">#define SAFE_DELETE_ARRAY(ptr) if (ptr != NULL) { delete [] ptr; ptr = NULL; } </span>
81<a name="l00068"></a><a class="code" href="_f_utils_8h.html#5778427dcd0b3f99b0fc0be7018ec96c">00068</a> <span class="preprocessor">#define SAFE_FREE(ptr) if (ptr != NULL) { free(ptr); ptr = NULL; } </span>
82<a name="l00069"></a><a class="code" href="_f_utils_8h.html#6c1219ddc02b0649489919776967e378">00069</a> <span class="preprocessor">#define SAFE_RELEASE(ptr) if ((ptr) != NULL) { (ptr)-&gt;Release(); (ptr) = NULL; } </span>
83<a name="l00070"></a><a class="code" href="_f_utils_8h.html#e98b3e13794565d9dc59353ac14afd9f">00070</a> <span class="preprocessor">#define CLEAR_POINTER_VECTOR(a) { size_t l = (a).size(); for (size_t i = 0; i &lt; l; ++i) SAFE_DELETE((a)[i]); (a).clear(); } </span>
84<a name="l00071"></a><a class="code" href="_f_utils_8h.html#2e9b018f015dbf9beda61c52effb34d6">00071</a> <span class="preprocessor">#define CLEAR_POINTER_MAP(mapT, a) { for (mapT::iterator it = (a).begin(); it != (a).end(); ++it) SAFE_DELETE((*it).second); (a).clear(); } </span>
85<a name="l00073"></a>00073 <span class="preprocessor">// Conversion macros</span>
86<a name="l00074"></a><a class="code" href="_f_utils_8h.html#a2c1c2787f4fc780b0a902fc66d5c3ce">00074</a> <span class="preprocessor"></span><span class="preprocessor">#define UNUSED(a) </span>
87<a name="l00075"></a>00075 <span class="preprocessor">#ifdef _DEBUG</span>
88<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define UNUSED_NDEBUG(a) a</span>
89<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#else</span>
90<a name="l00078"></a><a class="code" href="_f_utils_8h.html#987f4a817ed072818b8d8d98a6605e52">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define UNUSED_NDEBUG(a) </span>
91<a name="l00079"></a>00079 <span class="preprocessor">#endif // _DEBUG</span>
92<a name="l00080"></a>00080 <span class="preprocessor"></span>
93<a name="l00081"></a>00081 <span class="preprocessor">#undef min</span>
94<a name="l00082"></a><a class="code" href="_f_utils_8h.html#c6afabdc09a49a433ee19d8a9486056d">00082</a> <span class="preprocessor"></span><span class="preprocessor">#define min(a, b) std::min(a, b) </span>
95<a name="l00083"></a>00083 <span class="preprocessor">#undef max</span>
96<a name="l00084"></a><a class="code" href="_f_utils_8h.html#ffe776513b24d84b39af8ab0930fef7f">00084</a> <span class="preprocessor"></span><span class="preprocessor">#define max(a, b) std::max(a, b) </span>
97<a name="l00086"></a>00086 <span class="preprocessor">// More complex utility classes</span>
98<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="_f_u_string_8h.html">FUtils/FUString.h</a>"</span>
99<a name="l00088"></a>00088 <span class="preprocessor">#include "<a class="code" href="_f_u_crc32_8h.html">FUtils/FUCrc32.h</a>"</span>
100<a name="l00089"></a>00089 <span class="preprocessor">#include "<a class="code" href="_f_u_debug_8h.html">FUtils/FUDebug.h</a>"</span>
101<a name="l00090"></a>00090 <span class="preprocessor">#include "<a class="code" href="_f_u_status_8h.html">FUtils/FUStatus.h</a>"</span>
102<a name="l00091"></a>00091
103<a name="l00097"></a>00097 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
104<a name="l00098"></a><a class="code" href="_f_utils_8h.html#a73b3f4c579c2e62ba4f4b5517a088b2">00098</a> <span class="keywordtype">bool</span> <a class="code" href="_f_m_array_8h.html#10854668923860f01d22d6f543c34cb2">IsEquivalent</a>(<span class="keyword">const</span> T&amp; v1, <span class="keyword">const</span> T&amp; v2) { <span class="keywordflow">return</span> v1 == v2; }
105<a name="l00099"></a>00099
106<a name="l00100"></a>00100 <span class="preprocessor">#endif // _F_UTILS_H_</span>
107</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:39 2006 for FCollada by&nbsp;
108<a href="http://www.doxygen.org/index.html">
109<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address>
110</body>
111</html>
Note: See TracBrowser for help on using the repository browser.