diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/agent__string_8cpp-source.html | 372 |
1 files changed, 372 insertions, 0 deletions
diff --git a/docs/doxygen/nel/agent__string_8cpp-source.html b/docs/doxygen/nel/agent__string_8cpp-source.html new file mode 100644 index 00000000..263c7f5d --- /dev/null +++ b/docs/doxygen/nel/agent__string_8cpp-source.html @@ -0,0 +1,372 @@ +<!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>agent_string.cpp</h1><a href="agent__string_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00006 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00007 <font class="comment"> *</font> +00008 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00009 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00010 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00011 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00012 <font class="comment"> * any later version.</font> +00013 <font class="comment"></font> +00014 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00015 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00016 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00017 <font class="comment"> * General Public License for more details.</font> +00018 <font class="comment"></font> +00019 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00020 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00021 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00022 <font class="comment"> * MA 02111-1307, USA.</font> +00023 <font class="comment"> */</font> +00024 <font class="preprocessor">#include "<a class="code" href="agent_8h.html">nel/ai/agent/agent.h</a>"</font> +00025 +00026 <font class="keyword">namespace </font>NLAIAGENT +00027 { +<a name="l00028"></a><a class="code" href="classNLAIAGENT_1_1CStringVarName.html#a5">00028</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CStringVarName::getType()<font class="keyword"> const</font> +00029 <font class="keyword"> </font>{ +00030 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html#p0">IdStringVarName</a>; +00031 } +00032 +<a name="l00033"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a5">00033</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CIndexedVarName::getType()<font class="keyword"> const</font> +00034 <font class="keyword"> </font>{ +00035 +00036 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#p0">IdIndexedVarName</a>; +00037 } +00038 +<a name="l00039"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#d0">00039</a> <font class="keywordtype">void</font> CIndexedVarName::initClass() +00040 { +00041 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a> == NULL) +00042 { +00043 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a> = <font class="keyword">new</font> <a class="code" href="classstd_1_1list.html">std::list<CIndexedVarName::CNameStruc *></a>; +00044 +00045 } +00046 +00047 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a> == NULL) +00048 { +00049 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a> = <font class="keyword">new</font> CIndexedVarName::tMapName; +00050 } +00051 +00052 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> != NULL) +00053 { +00054 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->clear(); +00055 <font class="keywordflow">for</font>(sint32 i =0; i < <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>; i++) +00056 { +00057 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> != NULL) <font class="keyword">delete</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a>; +00058 } +00059 <font class="keyword">delete</font> [] <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>; +00060 } +00061 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> = <font class="keyword">new</font> CNameStruc [<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r2">_Bank</a>]; +00062 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a> = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r2">_Bank</a>; +00063 +00064 <font class="keywordflow">for</font>(sint32 i = 0; i < <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>; i++) +00065 { +00066 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> = NULL; +00067 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m0">Count</a> = 0; +00068 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m1">Index</a> = i; +00069 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->push_back(&<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i]); +00070 } +00071 +00072 } +00073 +<a name="l00074"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#d1">00074</a> <font class="keywordtype">void</font> CIndexedVarName::saveClass(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os) +00075 { +00076 sint32 count = (sint32) <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>; +00077 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( count ); +00078 <font class="keywordflow">for</font>(sint32 i = 0; i < count; i++) +00079 { +00080 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> != NULL) +00081 { +00082 sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> = 1; +00083 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> ); +00084 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#a4">save</a>(os); +00085 } +00086 <font class="keywordflow">else</font> +00087 { +00088 sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> = 0; +00089 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> ); +00090 } +00091 } +00092 +00093 } +00094 +<a name="l00095"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#d2">00095</a> <font class="keywordtype">void</font> CIndexedVarName::loadClass(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) +00096 { +00097 sint32 i; +00098 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( i ); +00099 <font class="keywordflow">if</font>(i != 0) +00100 { +00101 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#d3">releaseClass</a>(); +00102 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> = <font class="keyword">new</font> CNameStruc [i]; +00103 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a> = i; +00104 sint32 k; +00105 <font class="keywordflow">for</font>(i = 0;i < <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>;i ++) +00106 { +00107 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( k ); +00108 <font class="keywordflow">if</font>(k) +00109 { +00110 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#a5">load</a>(is); +00111 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->insert(tMapName::value_type(*<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].Name, &<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i])); +00112 } +00113 <font class="keywordflow">else</font> +00114 { +00115 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m0">Count</a> = 0; +00116 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m1">Index</a> = i; +00117 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> = NULL; +00118 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->push_back(&<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i]); +00119 } +00120 } +00121 } +00122 +00123 } +00124 +<a name="l00125"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#d3">00125</a> <font class="keywordtype">void</font> CIndexedVarName::releaseClass() +00126 { +00127 <font class="keywordflow">return</font>; +00128 +00129 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> != NULL) +00130 { +00131 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->clear(); +00132 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->clear(); +00133 <font class="keywordflow">for</font>(sint32 i =0; i < <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>; i++) +00134 { +00135 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> != NULL) <font class="keyword">delete</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a>; +00136 } +00137 <font class="keyword">delete</font> [] <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>; +00138 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> = NULL; +00139 } +00140 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a> != NULL) +00141 { +00142 <font class="keyword">delete</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>; +00143 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a> = NULL; +00144 } +00145 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a> != NULL) +00146 { +00147 <font class="keyword">delete</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>; +00148 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a> = NULL; +00149 } +00150 } +00151 +<a name="l00152"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a0">00152</a> CIndexedVarName::CIndexedVarName(<font class="keyword">const</font> <font class="keywordtype">char</font> *name) +00153 { +00154 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(CStringVarName(name)); +00155 } +00156 +<a name="l00157"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a1">00157</a> CIndexedVarName::CIndexedVarName(<font class="keyword">const</font> CIndexedVarName &name) +00158 { +00159 tMapName::iterator i = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->find(*<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[name.getIndex()].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a>); +00160 <font class="keywordflow">if</font>(i != <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->end()) +00161 { +00162 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a> = name.getIndex(); +00163 (*i).second->Count ++; +00164 } +00165 <font class="keywordflow">else</font> +00166 { +00167 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a> = -1; +00168 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>(); +00169 } +00170 +00171 } +00172 +<a name="l00173"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a2">00173</a> CIndexedVarName::CIndexedVarName(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) +00174 { +00175 CStringVarName str(is); +00176 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(str); +00177 } +00178 +<a name="l00179"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a15">00179</a> CIndexedVarName::~CIndexedVarName() +00180 { +00181 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c1">clear</a>(); +00182 } +00183 +<a name="l00184"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a9">00184</a> IVarName &CIndexedVarName::operator = (<font class="keyword">const</font> IVarName &<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>) +00185 { +00186 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(CStringVarName(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getString())); +00187 <font class="keywordflow">return</font> *<font class="keyword">this</font>; +00188 } +00189 +<a name="l00190"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c1">00190</a> <font class="keywordtype">void</font> CIndexedVarName::clear() +00191 { +00192 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> && !(--<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Count) ) +00193 { +00194 tMapName::iterator i = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->find(*<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Name); +00195 <font class="keywordflow">if</font>(i != <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->end()) +00196 { +00197 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->erase(i); +00198 <font class="keyword">delete</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Name; +00199 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Name = NULL; +00200 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->push_back(&<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>]); +00201 } +00202 } +00203 } +00204 +00205 +<a name="l00206"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">00206</a> <font class="keywordtype">void</font> CIndexedVarName::insert(<font class="keyword">const</font> CStringVarName &str) +00207 { +00208 tMapName::iterator i = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->find(str); +00209 <font class="keywordflow">if</font>(i != <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->end()) +00210 { +00211 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a> = (*i).second->Index; +00212 (*i).second->Count ++; +00213 } +00214 <font class="keywordflow">else</font> +00215 { +00216 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a> = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a3">newIndex</a>(); +00217 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Name = (CStringVarName *)str.clone(); +00218 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r0">_Map</a>->insert(tMapName::value_type(*<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>].Name, &<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>])); +00219 } +00220 } +00221 +00222 +00223 +<a name="l00224"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a7">00224</a> IVarName &CIndexedVarName::operator += (<font class="keyword">const</font> IVarName &<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>) +00225 { +00226 <font class="keywordtype">char</font> *n = (<font class="keywordtype">char</font> *)<a class="code" href="classNLAIAGENT_1_1IVarName.html#a2">addString</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>); +00227 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(n); +00228 <font class="keywordflow">return</font> *<font class="keyword">this</font>; +00229 } +00230 +<a name="l00231"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a8">00231</a> IVarName &CIndexedVarName::operator -= (<font class="keyword">const</font> IVarName &<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>) +00232 { +00233 <font class="keywordtype">char</font> *n = (<font class="keywordtype">char</font> *)<a class="code" href="classNLAIAGENT_1_1IVarName.html#a3">subString</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>); +00234 <font class="keywordflow">if</font>(n != NULL) <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(n); +00235 <font class="keywordflow">return</font> *<font class="keyword">this</font>; +00236 } +00237 +00238 +<a name="l00239"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a3">00239</a> sint32 CIndexedVarName::newIndex() +00240 { +00241 +00242 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->size()) +00243 { +00244 CNameStruc *o = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->front(); +00245 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->pop_front(); +00246 o->Count++; +00247 <font class="keywordflow">return</font> o->Index; +00248 } +00249 <font class="keywordflow">else</font> +00250 { +00251 CNameStruc *tmp = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>; +00252 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> = <font class="keyword">new</font> CNameStruc [<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a> + <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r2">_Bank</a>]; +00253 +00254 <font class="keywordflow">for</font>(sint32 i = <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>; i < (<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a> + <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r2">_Bank</a>); i++) +00255 { +00256 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m0">Count</a> = 0; +00257 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m1">Index</a> = i; +00258 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i].<a class="code" href="structNLAIAGENT_1_1CIndexedVarName_1_1CNameStruc.html#m2">Name</a> = NULL; +00259 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r4">_Empty</a>->push_back(&<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[i]); +00260 } +00261 +00262 memcpy(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>, tmp, <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a>*<font class="keyword">sizeof</font>(CNameStruc)); +00263 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r3">_Count</a> += <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r2">_Bank</a>; +00264 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a3">newIndex</a>(); +00265 } +00266 } +00267 +<a name="l00268"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a10">00268</a> <font class="keywordtype">void</font> CIndexedVarName::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os) +00269 { +00270 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( *<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a>[<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a6">getIndex</a>()].Name ); +00271 } +00272 +<a name="l00273"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a11">00273</a> <font class="keywordtype">void</font> CIndexedVarName::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) +00274 { +00275 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c1">clear</a>(); +00276 CStringVarName str(is); +00277 <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#c0">insert</a>(str); +00278 } +00279 +<a name="l00280"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a12">00280</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CIndexedVarName::clone()<font class="keyword"> const</font> +00281 <font class="keyword"> </font>{ +00282 <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a0">CIndexedVarName</a>(*<font class="keyword">this</font>); +00283 <font class="keywordflow">return</font> x; +00284 } +00285 +<a name="l00286"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a13">00286</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CIndexedVarName::newInstance()<font class="keyword"> const</font> +00287 <font class="keyword"> </font>{ +00288 <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a0">CIndexedVarName</a>(<font class="stringliteral">"Inst"</font>); +00289 <font class="keywordflow">return</font> x; +00290 } +00291 +<a name="l00292"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a14">00292</a> <font class="keywordtype">void</font> CIndexedVarName::getDebugString(std::string &text)<font class="keyword"> const</font> +00293 <font class="keyword"> </font>{ +00294 +00295 } +00296 +<a name="l00297"></a><a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#a4">00297</a> <font class="keyword">const</font> <font class="keywordtype">char</font> *CIndexedVarName::getString()<font class="keyword"> const</font> +00298 <font class="keyword"> </font>{ +00299 <font class="keywordflow">return</font> (*(<a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#r1">_TableName</a> + <a class="code" href="classNLAIAGENT_1_1CIndexedVarName.html#o0">_Index</a>)).Name->getString(); +00300 <font class="comment">//return _TableName[_Index].Name->getString();</font> +00301 } +00302 } +</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> |