diff options
Diffstat (limited to 'docs/doxygen/nel/a03449.html')
-rw-r--r-- | docs/doxygen/nel/a03449.html | 825 |
1 files changed, 825 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03449.html b/docs/doxygen/nel/a03449.html new file mode 100644 index 00000000..6267c957 --- /dev/null +++ b/docs/doxygen/nel/a03449.html @@ -0,0 +1,825 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLMISC::CStringIdArray class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.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">Data Structures</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">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CStringIdArray Class Reference</h1><code>#include <<a class="el" href="a06468.html">string_id_array.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +The goal of this class is to associate number and string. It is used in the CCallbackNetBase for message id<->string associations. <dl compact><dt><b>Author:</b></dt><dd>Vianney Lecroart <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00050">50</a> of file <a class="el" href="a06468.html">string_id_array.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="a04558.html#a8">sint16</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a></td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya0">addString</a> (const std::string &str)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a string in the string at the end of the array. <a href="#NLMISC_1_1CStringIdArraya0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya1">addString</a> (const std::string &str, <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> <a class="el" href="a04223.html#a564">id</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a string in the string in the array. <a href="#NLMISC_1_1CStringIdArraya1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya2">clear</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Clears the string id array. <a href="#NLMISC_1_1CStringIdArraya2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya3">CStringIdArray</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya4">display</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Displays all association of the array in a C style (useful to copy/paste in your C code). <a href="#NLMISC_1_1CStringIdArraya4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::set< std::string > & </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya5">getAskedStringArray</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns all string in the _AskedStringArray. <a href="#NLMISC_1_1CStringIdArraya5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya6">getId</a> (const std::string &str, bool IgnoreIfUnknown=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::set< std::string > & </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya7">getNeedToAskedStringArray</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns all string in the _NeedToAskStringArray. <a href="#NLMISC_1_1CStringIdArraya7"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya8">getString</a> (<a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> <a class="el" href="a04223.html#a564">id</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the string associated to this id. <a href="#NLMISC_1_1CStringIdArraya8"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya9">ignoreAllUnknownId</a> (bool b)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If set to true, when we ask a string with no id, we don't put it in the _NeedToAskStringArray array. <a href="#NLMISC_1_1CStringIdArraya9"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya10">moveNeedToAskToAskedStringArray</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Moves string from _NeedToAskStringArray to _AskedStringArray. <a href="#NLMISC_1_1CStringIdArraya10"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya11">resize</a> (<a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the size of the _StringArray. <a href="#NLMISC_1_1CStringIdArraya11"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArraya12">size</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the size of the _StringArray. <a href="#NLMISC_1_1CStringIdArraya12"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::set< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::set< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NLMISC_1_1CStringIdArrayw0" doxytag="NLMISC::CStringIdArray::TStringId" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef <a class="el" href="a04558.html#a8">sint16</a> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">NLMISC::CStringIdArray::TStringId</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00054">54</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +Referenced by <a class="el" href="a06645.html#l01188">NLNET::CUnifiedNetwork::addCallbackArray()</a>, <a class="el" href="a06098.html#l00346">NLNET::CNetManager::addCallbackArray()</a>, <a class="el" href="a05526.html#l00184">NLNET::CCallbackNetBase::addCallbackArray()</a>, <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a05526.html#l00328">NLNET::CCallbackNetBase::baseUpdate()</a>, <a class="el" href="a05526.html#l00088">NLNET::cbnbMessageAskAssociations()</a>, <a class="el" href="a05526.html#l00055">NLNET::cbnbMessageRecvAssociations()</a>, <a class="el" href="a06468.html#l00089">getId()</a>, <a class="el" href="a06026.html#l00432">NLNET::CMessage::getId()</a>, <a class="el" href="a06468.html#l00131">getString()</a>, <a class="el" href="a05526.html#l00223">NLNET::CCallbackNetBase::processOneMessage()</a>, <a class="el" href="a06026.html#l00319">NLNET::CMessage::readType()</a>, <a class="el" href="a06468.html#l00142">resize()</a>, <a class="el" href="a05528.html#l00091">NLNET::CCallbackServer::sendAllMyAssociations()</a>, <a class="el" href="a05526.html#l00451">NLNET::CCallbackNetBase::setOtherSideAssociations()</a>, <a class="el" href="a06026.html#l00173">NLNET::CMessage::setType()</a>, and <a class="el" href="a06468.html#l00148">size()</a>. </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CStringIdArraya3" doxytag="NLMISC::CStringIdArray::CStringIdArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CStringIdArray::CStringIdArray </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00056">56</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00199">_IgnoreAllUnknownId</a>. +<p> +<div class="fragment"><pre>00056 : <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a>(<span class="keyword">false</span>) { } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CStringIdArraya0" doxytag="NLMISC::CStringIdArray::addString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::addString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>str</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Adds a string in the string at the end of the array. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00077">77</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +<div class="fragment"><pre>00078 { +00079 <a class="code" href="a04199.html#a6">nlassert</a> (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size () < pow(2, <span class="keyword">sizeof</span> (TStringId)*8)); +00080 <a class="code" href="a04199.html#a6">nlassert</a> (!str.empty()); +00081 +00082 <span class="comment">// add at the end</span> +00083 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArraya1">addString</a> (str, <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size ()); +00084 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya1" doxytag="NLMISC::CStringIdArray::addString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::addString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> </td> + <td class="mdname" nowrap> <em>id</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Adds a string in the string in the array. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00059">59</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00205">_AskedStringArray</a>, <a class="el" href="a06468.html#l00199">_IgnoreAllUnknownId</a>, <a class="el" href="a06468.html#l00203">_NeedToAskStringArray</a>, <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00184">NLNET::CCallbackNetBase::addCallbackArray()</a>, <a class="el" href="a06468.html#l00077">addString()</a>, <a class="el" href="a05526.html#l00055">NLNET::cbnbMessageRecvAssociations()</a>, and <a class="el" href="a05526.html#l00451">NLNET::CCallbackNetBase::setOtherSideAssociations()</a>. +<p> +<div class="fragment"><pre>00060 { +00061 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keywordtype">id</span> >= 0 && <span class="keywordtype">id</span> < pow(2, <span class="keyword">sizeof</span> (TStringId)*8)); +00062 <a class="code" href="a04199.html#a6">nlassert</a> (!str.empty()); +00063 +00064 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> >= (<a class="code" href="a04558.html#a10">sint32</a>) <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size()) +00065 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.resize(<span class="keywordtype">id</span>+1); +00066 +00067 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>[<span class="keywordtype">id</span>] = str; +00068 +00069 <span class="keywordflow">if</span> (!<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a>) +00070 { +00071 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>.erase (str); +00072 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.erase (str); +00073 } +00074 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya2" doxytag="NLMISC::CStringIdArray::clear" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::clear </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Clears the string id array. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00179">179</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00205">_AskedStringArray</a>, <a class="el" href="a06468.html#l00203">_NeedToAskStringArray</a>, and <a class="el" href="a06468.html#l00201">_StringArray</a>. +<p> +<div class="fragment"><pre>00180 { +00181 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.clear (); +00182 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.clear (); +00183 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>.clear (); +00184 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya4" doxytag="NLMISC::CStringIdArray::display" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::display </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Displays all association of the array in a C style (useful to copy/paste in your C code). +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00187">187</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a05622.html#l00111">nlinfo</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00464">NLNET::CCallbackNetBase::displayAllMyAssociations()</a>. +<p> +<div class="fragment"><pre>00188 { +00189 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"static const char *OtherSideAssociations[] = {"</span>); +00190 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i = 0; i < <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size(); i++) +00191 { +00192 <a class="code" href="a04199.html#a1">nlinfo</a>(<span class="stringliteral">" \"%s\","</span>, _StringArray[i].c_str()); +00193 } +00194 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"};"</span>); +00195 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya5" doxytag="NLMISC::CStringIdArray::getAskedStringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const std::set<std::string>& NLMISC::CStringIdArray::getAskedStringArray </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns all string in the _AskedStringArray. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00160">160</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00205">_AskedStringArray</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00328">NLNET::CCallbackNetBase::baseUpdate()</a>. +<p> +<div class="fragment"><pre>00161 { +00162 <span class="keywordflow">return</span> <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>; +00163 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya6" doxytag="NLMISC::CStringIdArray::getId" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> NLMISC::CStringIdArray::getId </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>str</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>IgnoreIfUnknown</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the id associated to string str. If the id is not found, the string will be added in _NeedToAskStringArray if ignoreAllUnknownId is false and IgnoreIfUnknown is false too. +<p> +Definition at line <a class="el" href="a06468.html#l00089">89</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00205">_AskedStringArray</a>, <a class="el" href="a06468.html#l00199">_IgnoreAllUnknownId</a>, <a class="el" href="a06468.html#l00203">_NeedToAskStringArray</a>, <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00088">NLNET::cbnbMessageAskAssociations()</a>, and <a class="el" href="a06026.html#l00441">NLNET::CMessage::toString()</a>. +<p> +<div class="fragment"><pre>00090 { +00091 <a class="code" href="a04199.html#a6">nlassert</a> (!str.empty()); +00092 +00093 <span class="comment">// sorry for this bullshit but it's the simplest way ;)</span> +00094 <span class="keywordflow">if</span> (<span class="keyword">this</span> == NULL) <span class="keywordflow">return</span> -1; +00095 +00096 <span class="keywordflow">for</span> (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> i = 0; i < (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a>) <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size(); i++) +00097 { +00098 <span class="keywordflow">if</span> (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>[i] == str) +00099 <span class="keywordflow">return</span> i; +00100 } +00101 +00102 <span class="keywordflow">if</span> (!<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a> && !IgnoreIfUnknown) +00103 { +00104 <span class="comment">// the string is not found, add it to the _AskedStringArray if necessary</span> +00105 <span class="keywordflow">if</span> (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.find (str) == <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.end ()) +00106 { +00107 <span class="keywordflow">if</span> (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>.find (str) == <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>.end ()) +00108 { +00109 <span class="comment">//nldebug ("String '%s' not found, add it to _NeedToAskStringArray", str.c_str ()); </span> +00110 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.insert (str); +00111 } +00112 <span class="keywordflow">else</span> +00113 { +00114 <span class="comment">//nldebug ("Found '%s' in the _AskedStringArray", str.c_str ()); </span> +00115 } +00116 } +00117 <span class="keywordflow">else</span> +00118 { +00119 <span class="comment">//nldebug ("Found '%s' in the _NeedToAskStringArray", str.c_str ()); </span> +00120 } +00121 } +00122 <span class="keywordflow">else</span> +00123 { +00124 <span class="comment">//nldebug ("Ignoring unknown association ('%s')", str.c_str ()); </span> +00125 } +00126 +00127 <span class="keywordflow">return</span> -1; +00128 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya7" doxytag="NLMISC::CStringIdArray::getNeedToAskedStringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const std::set<std::string>& NLMISC::CStringIdArray::getNeedToAskedStringArray </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns all string in the _NeedToAskStringArray. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00154">154</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00203">_NeedToAskStringArray</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00328">NLNET::CCallbackNetBase::baseUpdate()</a>. +<p> +<div class="fragment"><pre>00155 { +00156 <span class="keywordflow">return</span> <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>; +00157 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya8" doxytag="NLMISC::CStringIdArray::getString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string NLMISC::CStringIdArray::getString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> </td> + <td class="mdname1" valign="top" nowrap> <em>id</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the string associated to this id. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00131">131</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +Referenced by <a class="el" href="a05528.html#l00091">NLNET::CCallbackServer::sendAllMyAssociations()</a>, <a class="el" href="a06026.html#l00173">NLNET::CMessage::setType()</a>, and <a class="el" href="a06026.html#l00441">NLNET::CMessage::toString()</a>. +<p> +<div class="fragment"><pre>00132 { +00133 <span class="comment">// sorry for this bullshit but it's the simplest way ;)</span> +00134 <span class="keywordflow">if</span> (<span class="keyword">this</span> == NULL) <span class="keywordflow">return</span> <span class="stringliteral">"<NoSIDA>"</span>; +00135 +00136 <a class="code" href="a04199.html#a6">nlassert</a> (<span class="keywordtype">id</span> >= 0 && <span class="keywordtype">id</span> < (TStringId)<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size()); +00137 +00138 <span class="keywordflow">return</span> <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>[<span class="keywordtype">id</span>]; +00139 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya9" doxytag="NLMISC::CStringIdArray::ignoreAllUnknownId" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::ignoreAllUnknownId </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>b</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +If set to true, when we ask a string with no id, we don't put it in the _NeedToAskStringArray array. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00176">176</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00199">_IgnoreAllUnknownId</a>. +<p> +Referenced by <a class="el" href="a05524.html#l00043">NLNET::cbcMessageRecvAllAssociations()</a>, <a class="el" href="a05524.html#l00059">NLNET::CCallbackClient::CCallbackClient()</a>, and <a class="el" href="a05527.html#l00157">NLNET::CCallbackNetBase::ignoreAllUnknownId()</a>. +<p> +<div class="fragment"><pre>00176 { <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a> = b; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya10" doxytag="NLMISC::CStringIdArray::moveNeedToAskToAskedStringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::moveNeedToAskToAskedStringArray </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Moves string from _NeedToAskStringArray to _AskedStringArray. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00166">166</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00205">_AskedStringArray</a>, <a class="el" href="a06468.html#l00199">_IgnoreAllUnknownId</a>, and <a class="el" href="a06468.html#l00203">_NeedToAskStringArray</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00328">NLNET::CCallbackNetBase::baseUpdate()</a>. +<p> +<div class="fragment"><pre>00167 { +00168 <span class="keywordflow">if</span> (!<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr1">_IgnoreAllUnknownId</a>) +00169 { +00170 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr0">_AskedStringArray</a>.insert (<a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.begin(), <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.end()); +00171 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr2">_NeedToAskStringArray</a>.clear (); +00172 } +00173 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya11" doxytag="NLMISC::CStringIdArray::resize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CStringIdArray::resize </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> </td> + <td class="mdname1" valign="top" nowrap> <em>size</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Set the size of the _StringArray. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00142">142</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00201">_StringArray</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00184">NLNET::CCallbackNetBase::addCallbackArray()</a>. +<p> +<div class="fragment"><pre>00143 { +00144 <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.resize (size); +00145 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArraya12" doxytag="NLMISC::CStringIdArray::size" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayw0">TStringId</a> NLMISC::CStringIdArray::size </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns the size of the _StringArray. +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00148">148</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +References <a class="el" href="a06468.html#l00201">_StringArray</a>, and <a class="el" href="a06468.html#l00054">TStringId</a>. +<p> +Referenced by <a class="el" href="a05526.html#l00184">NLNET::CCallbackNetBase::addCallbackArray()</a>, and <a class="el" href="a05528.html#l00091">NLNET::CCallbackServer::sendAllMyAssociations()</a>. +<p> +<div class="fragment"><pre>00149 { +00150 <span class="keywordflow">return</span> <a class="code" href="a03449.html#NLMISC_1_1CStringIdArrayr3">_StringArray</a>.size (); +00151 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CStringIdArrayr0" doxytag="NLMISC::CStringIdArray::_AskedStringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::set<std::string> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr0">NLMISC::CStringIdArray::_AskedStringArray</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00205">205</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +Referenced by <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a06468.html#l00179">clear()</a>, <a class="el" href="a06468.html#l00160">getAskedStringArray()</a>, <a class="el" href="a06468.html#l00089">getId()</a>, and <a class="el" href="a06468.html#l00166">moveNeedToAskToAskedStringArray()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArrayr1" doxytag="NLMISC::CStringIdArray::_IgnoreAllUnknownId" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr1">NLMISC::CStringIdArray::_IgnoreAllUnknownId</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00199">199</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +Referenced by <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a06468.html#l00056">CStringIdArray()</a>, <a class="el" href="a06468.html#l00089">getId()</a>, <a class="el" href="a06468.html#l00176">ignoreAllUnknownId()</a>, and <a class="el" href="a06468.html#l00166">moveNeedToAskToAskedStringArray()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArrayr2" doxytag="NLMISC::CStringIdArray::_NeedToAskStringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::set<std::string> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr2">NLMISC::CStringIdArray::_NeedToAskStringArray</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00203">203</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +Referenced by <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a06468.html#l00179">clear()</a>, <a class="el" href="a06468.html#l00089">getId()</a>, <a class="el" href="a06468.html#l00154">getNeedToAskedStringArray()</a>, and <a class="el" href="a06468.html#l00166">moveNeedToAskToAskedStringArray()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CStringIdArrayr3" doxytag="NLMISC::CStringIdArray::_StringArray" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<std::string> <a class="el" href="a03449.html#NLMISC_1_1CStringIdArrayr3">NLMISC::CStringIdArray::_StringArray</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06468.html#l00201">201</a> of file <a class="el" href="a06468.html">string_id_array.h</a>. +<p> +Referenced by <a class="el" href="a06468.html#l00059">addString()</a>, <a class="el" href="a06468.html#l00179">clear()</a>, <a class="el" href="a06468.html#l00187">display()</a>, <a class="el" href="a06468.html#l00089">getId()</a>, <a class="el" href="a06468.html#l00131">getString()</a>, <a class="el" href="a06468.html#l00142">resize()</a>, and <a class="el" href="a06468.html#l00148">size()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="a06468.html">string_id_array.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:35:36 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |