diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/stream_8h-source.html | 1097 |
1 files changed, 1097 insertions, 0 deletions
diff --git a/docs/doxygen/nel/stream_8h-source.html b/docs/doxygen/nel/stream_8h-source.html new file mode 100644 index 00000000..74bc0b9b --- /dev/null +++ b/docs/doxygen/nel/stream_8h-source.html @@ -0,0 +1,1097 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>stream.h</h1><a href="stream_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00008 <font class="comment"> *</font> +00009 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00013 <font class="comment"> * any later version.</font> +00014 <font class="comment"></font> +00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00018 <font class="comment"> * General Public License for more details.</font> +00019 <font class="comment"></font> +00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00023 <font class="comment"> * MA 02111-1307, USA.</font> +00024 <font class="comment"> */</font> +00025 +00026 <font class="preprocessor">#ifndef NL_STREAM_H</font> +00027 <font class="preprocessor"></font><font class="preprocessor">#define NL_STREAM_H</font> +00028 <font class="preprocessor"></font> +00029 <font class="preprocessor">#include "<a class="code" href="types__nl_8h.html">nel/misc/types_nl.h</a>"</font> +00030 <font class="preprocessor">#include "<a class="code" href="ucstring_8h.html">nel/misc/ucstring.h</a>"</font> +00031 <font class="preprocessor">#include "<a class="code" href="class__registry_8h.html">nel/misc/class_registry.h</a>"</font> +00032 <font class="preprocessor">#include <utility></font> +00033 <font class="preprocessor">#include <string></font> +00034 <font class="preprocessor">#include <vector></font> +00035 <font class="preprocessor">#include <deque></font> +00036 <font class="preprocessor">#include <list></font> +00037 <font class="preprocessor">#include <set></font> +00038 <font class="preprocessor">#include <map></font> +00039 +00040 <font class="keyword">namespace </font>NLMISC +00041 { +00042 +00043 +00044 <font class="keyword">class </font>IStream; +00045 +00046 +00047 <font class="comment">// ======================================================================================================</font> +00048 <font class="comment">// ======================================================================================================</font> +00049 <font class="comment">// Stream System.</font> +00050 <font class="comment">// ======================================================================================================</font> +00051 <font class="comment">// ======================================================================================================</font> +00052 +00053 <font class="comment">// For Big/little Endian.</font> +<a name="l00054"></a><a class="code" href="stream_8h.html#a0">00054</a> <font class="preprocessor"># define NLMISC_BSWAP16(src) (src) = (((src)>>8)&0xFF) | (((src)&0xFF)<<8)</font> +00055 <font class="preprocessor"></font><font class="preprocessor"># ifdef NL_OS_WINDOWS</font> +00056 <font class="preprocessor"></font><font class="preprocessor"># define NLMISC_BSWAP32(src) _asm mov eax,(src) _asm bswap eax _asm mov (src),eax</font> +00057 <font class="preprocessor"></font><font class="preprocessor"># else</font> +<a name="l00058"></a><a class="code" href="stream_8h.html#a1">00058</a> <font class="preprocessor"></font><font class="preprocessor"># define NLMISC_BSWAP32(src) (src) = (((src)>>24)&0xFF) | ((((src)>>16)&0xFF)<<8) | ((((src)>>8)&0xFF)<<16) | (((src)&0xFF)<<24)</font> +00059 <font class="preprocessor"></font><font class="preprocessor"># endif</font> +<a name="l00060"></a><a class="code" href="stream_8h.html#a2">00060</a> <font class="preprocessor"></font><font class="preprocessor"># define NLMISC_BSWAP64(src) (src) = (((src)>>56)&0xFF) | ((((src)>>48)&0xFF)<<8) | ((((src)>>40)&0xFF)<<16) | ((((src)>>32)&0xFF)<<24) | ((((src)>>24)&0xFF)<<32) | ((((src)>>16)&0xFF)<<40) | ((((src)>>8)&0xFF)<<48) | (((src)&0xFF)<<56)</font> +00061 <font class="preprocessor"></font> +00062 <font class="comment">// ======================================================================================================</font> +<a name="l00070"></a><a class="code" href="structNLMISC_1_1EStream.html">00070</a> <font class="comment"></font><font class="keyword">struct </font>EStream : <font class="keyword">public</font> Exception +00071 { +<a name="l00072"></a><a class="code" href="structNLMISC_1_1EStream.html#a0">00072</a> <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>() : <a class="code" href="classNLMISC_1_1Exception.html#a0">Exception</a>( "Stream Error" ) {} +00073 +<a name="l00074"></a><a class="code" href="structNLMISC_1_1EStream.html#a1">00074</a> <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>( <font class="keyword">const</font> std::string& str ) : <a class="code" href="classNLMISC_1_1Exception.html#a0">Exception</a>( str ) {} +00075 +00076 <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>( <font class="keyword">const</font> IStream &f ); +00077 +00078 <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>( <font class="keyword">const</font> IStream &f, <font class="keyword">const</font> std::string& str ); +00079 +<a name="l00080"></a><a class="code" href="structNLMISC_1_1EStream.html#a4">00080</a> <font class="keyword">virtual</font> <a class="code" href="structNLMISC_1_1EStream.html#a4">~EStream</a>() <font class="keywordflow">throw</font>() {} +00081 +00082 <font class="comment">// May Not be Filled...</font> +<a name="l00083"></a><a class="code" href="structNLMISC_1_1EStream.html#m0">00083</a> std::string <a class="code" href="structNLMISC_1_1EStream.html#m0">StreamName</a>; +00084 }; +00085 +<a name="l00086"></a><a class="code" href="structNLMISC_1_1EOlderStream.html">00086</a> <font class="keyword">struct </font>EOlderStream : <font class="keyword">public</font> EStream +00087 { +<a name="l00088"></a><a class="code" href="structNLMISC_1_1EOlderStream.html#a0">00088</a> <a class="code" href="structNLMISC_1_1EOlderStream.html#a0">EOlderStream</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>("The version <a class="code" href="driver__opengl__extension__def_8h.html#a404">in</a> stream is older than the class" ) {} +<a name="l00089"></a><a class="code" href="structNLMISC_1_1EOlderStream.html#a1">00089</a> <a class="code" href="structNLMISC_1_1EOlderStream.html#a0">EOlderStream</a>(<font class="keyword">const</font> IStream &f) : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>(f, "The version <a class="code" href="driver__opengl__extension__def_8h.html#a404">in</a> stream is older than the class" ) {} +00090 }; +00091 +<a name="l00092"></a><a class="code" href="structNLMISC_1_1ENewerStream.html">00092</a> <font class="keyword">struct </font>ENewerStream : <font class="keyword">public</font> EStream +00093 { +<a name="l00094"></a><a class="code" href="structNLMISC_1_1ENewerStream.html#a0">00094</a> <a class="code" href="structNLMISC_1_1ENewerStream.html#a0">ENewerStream</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>("The version <a class="code" href="driver__opengl__extension__def_8h.html#a404">in</a> stream is newer than the class" ) {} +<a name="l00095"></a><a class="code" href="structNLMISC_1_1ENewerStream.html#a1">00095</a> <a class="code" href="structNLMISC_1_1ENewerStream.html#a0">ENewerStream</a>(<font class="keyword">const</font> IStream &f) : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>(f, "The version <a class="code" href="driver__opengl__extension__def_8h.html#a404">in</a> stream is newer than the class" ) {} +00096 }; +00097 +<a name="l00098"></a><a class="code" href="structNLMISC_1_1EInvalidDataStream.html">00098</a> <font class="keyword">struct </font>EInvalidDataStream : <font class="keyword">public</font> EStream +00099 { +<a name="l00100"></a><a class="code" href="structNLMISC_1_1EInvalidDataStream.html#a0">00100</a> <a class="code" href="structNLMISC_1_1EInvalidDataStream.html#a0">EInvalidDataStream</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>("Invalid <a class="code" href="driver__opengl__extension__def_8h.html#a394">data</a> <a class="code" href="driver__opengl__extension__def_8h.html#a398">format</a>" ) {} +<a name="l00101"></a><a class="code" href="structNLMISC_1_1EInvalidDataStream.html#a1">00101</a> <a class="code" href="structNLMISC_1_1EInvalidDataStream.html#a0">EInvalidDataStream</a>(<font class="keyword">const</font> IStream &f) : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>(f, "Invalid <a class="code" href="driver__opengl__extension__def_8h.html#a394">data</a> <a class="code" href="driver__opengl__extension__def_8h.html#a398">format</a>" ) {} +00102 }; +00103 +<a name="l00104"></a><a class="code" href="structNLMISC_1_1ESeekNotSupported.html">00104</a> <font class="keyword">struct </font>ESeekNotSupported : <font class="keyword">public</font> EStream +00105 { +<a name="l00106"></a><a class="code" href="structNLMISC_1_1ESeekNotSupported.html#a0">00106</a> <a class="code" href="structNLMISC_1_1ESeekNotSupported.html#a0">ESeekNotSupported</a>() : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>("Seek fonctionnality is not supported" ) {} +<a name="l00107"></a><a class="code" href="structNLMISC_1_1ESeekNotSupported.html#a1">00107</a> <a class="code" href="structNLMISC_1_1ESeekNotSupported.html#a0">ESeekNotSupported</a>(<font class="keyword">const</font> IStream &f) : <a class="code" href="structNLMISC_1_1EStream.html#a0">EStream</a>(f, "Seek fonctionnality is not supported" ) {} +00108 }; +00109 +00110 +00111 <font class="keyword">class </font>IStreamable; +00112 +00113 <font class="comment">// ======================================================================================================</font> +<a name="l00172"></a><a class="code" href="classNLMISC_1_1IStream.html">00172</a> <font class="comment"></font><font class="keyword">class </font>IStream +00173 { +00174 <font class="keyword">public</font>: +00183 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#d0">setVersionException</a>(<font class="keywordtype">bool</font> throwOnOlder, <font class="keywordtype">bool</font> throwOnNewer); +00188 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#d1">getVersionException</a>(<font class="keywordtype">bool</font> &throwOnOlder, <font class="keywordtype">bool</font> &throwOnNewer); +00189 +00190 +00191 <font class="keyword">public</font>: +00192 +00198 <font class="keyword">explicit</font> <a class="code" href="classNLMISC_1_1IStream.html#a0">IStream</a>(<font class="keywordtype">bool</font> inputStream); +00199 +<a name="l00201"></a><a class="code" href="classNLMISC_1_1IStream.html#a1">00201</a> <font class="keyword">virtual</font> <a class="code" href="classNLMISC_1_1IStream.html#a1">~IStream</a>() {} +00202 +00204 <a class="code" href="classNLMISC_1_1IStream.html#a0">IStream</a>( <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1IStream.html#a0">IStream</a>& other ); +00205 +00207 <a class="code" href="classNLMISC_1_1IStream.html#a0">IStream</a>& <a class="code" href="classNLMISC_1_1IStream.html#a3">operator=</a>( <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1IStream.html#a0">IStream</a>& other ); +00208 +00210 <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>() <font class="keyword">const</font>; +00211 +00212 +00221 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00222"></a><a class="code" href="classNLMISC_1_1IStream.html#a5">00222</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T &obj) { obj.serial(*<font class="keyword">this</font>); } +00223 +00224 +00229 +00230 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(uint8 &b) ; +00231 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(sint8 &b) ; +00232 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(uint16 &b) ; +00233 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(sint16 &b) ; +00234 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(uint32 &b) ; +00235 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(sint32 &b) ; +00236 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(uint64 &b) ; +00237 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(sint64 &b) ; +00238 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<font class="keywordtype">float</font> &b) ; +00239 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<font class="keywordtype">double</font> &b) ; +00240 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<font class="keywordtype">bool</font> &b) ; +00241 <font class="preprocessor">#ifndef NL_OS_CYGWIN</font> +00242 <font class="preprocessor"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<font class="keywordtype">char</font> &b) ; +00243 <font class="preprocessor">#endif</font> +00244 <font class="preprocessor"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(std::string &b) ; +00245 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="classucstring.html">ucstring</a> &b) ; +00247 +00248 +00250 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00251"></a><a class="code" href="classNLMISC_1_1IStream.html#a6">00251</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a6">serialEnum</a>(T &em) +00252 { +00253 sint32 i; +00254 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00255 { +00256 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(i); +00257 em = (T)i; +00258 } +00259 <font class="keywordflow">else</font> +00260 { +00261 i = em; +00262 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(i); +00263 } +00264 } +00265 +00266 +00275 +00276 uint8 <a class="code" href="classNLMISC_1_1IStream.html#z325_0">serialBitField8</a>(uint8 bf); +00278 uint16 <a class="code" href="classNLMISC_1_1IStream.html#z325_1">serialBitField16</a>(uint16 bf); +00280 uint32 <a class="code" href="classNLMISC_1_1IStream.html#z325_2">serialBitField32</a>(uint32 bf); +00282 +00283 +00288 <font class="keyword">template</font><<font class="keyword">class</font> T0,<font class="keyword">class</font> T1> +<a name="l00289"></a><a class="code" href="classNLMISC_1_1IStream.html#z326_0">00289</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T0 &a, T1 &b) +00290 { <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(a); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(b);} +00291 <font class="keyword">template</font><<font class="keyword">class</font> T0,<font class="keyword">class</font> T1,<font class="keyword">class</font> T2> +<a name="l00292"></a><a class="code" href="classNLMISC_1_1IStream.html#z326_1">00292</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T0 &a, T1 &b, T2 &c) +00293 { <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(a); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(b); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(c);} +00294 <font class="keyword">template</font><<font class="keyword">class</font> T0,<font class="keyword">class</font> T1,<font class="keyword">class</font> T2,<font class="keyword">class</font> T3> +<a name="l00295"></a><a class="code" href="classNLMISC_1_1IStream.html#z326_2">00295</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T0 &a, T1 &b, T2 &c, T3 &d) +00296 { <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(a); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(b); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(c); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(d);} +00297 <font class="keyword">template</font><<font class="keyword">class</font> T0,<font class="keyword">class</font> T1,<font class="keyword">class</font> T2,<font class="keyword">class</font> T3,<font class="keyword">class</font> T4> +<a name="l00298"></a><a class="code" href="classNLMISC_1_1IStream.html#z326_3">00298</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T0 &a, T1 &b, T2 &c, T3 &d, T4 &e) +00299 { <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(a); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(b); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(c); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(d); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(e);} +00300 <font class="keyword">template</font><<font class="keyword">class</font> T0,<font class="keyword">class</font> T1,<font class="keyword">class</font> T2,<font class="keyword">class</font> T3,<font class="keyword">class</font> T4,<font class="keyword">class</font> T5> +<a name="l00301"></a><a class="code" href="classNLMISC_1_1IStream.html#z326_4">00301</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(T0 &a, T1 &b, T2 &c, T3 &d, T4 &e, T5 &f) +00302 { <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(a); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(b); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(c); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(d); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(e); <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(f);} +00304 +00305 +00311 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00312"></a><a class="code" href="classNLMISC_1_1IStream.html#a7">00312</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::vector<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#b9">serialVector</a>(cont);} +00313 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00314"></a><a class="code" href="classNLMISC_1_1IStream.html#a8">00314</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(<a class="code" href="classstd_1_1list.html">std::list<T></a> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c2">serialSTLCont</a>(cont);} +00315 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00316"></a><a class="code" href="classNLMISC_1_1IStream.html#a9">00316</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::deque<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c2">serialSTLCont</a>(cont);} +00317 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00318"></a><a class="code" href="classNLMISC_1_1IStream.html#a10">00318</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::set<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c2">serialSTLCont</a>(cont);} +00319 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00320"></a><a class="code" href="classNLMISC_1_1IStream.html#a11">00320</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::multiset<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c2">serialSTLCont</a>(cont);} +00321 <font class="keyword">template</font><<font class="keyword">class</font> K, <font class="keyword">class</font> T> +<a name="l00322"></a><a class="code" href="classNLMISC_1_1IStream.html#a12">00322</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::map<K, T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c10">serialMap</a>(cont);} +00323 <font class="keyword">template</font><<font class="keyword">class</font> K, <font class="keyword">class</font> T> +<a name="l00324"></a><a class="code" href="classNLMISC_1_1IStream.html#a13">00324</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::multimap<K, T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c9">serialMultimap</a>(cont);} +00325 +00326 +00328 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::vector<uint8> &cont) ; +00330 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::vector<sint8> &cont) ; +00332 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a7">serialCont</a>(std::vector<bool> &cont) ; +00333 +00334 +00341 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00342"></a><a class="code" href="classNLMISC_1_1IStream.html#a17">00342</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a17">serialContPtr</a>(std::vector<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c5">serialVectorPtr</a>(cont);} +00343 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00344"></a><a class="code" href="classNLMISC_1_1IStream.html#a18">00344</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a17">serialContPtr</a>(<a class="code" href="classstd_1_1list.html">std::list<T></a> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c4">serialSTLContPtr</a>(cont);} +00345 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00346"></a><a class="code" href="classNLMISC_1_1IStream.html#a19">00346</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a17">serialContPtr</a>(std::deque<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c4">serialSTLContPtr</a>(cont);} +00347 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00348"></a><a class="code" href="classNLMISC_1_1IStream.html#a20">00348</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a17">serialContPtr</a>(std::set<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c4">serialSTLContPtr</a>(cont);} +00349 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00350"></a><a class="code" href="classNLMISC_1_1IStream.html#a21">00350</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a17">serialContPtr</a>(std::multiset<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c4">serialSTLContPtr</a>(cont);} +00351 +00352 +00358 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00359"></a><a class="code" href="classNLMISC_1_1IStream.html#a22">00359</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a22">serialContPolyPtr</a>(std::vector<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c8">serialVectorPolyPtr</a>(cont);} +00360 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00361"></a><a class="code" href="classNLMISC_1_1IStream.html#a23">00361</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a22">serialContPolyPtr</a>(<a class="code" href="classstd_1_1list.html">std::list<T></a> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c7">serialSTLContPolyPtr</a>(cont);} +00362 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00363"></a><a class="code" href="classNLMISC_1_1IStream.html#a24">00363</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a22">serialContPolyPtr</a>(std::deque<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c7">serialSTLContPolyPtr</a>(cont);} +00364 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00365"></a><a class="code" href="classNLMISC_1_1IStream.html#a25">00365</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a22">serialContPolyPtr</a>(std::set<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c7">serialSTLContPolyPtr</a>(cont);} +00366 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00367"></a><a class="code" href="classNLMISC_1_1IStream.html#a26">00367</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a22">serialContPolyPtr</a>(std::multiset<T> &cont) {<a class="code" href="classNLMISC_1_1IStream.html#c7">serialSTLContPolyPtr</a>(cont);} +00368 +00369 +00377 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00378"></a><a class="code" href="classNLMISC_1_1IStream.html#a27">00378</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a27">serialPtr</a>(T* &ptr) +00379 { +00380 uint64 node; +00381 +00382 <font class="comment">// Open the node header</font> +00383 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"PTR"</font>); +00384 +00385 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"id"</font>); +00386 +00387 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00388 { +00389 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(node); +00390 +00391 <font class="comment">// Close the header</font> +00392 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00393 +00394 <font class="keywordflow">if</font>(node==0) +00395 ptr=NULL; +00396 <font class="keywordflow">else</font> +00397 { +00398 <a class="code" href="classNLMISC_1_1IStream.html#u0">ItIdMap</a> it; +00399 it= <a class="code" href="classNLMISC_1_1IStream.html#o1">_IdMap</a>.find(node); +00400 +00401 <font class="comment">// Test if object already created/read.</font> +00402 <font class="keywordflow">if</font>( it==<a class="code" href="classNLMISC_1_1IStream.html#o1">_IdMap</a>.end() ) +00403 { +00404 <font class="comment">// Construct object.</font> +00405 ptr= <font class="keyword">new</font> T; +00406 <font class="keywordflow">if</font>(ptr==NULL) +00407 <font class="keywordflow">throw</font> EStream(); +00408 +00409 <font class="comment">// Insert the node.</font> +00410 <a class="code" href="classNLMISC_1_1IStream.html#o1">_IdMap</a>.insert( <a class="code" href="classNLMISC_1_1IStream.html#u1">ValueIdMap</a>(node, ptr) ); +00411 +00412 <font class="comment">// Read the object!</font> +00413 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(*ptr); +00414 } +00415 <font class="keywordflow">else</font> +00416 ptr= static_cast<T*>(it->second); +00417 } +00418 } +00419 <font class="keywordflow">else</font> +00420 { +00421 <font class="keywordflow">if</font>(ptr==NULL) +00422 { +00423 node= 0; +00424 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(node); +00425 +00426 <font class="comment">// Close the header</font> +00427 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00428 } +00429 <font class="keywordflow">else</font> +00430 { +00431 node= (uint64)(uint)ptr; +00432 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(node); +00433 +00434 <font class="comment">// Close the header</font> +00435 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00436 +00437 <font class="comment">// Test if object already written.</font> +00438 <font class="comment">// If the Id was not yet registered (ie insert works).</font> +00439 <font class="keywordflow">if</font>( <a class="code" href="classNLMISC_1_1IStream.html#o1">_IdMap</a>.insert( <a class="code" href="classNLMISC_1_1IStream.html#u1">ValueIdMap</a>(node, ptr) ).second==<font class="keyword">true</font> ) +00440 { +00441 <font class="comment">// Write the object!</font> +00442 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(*ptr); +00443 } +00444 } +00445 } +00446 +00447 <font class="comment">// Close the node</font> +00448 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00449 } +00450 +00451 +00459 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00460"></a><a class="code" href="classNLMISC_1_1IStream.html#a28">00460</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a28">serialPolyPtr</a>(T* &ptr) +00461 { IStreamable *p=ptr; <a class="code" href="classNLMISC_1_1IStream.html#c0">serialIStreamable</a>(p); ptr= static_cast<T*>(p);} +00462 +00463 +00474 uint <a class="code" href="classNLMISC_1_1IStream.html#a29">serialVersion</a>(uint currentVersion) ; +00475 +00476 +00487 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00488"></a><a class="code" href="classNLMISC_1_1IStream.html#a30">00488</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a30">serialCheck</a>(<font class="keyword">const</font> T& <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>) +00489 { +00490 <font class="comment">// Open a node</font> +00491 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"CHECK"</font>); +00492 +00493 <font class="keywordflow">if</font> (<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00494 { +00495 T read; +00496 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (read); +00497 <font class="keywordflow">if</font> (read!=<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>) +00498 <font class="keywordflow">throw</font> EInvalidDataStream(*<font class="keyword">this</font>); +00499 } +00500 <font class="keywordflow">else</font> +00501 { +00502 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (const_cast<T&>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>)); +00503 } +00504 +00505 <font class="comment">// Close the node </font> +00506 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00507 } +00508 +00510 +<a name="l00517"></a><a class="code" href="classNLMISC_1_1IStream.html#s3">00517</a> <font class="keyword">enum</font> <a class="code" href="classNLMISC_1_1IStream.html#s3">TSeekOrigin</a> { <a class="code" href="classNLMISC_1_1IStream.html#s3s0">begin</a>, <a class="code" href="classNLMISC_1_1IStream.html#s3s1">current</a>, <a class="code" href="classNLMISC_1_1IStream.html#s3s2">end</a> }; +00518 +00530 <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a31">seek</a> (sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a378">offset</a>, <a class="code" href="classNLMISC_1_1IStream.html#s3">TSeekOrigin</a> origin) ; +00531 +00532 +00544 <font class="keyword">virtual</font> sint32 <a class="code" href="classNLMISC_1_1IStream.html#a32">getPos</a> () ; +00545 +00546 +00550 <font class="keyword">virtual</font> std::string <a class="code" href="classNLMISC_1_1IStream.html#a33">getStreamName</a>() <font class="keyword">const</font>; +00551 +00614 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00615"></a><a class="code" href="classNLMISC_1_1IStream.html#a34">00615</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a34">xmlSerial</a> (T& value0, <font class="keyword">const</font> <font class="keywordtype">char</font> *nodeName) +00616 { +00617 <font class="comment">// Open the node</font> +00618 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (nodeName); +00619 +00620 <font class="comment">// Serial the value</font> +00621 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (value0); +00622 +00623 <font class="comment">// Close the node</font> +00624 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00625 } +00626 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00627"></a><a class="code" href="classNLMISC_1_1IStream.html#a35">00627</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a34">xmlSerial</a> (T& value0, T& value1, <font class="keyword">const</font> <font class="keywordtype">char</font> *nodeName) +00628 { +00629 <font class="comment">// Open the node</font> +00630 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (nodeName); +00631 +00632 <font class="comment">// Serial the values</font> +00633 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (value0, value1); +00634 +00635 <font class="comment">// Close the node</font> +00636 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00637 } +00638 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00639"></a><a class="code" href="classNLMISC_1_1IStream.html#a36">00639</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a34">xmlSerial</a> (T& value0, T& value1, T& value2, <font class="keyword">const</font> <font class="keywordtype">char</font> *nodeName) +00640 { +00641 <font class="comment">// Open the node</font> +00642 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (nodeName); +00643 +00644 <font class="comment">// Serial the values</font> +00645 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (value0, value1, value2); +00646 +00647 <font class="comment">// Close the node</font> +00648 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00649 } +00650 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00651"></a><a class="code" href="classNLMISC_1_1IStream.html#a37">00651</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a34">xmlSerial</a> (T& value0, T& value1, T& value2, T& value3, <font class="keyword">const</font> <font class="keywordtype">char</font> *nodeName) +00652 { +00653 <font class="comment">// Open the node</font> +00654 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (nodeName); +00655 +00656 <font class="comment">// Serial the values</font> +00657 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (value0, value1, value2, value3); +00658 +00659 <font class="comment">// Close the node</font> +00660 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00661 } +00662 +<a name="l00669"></a><a class="code" href="classNLMISC_1_1IStream.html#a38">00669</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *name) +00670 { +00671 <font class="comment">// XML Mode ?</font> +00672 <font class="keywordflow">if</font> (_XML) +00673 { +00674 <font class="comment">// Open the header</font> +00675 <font class="keywordtype">bool</font> <a class="code" href="driver__opengl__extension__def_8h.html#a400">res</a>=<a class="code" href="classNLMISC_1_1IStream.html#b1">xmlPushBeginInternal</a> (name); +00676 <font class="keywordflow">if</font> (res) +00677 <font class="comment">// close the header</font> +00678 <a class="code" href="classNLMISC_1_1IStream.html#b2">xmlPushEndInternal</a> (); +00679 <font class="comment">// Return the result</font> +00680 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a400">res</a>; +00681 } +00682 +00683 <font class="comment">// Return ok</font> +00684 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00685 } +00686 +<a name="l00693"></a><a class="code" href="classNLMISC_1_1IStream.html#a39">00693</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *name) +00694 { +00695 <font class="comment">// XML Mode ?</font> +00696 <font class="keywordflow">if</font> (_XML) +00697 { +00698 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b1">xmlPushBeginInternal</a> (name); +00699 } +00700 +00701 <font class="comment">// Return ok</font> +00702 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00703 } +00704 +<a name="l00710"></a><a class="code" href="classNLMISC_1_1IStream.html#a40">00710</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> () +00711 { +00712 <font class="comment">// XML Mode ?</font> +00713 <font class="keywordflow">if</font> (_XML) +00714 { +00715 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b2">xmlPushEndInternal</a> (); +00716 } +00717 +00718 <font class="comment">// Return ok</font> +00719 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00720 } +00721 +<a name="l00727"></a><a class="code" href="classNLMISC_1_1IStream.html#a41">00727</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> () +00728 { +00729 <font class="comment">// XML Mode ?</font> +00730 <font class="keywordflow">if</font> (_XML) +00731 { +00732 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b3">xmlPopInternal</a> (); +00733 } +00734 +00735 <font class="comment">// Return ok</font> +00736 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00737 } +00738 +<a name="l00745"></a><a class="code" href="classNLMISC_1_1IStream.html#a42">00745</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *name) +00746 { +00747 <font class="comment">// XML Mode ?</font> +00748 <font class="keywordflow">if</font> (_XML) +00749 { +00750 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b4">xmlSetAttribInternal</a> (name); +00751 } +00752 +00753 <font class="comment">// Return ok</font> +00754 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00755 } +00756 +<a name="l00762"></a><a class="code" href="classNLMISC_1_1IStream.html#a43">00762</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a43">xmlBreakLine</a> () +00763 { +00764 <font class="comment">// XML Mode ?</font> +00765 <font class="keywordflow">if</font> (_XML) +00766 { +00767 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b5">xmlBreakLineInternal</a> (); +00768 } +00769 +00770 <font class="comment">// Return ok</font> +00771 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00772 } +00773 +<a name="l00779"></a><a class="code" href="classNLMISC_1_1IStream.html#a44">00779</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#a44">xmlComment</a> () +00780 { +00781 <font class="comment">// XML Mode ?</font> +00782 <font class="keywordflow">if</font> (_XML) +00783 { +00784 <font class="keywordflow">return</font> <a class="code" href="classNLMISC_1_1IStream.html#b6">xmlCommentInternal</a> (); +00785 } +00786 +00787 <font class="comment">// Return ok</font> +00788 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00789 } +00790 +00791 <font class="keyword">protected</font>: +00792 +00794 +00798 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#b0">setXMLMode</a> (<font class="keywordtype">bool</font> on); +00799 +<a name="l00801"></a><a class="code" href="classNLMISC_1_1IStream.html#b1">00801</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b1">xmlPushBeginInternal</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *name) { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00802 +<a name="l00804"></a><a class="code" href="classNLMISC_1_1IStream.html#b2">00804</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b2">xmlPushEndInternal</a> () { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00805 +<a name="l00807"></a><a class="code" href="classNLMISC_1_1IStream.html#b3">00807</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b3">xmlPopInternal</a> () { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00808 +<a name="l00810"></a><a class="code" href="classNLMISC_1_1IStream.html#b4">00810</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b4">xmlSetAttribInternal</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *name) { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00811 +<a name="l00813"></a><a class="code" href="classNLMISC_1_1IStream.html#b5">00813</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b5">xmlBreakLineInternal</a> () { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00814 +<a name="l00816"></a><a class="code" href="classNLMISC_1_1IStream.html#b6">00816</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#b6">xmlCommentInternal</a> () { <font class="keywordflow">return</font> <font class="keyword">true</font>; }; +00817 +00823 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#b7">resetPtrTable</a>(); +00824 +00830 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#b8">setInOut</a>(<font class="keywordtype">bool</font> inputStream); +00831 +00832 +00833 <font class="keyword">public</font>: +00835 +00839 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a>(uint8 *buf, uint len) =0; +00840 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#z327_1">serialBit</a>(<font class="keywordtype">bool</font> &bit) =0; +00842 +<a name="l00845"></a><a class="code" href="classNLMISC_1_1IStream.html#a45">00845</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#a45">serialBufferWithSize</a>(uint8 *buf, uint32 len) +00846 { +00847 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (len); +00848 <a class="code" href="classNLMISC_1_1IStream.html#z327_0">serialBuffer</a> (buf, len); +00849 } +00850 +00851 <font class="keyword">private</font>: +<a name="l00852"></a><a class="code" href="classNLMISC_1_1IStream.html#o0">00852</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#o0">_InputStream</a>; +00853 <font class="keyword">static</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#r0">_ThrowOnOlder</a>; +00854 <font class="keyword">static</font> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#r1">_ThrowOnNewer</a>; +00855 +00856 <font class="comment">// Ptr registry. We store 64 bit Id, to be compatible with futur 64+ bits pointers.</font> +<a name="l00857"></a><a class="code" href="classNLMISC_1_1IStream.html#o1">00857</a> std::map<uint64, void*> <a class="code" href="classNLMISC_1_1IStream.html#o1">_IdMap</a>; +<a name="l00858"></a><a class="code" href="classNLMISC_1_1IStream.html#u0">00858</a> <font class="keyword">typedef</font> std::map<uint64, void*>::iterator <a class="code" href="classNLMISC_1_1IStream.html#u0">ItIdMap</a>; +<a name="l00859"></a><a class="code" href="classNLMISC_1_1IStream.html#u1">00859</a> <font class="keyword">typedef</font> std::map<uint64, void*>::value_type <a class="code" href="classNLMISC_1_1IStream.html#u1">ValueIdMap</a>; +00860 +00861 <font class="comment">// Ptr serialisation.</font> +00862 <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c0">serialIStreamable</a>(IStreamable* &ptr) ; +00863 +00864 +00865 +00866 <font class="keyword">private</font>: +00871 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00872"></a><a class="code" href="classNLMISC_1_1IStream.html#c1">00872</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c1">serialSTLContLen</a>(T &cont, sint32 len) +00873 { +00874 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +00875 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +00876 +00877 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00878 { +00879 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +00880 { +00881 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +00882 +00883 __value_type <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>; +00884 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +00885 (void)cont.insert(cont.end(), <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +00886 +00887 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00888 } +00889 } +00890 <font class="keywordflow">else</font> +00891 { +00892 __iterator it= cont.begin(); +00893 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +00894 { +00895 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +00896 +00897 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(const_cast<__value_type&>(*it)); +00898 +00899 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00900 } +00901 } +00902 } +00903 +00904 +00921 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00922"></a><a class="code" href="classNLMISC_1_1IStream.html#c2">00922</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c2">serialSTLCont</a>(T &cont) +00923 { +00924 <font class="comment">// Open a node header</font> +00925 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"CONTAINER"</font>); +00926 +00927 <font class="comment">// Attrib size</font> +00928 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +00929 +00930 sint32 len=0; +00931 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00932 { +00933 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +00934 cont.clear(); +00935 } +00936 <font class="keywordflow">else</font> +00937 { +00938 len= cont.size(); +00939 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +00940 } +00941 +00942 <font class="comment">// Close the header</font> +00943 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00944 +00945 <a class="code" href="classNLMISC_1_1IStream.html#c1">serialSTLContLen</a>(cont, len); +00946 +00947 <font class="comment">// Close the node</font> +00948 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00949 } +00950 +00951 +00952 <font class="keyword">protected</font>: +00953 +00958 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l00959"></a><a class="code" href="classNLMISC_1_1IStream.html#b9">00959</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#b9">serialVector</a>(T &cont) +00960 { +00961 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +00962 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +00963 +00964 <font class="comment">// Open a node header</font> +00965 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"VECTOR"</font>); +00966 +00967 <font class="comment">// Attrib size</font> +00968 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +00969 +00970 sint32 len=0; +00971 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +00972 { +00973 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +00974 +00975 <font class="comment">// Open a node header</font> +00976 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00977 +00978 <font class="comment">// special version for vector: adjut good size.</font> +00979 <a class="code" href="namespaceNLMISC.html#a222">contReset</a>(cont); +00980 cont.resize (len); +00981 +00982 <font class="comment">// Read the vector</font> +00983 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +00984 { +00985 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +00986 +00987 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(cont[i]); +00988 +00989 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +00990 } +00991 } +00992 <font class="keywordflow">else</font> +00993 { +00994 len= cont.size(); +00995 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +00996 +00997 <font class="comment">// Close the node header</font> +00998 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +00999 +01000 <font class="comment">// Write the vector</font> +01001 __iterator it= cont.begin(); +01002 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +01003 { +01004 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +01005 +01006 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(const_cast<__value_type&>(*it)); +01007 +01008 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01009 } +01010 } +01011 +01012 <font class="comment">// Close the node</font> +01013 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01014 } +01015 +01016 +01017 <font class="keyword">private</font>: +01022 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01023"></a><a class="code" href="classNLMISC_1_1IStream.html#c3">01023</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c3">serialSTLContLenPtr</a>(T &cont, sint32 len) +01024 { +01025 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01026 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01027 +01028 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01029 { +01030 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +01031 { +01032 __value_type <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>; +01033 <a class="code" href="classNLMISC_1_1IStream.html#a27">serialPtr</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01034 cont.insert(cont.end(), <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01035 } +01036 } +01037 <font class="keywordflow">else</font> +01038 { +01039 __iterator it= cont.begin(); +01040 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +01041 { +01042 <a class="code" href="classNLMISC_1_1IStream.html#a27">serialPtr</a>(const_cast<__value_type&>(*it)); +01043 } +01044 } +01045 } +01046 +01047 +01052 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01053"></a><a class="code" href="classNLMISC_1_1IStream.html#c4">01053</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c4">serialSTLContPtr</a>(T &cont) +01054 { +01055 <font class="comment">// Open a node header</font> +01056 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"CONTAINER"</font>); +01057 +01058 <font class="comment">// Attrib size</font> +01059 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +01060 +01061 sint32 len=0; +01062 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01063 { +01064 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01065 cont.clear(); +01066 } +01067 <font class="keywordflow">else</font> +01068 { +01069 len= cont.size(); +01070 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01071 } +01072 +01073 <font class="comment">// Close the node header</font> +01074 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01075 +01076 <a class="code" href="classNLMISC_1_1IStream.html#c3">serialSTLContLenPtr</a>(cont, len); +01077 +01078 <font class="comment">// Close the node</font> +01079 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01080 } +01081 +01082 +01087 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01088"></a><a class="code" href="classNLMISC_1_1IStream.html#c5">01088</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c5">serialVectorPtr</a>(T &cont) +01089 { +01090 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01091 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01092 +01093 <font class="comment">// Open a node header</font> +01094 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"VECTOR"</font>); +01095 +01096 <font class="comment">// Attrib size</font> +01097 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +01098 +01099 sint32 len=0; +01100 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01101 { +01102 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01103 <font class="comment">// special version for vector: adjut good size.</font> +01104 <a class="code" href="namespaceNLMISC.html#a222">contReset</a>(cont); +01105 cont.reserve(len); +01106 } +01107 <font class="keywordflow">else</font> +01108 { +01109 len= cont.size(); +01110 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01111 } +01112 +01113 <font class="comment">// Close the node header</font> +01114 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01115 +01116 <a class="code" href="classNLMISC_1_1IStream.html#c3">serialSTLContLenPtr</a>(cont, len); +01117 +01118 <font class="comment">// Close the node</font> +01119 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01120 } +01121 +01122 +01123 <font class="keyword">private</font>: +01128 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01129"></a><a class="code" href="classNLMISC_1_1IStream.html#c6">01129</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c6">serialSTLContLenPolyPtr</a>(T &cont, sint32 len) +01130 { +01131 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01132 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01133 +01134 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01135 { +01136 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +01137 { +01138 __value_type <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>=NULL; +01139 <a class="code" href="classNLMISC_1_1IStream.html#a28">serialPolyPtr</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01140 cont.insert(cont.end(), <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01141 } +01142 } +01143 <font class="keywordflow">else</font> +01144 { +01145 __iterator it= cont.begin(); +01146 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +01147 { +01148 <a class="code" href="classNLMISC_1_1IStream.html#a28">serialPolyPtr</a>(const_cast<__value_type&>(*it)); +01149 } +01150 } +01151 } +01152 +01153 +01158 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01159"></a><a class="code" href="classNLMISC_1_1IStream.html#c7">01159</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c7">serialSTLContPolyPtr</a>(T &cont) +01160 { +01161 sint32 len=0; +01162 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01163 { +01164 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01165 cont.clear(); +01166 } +01167 <font class="keywordflow">else</font> +01168 { +01169 len= cont.size(); +01170 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01171 } +01172 +01173 <a class="code" href="classNLMISC_1_1IStream.html#c6">serialSTLContLenPolyPtr</a>(cont, len); +01174 } +01175 +01176 +01181 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01182"></a><a class="code" href="classNLMISC_1_1IStream.html#c8">01182</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c8">serialVectorPolyPtr</a>(T &cont) +01183 { +01184 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01185 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01186 +01187 <font class="comment">// Open a node header</font> +01188 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"VECTOR"</font>); +01189 +01190 <font class="comment">// Attrib size</font> +01191 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +01192 +01193 sint32 len=0; +01194 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01195 { +01196 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01197 <font class="comment">// special version for vector: adjut good size.</font> +01198 <a class="code" href="namespaceNLMISC.html#a222">contReset</a>(cont); +01199 cont.reserve(len); +01200 } +01201 <font class="keywordflow">else</font> +01202 { +01203 len= cont.size(); +01204 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01205 } +01206 +01207 <font class="comment">// Close the node header</font> +01208 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01209 +01210 <a class="code" href="classNLMISC_1_1IStream.html#c6">serialSTLContLenPolyPtr</a>(cont, len); +01211 +01212 <font class="comment">// Close the node</font> +01213 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01214 } +01215 +01216 +01217 +01218 <font class="keyword">private</font>: +01219 +01237 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01238"></a><a class="code" href="classNLMISC_1_1IStream.html#c9">01238</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c9">serialMultimap</a>(T &cont) +01239 { +01240 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01241 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::key_type __key_type; +01242 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01243 +01244 <font class="comment">// Open a node header</font> +01245 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"MULTIMAP"</font>); +01246 +01247 <font class="comment">// Attrib size</font> +01248 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +01249 +01250 sint32 len; +01251 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01252 { +01253 cont.clear(); +01254 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01255 +01256 <font class="comment">// Close the node header</font> +01257 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01258 +01259 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +01260 { +01261 __value_type <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>; +01262 +01263 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"KEY"</font>); +01264 +01265 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> ( const_cast<__key_type&>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>.first) ); +01266 +01267 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01268 +01269 +01270 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +01271 +01272 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>.second); +01273 +01274 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01275 +01276 cont.insert(cont.end(), <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01277 } +01278 } +01279 <font class="keywordflow">else</font> +01280 { +01281 len= cont.size(); +01282 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01283 __iterator it= cont.begin(); +01284 +01285 <font class="comment">// Close the node header</font> +01286 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01287 +01288 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +01289 { +01290 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"KEY"</font>); +01291 +01292 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( const_cast<__key_type&>((*it).first) ); +01293 +01294 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01295 +01296 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +01297 +01298 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>((*it).second); +01299 +01300 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01301 } +01302 } +01303 +01304 <font class="comment">// Close the node</font> +01305 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01306 } +01307 +01308 +01326 <font class="keyword">template</font><<font class="keyword">class</font> T> +<a name="l01327"></a><a class="code" href="classNLMISC_1_1IStream.html#c10">01327</a> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStream.html#c10">serialMap</a>(T &cont) +01328 { +01329 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::value_type __value_type; +01330 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::key_type __key_type; +01331 <font class="keyword">typedef</font> <font class="keyword">typename</font> T::iterator __iterator; +01332 +01333 <font class="comment">// Open a node header</font> +01334 <a class="code" href="classNLMISC_1_1IStream.html#a39">xmlPushBegin</a> (<font class="stringliteral">"MAP"</font>); +01335 +01336 <font class="comment">// Attrib size</font> +01337 <a class="code" href="classNLMISC_1_1IStream.html#a42">xmlSetAttrib</a> (<font class="stringliteral">"size"</font>); +01338 +01339 sint32 len; +01340 <font class="keywordflow">if</font>(<a class="code" href="classNLMISC_1_1IStream.html#a4">isReading</a>()) +01341 { +01342 cont.clear(); +01343 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01344 +01345 <font class="comment">// Close the node header</font> +01346 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01347 +01348 <font class="keywordflow">for</font>(sint i=0;i<len;i++) +01349 { +01350 <font class="comment">/* __value_type v;</font> +01351 <font class="comment"></font> +01352 <font class="comment"> xmlPush ("KEY");</font> +01353 <font class="comment"></font> +01354 <font class="comment"> serial ( const_cast<__key_type&>(v.first) );</font> +01355 <font class="comment"></font> +01356 <font class="comment"> xmlPop ();</font> +01357 <font class="comment"></font> +01358 <font class="comment"></font> +01359 <font class="comment"> xmlPush ("ELM");</font> +01360 <font class="comment"></font> +01361 <font class="comment"> serial (v.second);</font> +01362 <font class="comment"></font> +01363 <font class="comment"> xmlPop ();</font> +01364 <font class="comment"></font> +01365 <font class="comment"> cont.insert(cont.end(), v);</font> +01366 <font class="comment">*/</font> +01367 <font class="comment">// MALKAV 05/07/02 : prevent a copy of the value, copy the key instead</font> +01368 __key_type k; +01369 +01370 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"KEY"</font>); +01371 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> ( k ); +01372 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01373 +01374 +01375 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +01376 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a> (cont[k]); +01377 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01378 } +01379 } +01380 <font class="keywordflow">else</font> +01381 { +01382 len= cont.size(); +01383 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>(len); +01384 __iterator it= cont.begin(); +01385 +01386 <font class="comment">// Close the node header</font> +01387 <a class="code" href="classNLMISC_1_1IStream.html#a40">xmlPushEnd</a> (); +01388 +01389 <font class="keywordflow">for</font>(sint i=0;i<len;i++, it++) +01390 { +01391 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"KEY"</font>); +01392 +01393 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( const_cast<__key_type&>((*it).first) ); +01394 +01395 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01396 +01397 <a class="code" href="classNLMISC_1_1IStream.html#a38">xmlPush</a> (<font class="stringliteral">"ELM"</font>); +01398 +01399 <a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>((*it).second); +01400 +01401 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01402 } +01403 } +01404 +01405 <font class="comment">// Close the node</font> +01406 <a class="code" href="classNLMISC_1_1IStream.html#a41">xmlPop</a> (); +01407 } +01408 +01409 <font class="comment">// Mode XML</font> +<a name="l01410"></a><a class="code" href="classNLMISC_1_1IStream.html#o2">01410</a> <font class="keywordtype">bool</font> <a class="code" href="classNLMISC_1_1IStream.html#o2">_XML</a>; +01411 }; +01412 +01413 +01414 <font class="comment">// ======================================================================================================</font> +01415 <font class="comment">// ======================================================================================================</font> +01416 <font class="comment">// Handle for streaming Polymorphic classes.</font> +01417 <font class="comment">// ======================================================================================================</font> +01418 <font class="comment">// ======================================================================================================</font> +01419 +01420 +01421 <font class="comment">// ======================================================================================================</font> +<a name="l01430"></a><a class="code" href="classNLMISC_1_1IStreamable.html">01430</a> <font class="comment"></font><font class="keyword">class </font>IStreamable : <font class="keyword">public</font> IClassable +01431 { +01432 <font class="keyword">public</font>: +01433 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNLMISC_1_1IStreamable.html#a0">serial</a>(IStream &f) =0; +01434 }; +01435 +01436 +01437 } <font class="comment">// NLMISC.</font> +01438 +01439 +01440 <font class="comment">// Inline Implementation.</font> +01441 <font class="preprocessor">#include "<a class="code" href="stream__inline_8h.html">nel/misc/stream_inline.h</a>"</font> +01442 +01443 +01444 <font class="preprocessor">#endif // NL_STREAM_H</font> +01445 <font class="preprocessor"></font> +01446 <font class="comment">/* End of stream.h */</font> +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |