diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/logic__condition_8cpp-source.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/logic__condition_8cpp-source.html')
-rw-r--r-- | docs/doxygen/nel/logic__condition_8cpp-source.html | 704 |
1 files changed, 704 insertions, 0 deletions
diff --git a/docs/doxygen/nel/logic__condition_8cpp-source.html b/docs/doxygen/nel/logic__condition_8cpp-source.html new file mode 100644 index 00000000..ad87d0c6 --- /dev/null +++ b/docs/doxygen/nel/logic__condition_8cpp-source.html @@ -0,0 +1,704 @@ +<!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>logic_condition.cpp</h1><a href="logic__condition_8cpp.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 +00027 <font class="preprocessor">#include "<a class="code" href="o__xml_8h.html">nel/misc/o_xml.h</a>"</font> +00028 +00029 <font class="preprocessor">#include "<a class="code" href="logic__condition_8h.html">nel/logic/logic_condition.h</a>"</font> +00030 <font class="preprocessor">#include "<a class="code" href="logic__variable_8h.html">nel/logic/logic_variable.h</a>"</font> +00031 <font class="preprocessor">#include "<a class="code" href="logic__state__machine_8h.html">nel/logic/logic_state_machine.h</a>"</font> +00032 +00033 <font class="keyword">using</font> <font class="keyword">namespace </font>NLMISC; +00034 <font class="keyword">using</font> <font class="keyword">namespace </font>std; +00035 +00036 <font class="keyword">namespace </font>NLLOGIC +00037 { +00038 +00039 <font class="comment">//-------------------------------------------------</font> +00040 <font class="comment">// setLogicStateMachine :</font> +00041 <font class="comment">//</font> +00042 <font class="comment">//-------------------------------------------------</font> +<a name="l00043"></a><a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#a1">00043</a> <font class="keywordtype">void</font> CLogicComparisonBlock::setLogicStateMachine( CLogicStateMachine * logicStateMachine ) +00044 { +00045 <font class="keywordflow">if</font>( logicStateMachine == 0 ) +00046 { +00047 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicComparisonBlock::setLogicStateMachine> The state machine is null"</font>); +00048 } +00049 <font class="keywordflow">else</font> +00050 { +00051 <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#o0">_LogicStateMachine</a> = logicStateMachine; +00052 } +00053 +00054 } <font class="comment">// setLogicStateMachine //</font> +00055 +00056 +00057 <font class="comment">//-------------------------------------------------</font> +00058 <font class="comment">// testLogic :</font> +00059 <font class="comment">//</font> +00060 <font class="comment">//-------------------------------------------------</font> +<a name="l00061"></a><a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#a2">00061</a> <font class="keywordtype">bool</font> CLogicComparisonBlock::testLogic() +00062 { +00063 CLogicVariable var; +00064 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#o0">_LogicStateMachine</a>->getVariable( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m0">VariableName</a>, var ) == <font class="keyword">false</font> ) +00065 { +00066 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicComparisonBlock::testLogic> The variable %s is unknown in the state machine"</font>,<a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m0">VariableName</a>.c_str()); +00067 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00068 } +00069 +00070 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">"<"</font> ) <font class="keywordflow">return</font> ( var.getValue() < <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00071 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">"<="</font> ) <font class="keywordflow">return</font> ( var.getValue() <= <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00072 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">">"</font> ) <font class="keywordflow">return</font> ( var.getValue() > <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00073 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">">="</font> ) <font class="keywordflow">return</font> ( var.getValue() >= <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00074 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">"=="</font> ) <font class="keywordflow">return</font> ( var.getValue() == <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00075 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> == <font class="stringliteral">"!="</font> ) <font class="keywordflow">return</font> ( var.getValue() != <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> ); +00076 +00077 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicComparisonBlock::testLogic> The comparison block operator %s is unknown"</font>,<a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a>.c_str()); +00078 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00079 +00080 } <font class="comment">// testLogic //</font> +00081 +00082 +00083 <font class="comment">//-------------------------------------------------</font> +00084 <font class="comment">// serial :</font> +00085 <font class="comment">//</font> +00086 <font class="comment">//-------------------------------------------------</font> +00087 <font class="comment">/*void CLogicComparisonBlock::serial( IStream &f )</font> +00088 <font class="comment">{</font> +00089 <font class="comment"> f.xmlPush("COMPARISON_BLOCK");</font> +00090 <font class="comment"> </font> +00091 <font class="comment"> f.serial( VariableName );</font> +00092 <font class="comment"> f.serial( Operator );</font> +00093 <font class="comment"> f.serial( Comparand );</font> +00094 <font class="comment"> </font> +00095 <font class="comment"> f.xmlPop();</font> +00096 <font class="comment"></font> +00097 <font class="comment">} // serial //*/</font> +00098 +<a name="l00099"></a><a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#a3">00099</a> <font class="keywordtype">void</font> CLogicComparisonBlock::write (xmlNodePtr node)<font class="keyword"> const</font> +00100 <font class="keyword"></font>{ +00101 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"COMPARISON_BLOCK"</font>, NULL); +00102 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"VariableName"</font>, (<font class="keyword">const</font> xmlChar*)<a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m0">VariableName</a>.c_str()); +00103 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Operator"</font>, (<font class="keyword">const</font> xmlChar*)<a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a>.c_str()); +00104 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Comparand"</font>, (<font class="keyword">const</font> xmlChar*)toString(Comparand).c_str()); +00105 } +00106 +<a name="l00107"></a><a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#a4">00107</a> <font class="keywordtype">void</font> CLogicComparisonBlock::read (xmlNodePtr node) +00108 { +00109 <a class="code" href="namespaceNLLOGIC.html#a1">xmlCheckNodeName</a> (node, <font class="stringliteral">"COMPARISON_BLOCK"</font>); +00110 +00111 <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m0">VariableName</a> = <a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"VariableName"</font>); +00112 <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m1">Operator</a> = <a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"Operator"</font>); +00113 <a class="code" href="classNLLOGIC_1_1CLogicComparisonBlock.html#m2">Comparand</a> = atoiInt64(<a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"Comparand"</font>).c_str()); +00114 } +00115 +00116 +00117 +00118 +00119 +00120 +00121 +00122 <font class="comment">//-------------------------------------------------</font> +00123 <font class="comment">// setLogicStateMachine :</font> +00124 <font class="comment">//</font> +00125 <font class="comment">//-------------------------------------------------</font> +<a name="l00126"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#a2">00126</a> <font class="keywordtype">void</font> CLogicConditionLogicBlock::setLogicStateMachine( CLogicStateMachine * logicStateMachine ) +00127 { +00128 <font class="keywordflow">if</font>( logicStateMachine == 0 ) +00129 { +00130 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CCLogicConditionLogicBlock::setLogicStateMachine> The state machine is null"</font>); +00131 } +00132 <font class="keywordflow">else</font> +00133 { +00134 <font class="comment">// set the state machine of this node</font> +00135 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#o0">_LogicStateMachine</a> = logicStateMachine; +00136 +00137 <font class="comment">// set the state machine of the logic block </font> +00138 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m2">ComparisonBlock</a>.setLogicStateMachine( logicStateMachine ); +00139 } +00140 +00141 } <font class="comment">// setLogicStateMachine //</font> +00142 +00143 +00144 <font class="comment">//-------------------------------------------------</font> +00145 <font class="comment">// testLogic :</font> +00146 <font class="comment">//</font> +00147 <font class="comment">//-------------------------------------------------</font> +<a name="l00148"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#a3">00148</a> <font class="keywordtype">bool</font> CLogicConditionLogicBlock::testLogic() +00149 { +00150 <font class="keywordflow">switch</font>( Type ) +00151 { +00152 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s0">NOT</a> : +00153 { +00154 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00155 } +00156 <font class="keywordflow">break</font>; +00157 +00158 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s1">COMPARISON</a> : +00159 { +00160 <font class="keywordflow">return</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m2">ComparisonBlock</a>.testLogic(); +00161 } +00162 <font class="keywordflow">break</font>; +00163 +00164 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s2">SUB_CONDITION</a> : +00165 { +00166 CLogicCondition <a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>; +00167 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#o0">_LogicStateMachine</a>->getCondition(<a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m1">SubCondition</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>) ) +00168 { +00169 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>.testLogic(); +00170 } +00171 <font class="keywordflow">else</font> +00172 { +00173 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicConditionLogicBlock::testLogic> The subcondition \"%s\" is unknown in the state machine \"%s\""</font>, +00174 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m1">SubCondition</a>.c_str(),<a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#o0">_LogicStateMachine</a>->getName().c_str()); +00175 } +00176 +00177 } +00178 +00179 <font class="keywordflow">default</font> : +00180 <a class="code" href="debug_8h.html#a3">nlerror</a>(<font class="stringliteral">"(LOGIC)<CLogicConditionLogicBlock::testLogic> logic block type %d is unknown"</font>,<a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m0">Type</a>); +00181 } +00182 +00183 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00184 +00185 } <font class="comment">// testLogic //</font> +00186 +00187 +00188 +00189 <font class="comment">//-------------------------------------------------</font> +00190 <font class="comment">// fillVarSet :</font> +00191 <font class="comment">//</font> +00192 <font class="comment">//-------------------------------------------------</font> +00193 <font class="keywordtype">void</font> CLogicConditionLogicBlock::fillVarSet( set<string>& condVars ) +00194 { +00195 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m0">Type</a> == <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s1">COMPARISON</a> ) +00196 { +00197 condVars.insert( <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m2">ComparisonBlock</a>.VariableName ); +00198 } +00199 <font class="keywordflow">else</font> +00200 { +00201 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m0">Type</a> == <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s2">SUB_CONDITION</a> ) +00202 { +00203 CLogicCondition <a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>; +00204 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#o0">_LogicStateMachine</a>->getCondition(<a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m1">SubCondition</a>,<a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>) ) +00205 { +00206 <a class="code" href="driver__opengl__extension__def_8h.html#a254">condition</a>.fillVarSet( condVars ); +00207 } +00208 } +00209 } +00210 +00211 } <font class="comment">// fillVarSet //</font> +00212 +00213 +00214 <font class="comment">//-------------------------------------------------</font> +00215 <font class="comment">// serial :</font> +00216 <font class="comment">//</font> +00217 <font class="comment">//-------------------------------------------------</font> +00218 <font class="comment">/*void CLogicConditionLogicBlock::serial( IStream &f )</font> +00219 <font class="comment">{</font> +00220 <font class="comment"> f.xmlPush("CONDITION_LOGIC_BLOCK");</font> +00221 <font class="comment"></font> +00222 <font class="comment"> f.serialEnum( Type );</font> +00223 <font class="comment"> switch( Type )</font> +00224 <font class="comment"> {</font> +00225 <font class="comment"> case NOT : break;</font> +00226 <font class="comment"> </font> +00227 <font class="comment"> case COMPARISON :</font> +00228 <font class="comment"> {</font> +00229 <font class="comment"> f.serial( ComparisonBlock );</font> +00230 <font class="comment"> }</font> +00231 <font class="comment"> break;</font> +00232 <font class="comment"></font> +00233 <font class="comment"> case SUB_CONDITION :</font> +00234 <font class="comment"> {</font> +00235 <font class="comment"> f.serial( SubCondition );</font> +00236 <font class="comment"> }</font> +00237 <font class="comment"> break;</font> +00238 <font class="comment"> };</font> +00239 <font class="comment"> </font> +00240 <font class="comment"> f.xmlPop();</font> +00241 <font class="comment">};*/</font> +00242 +<a name="l00243"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#a5">00243</a> <font class="keywordtype">void</font> CLogicConditionLogicBlock::write (xmlNodePtr node)<font class="keyword"> const</font> +00244 <font class="keyword"></font>{ +00245 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"CONDITION_LOGIC_NODE"</font>, NULL); +00246 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Type"</font>, (<font class="keyword">const</font> xmlChar*)toString(Type).c_str()); +00247 <font class="keywordflow">switch</font>( Type ) +00248 { +00249 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s0">NOT</a> : <font class="keywordflow">break</font>; +00250 +00251 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s1">COMPARISON</a> : +00252 { +00253 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m2">ComparisonBlock</a>.write(elmPtr); +00254 } +00255 <font class="keywordflow">break</font>; +00256 +00257 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s2">SUB_CONDITION</a> : +00258 { +00259 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"SubCondition"</font>, (<font class="keyword">const</font> xmlChar*)<a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m1">SubCondition</a>.c_str()); +00260 } +00261 <font class="keywordflow">break</font>; +00262 }; +00263 } +00264 +<a name="l00265"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#a6">00265</a> <font class="keywordtype">void</font> CLogicConditionLogicBlock::read (xmlNodePtr node) +00266 { +00267 <a class="code" href="namespaceNLLOGIC.html#a1">xmlCheckNodeName</a> (node, <font class="stringliteral">"CONDITION_LOGIC_NODE"</font>); +00268 +00269 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m0">Type</a> = (TLogicConditionLogicBlockType)atoi(<a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"Type"</font>).c_str()); +00270 <font class="keywordflow">switch</font>( Type ) +00271 { +00272 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s0">NOT</a> : <font class="keywordflow">break</font>; +00273 +00274 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s1">COMPARISON</a> : +00275 { +00276 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m2">ComparisonBlock</a>.read (node); +00277 } +00278 <font class="keywordflow">break</font>; +00279 +00280 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#s3s2">SUB_CONDITION</a> : +00281 { +00282 <a class="code" href="classNLLOGIC_1_1CLogicConditionLogicBlock.html#m1">SubCondition</a> = <a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"SubCondition"</font>); +00283 } +00284 <font class="keywordflow">break</font>; +00285 }; +00286 } +00287 +00288 <font class="comment">//-----------------------------------------</font> +00289 +00290 +00291 +00292 <font class="comment">//-------------------------------------------------</font> +00293 <font class="comment">// setLogicStateMachine :</font> +00294 <font class="comment">//</font> +00295 <font class="comment">//-------------------------------------------------</font> +<a name="l00296"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a1">00296</a> <font class="keywordtype">void</font> CLogicConditionNode::setLogicStateMachine( CLogicStateMachine * logicStateMachine ) +00297 { +00298 <font class="keywordflow">if</font>( logicStateMachine == 0 ) +00299 { +00300 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicConditionNode::setLogicStateMachine> The state machine is null"</font>); +00301 } +00302 <font class="keywordflow">else</font> +00303 { +00304 <font class="comment">// set the state machine of this node</font> +00305 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#o0">_LogicStateMachine</a> = logicStateMachine; +00306 +00307 <font class="comment">// set the state machine of the logic block </font> +00308 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.setLogicStateMachine( logicStateMachine ); +00309 +00310 <font class="comment">// set the state machine for the sub nodes</font> +00311 vector<CLogicConditionNode *>::iterator itNodes; +00312 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNodes ) +00313 { +00314 (*itNodes)->setLogicStateMachine( logicStateMachine ); +00315 } +00316 } +00317 +00318 } <font class="comment">// setLogicStateMachine //</font> +00319 +00320 +00321 <font class="comment">//-------------------------------------------------</font> +00322 <font class="comment">// addNode :</font> +00323 <font class="comment">//</font> +00324 <font class="comment">//-------------------------------------------------</font> +<a name="l00325"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a2">00325</a> <font class="keywordtype">void</font> CLogicConditionNode::addNode( CLogicConditionNode * node ) +00326 { +00327 node->setLogicStateMachine( <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#o0">_LogicStateMachine</a> ); +00328 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.push_back( node ); +00329 +00330 } <font class="comment">// addToSubNodes //</font> +00331 +00332 +00333 <font class="comment">//-------------------------------------------------</font> +00334 <font class="comment">// testLogic :</font> +00335 <font class="comment">//</font> +00336 <font class="comment">//-------------------------------------------------</font> +<a name="l00337"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a3">00337</a> <font class="keywordtype">bool</font> CLogicConditionNode::testLogic() +00338 { +00339 <font class="comment">// test the logic block</font> +00340 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.testLogic() == <font class="keyword">false</font> ) +00341 { +00342 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00343 } +00344 +00345 <font class="comment">// if there's no subtree we assess the subtree is true</font> +00346 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.size() == 0 ) +00347 { +00348 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00349 } +00350 +00351 <font class="comment">// test the subtree</font> +00352 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.isNotBlock() ) +00353 { +00354 <font class="comment">// the subtree is false if at least one node is true</font> +00355 vector<CLogicConditionNode *>::iterator itNodes; +00356 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNodes ) +00357 { +00358 <font class="keywordflow">if</font>( (*itNodes)->testLogic() == <font class="keyword">true</font> ) +00359 { +00360 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00361 } +00362 } +00363 +00364 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00365 } +00366 <font class="keywordflow">else</font> +00367 { +00368 <font class="comment">// the subtree is true if at least one node is true</font> +00369 vector<CLogicConditionNode *>::iterator itNodes; +00370 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNodes ) +00371 { +00372 <font class="keywordflow">if</font>( (*itNodes)->testLogic() == <font class="keyword">true</font> ) +00373 { +00374 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00375 } +00376 } +00377 +00378 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00379 } +00380 +00381 } <font class="comment">// testLogic //</font> +00382 +00383 +00384 <font class="comment">//-------------------------------------------------</font> +00385 <font class="comment">// fillVarSet :</font> +00386 <font class="comment">//</font> +00387 <font class="comment">//-------------------------------------------------</font> +00388 <font class="keywordtype">void</font> CLogicConditionNode::fillVarSet( set<string>& condVars ) +00389 { +00390 <font class="keywordflow">if</font>( <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m0">Type</a> == <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#s2s1">LOGIC_NODE</a> ) +00391 { +00392 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.fillVarSet( condVars ); +00393 } +00394 +00395 vector<CLogicConditionNode *>::iterator itNode; +00396 <font class="keywordflow">for</font>( itNode = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); itNode != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNode ) +00397 { +00398 (*itNode)->fillVarSet( condVars ); +00399 } +00400 +00401 } <font class="comment">// fillVarSet //</font> +00402 +00403 +00404 <font class="comment">//-------------------------------------------------</font> +00405 <font class="comment">// serial :</font> +00406 <font class="comment">//</font> +00407 <font class="comment">//-------------------------------------------------</font> +00408 <font class="comment">/*void CLogicConditionNode::serial( IStream &f )</font> +00409 <font class="comment">{</font> +00410 <font class="comment"> f.xmlPush("CONDITION_NODE");</font> +00411 <font class="comment"> </font> +00412 <font class="comment"> f.serialEnum( Type );</font> +00413 <font class="comment"> switch( Type )</font> +00414 <font class="comment"> {</font> +00415 <font class="comment"> case TERMINATOR : break;</font> +00416 <font class="comment"> case LOGIC_NODE :</font> +00417 <font class="comment"> {</font> +00418 <font class="comment"> f.serial( LogicBlock );</font> +00419 <font class="comment"> if( f.isReading() )</font> +00420 <font class="comment"> {</font> +00421 <font class="comment"> uint32 sz;</font> +00422 <font class="comment"> f.serial( sz );</font> +00423 <font class="comment"> uint i;</font> +00424 <font class="comment"> for( i = 0; i < sz; i++ )</font> +00425 <font class="comment"> {</font> +00426 <font class="comment"> CLogicConditionNode * node = new CLogicConditionNode();</font> +00427 <font class="comment"> f.serial( *node );</font> +00428 <font class="comment"> _Nodes.push_back( node );</font> +00429 <font class="comment"> }</font> +00430 <font class="comment"> }</font> +00431 <font class="comment"> else</font> +00432 <font class="comment"> {</font> +00433 <font class="comment"> uint32 sz = _Nodes.size();</font> +00434 <font class="comment"> f.serial( sz );</font> +00435 <font class="comment"> vector<CLogicConditionNode *>::iterator itNode;</font> +00436 <font class="comment"> for( itNode = _Nodes.begin(); itNode != _Nodes.end(); ++itNode )</font> +00437 <font class="comment"> {</font> +00438 <font class="comment"> f.serial( **itNode );</font> +00439 <font class="comment"> }</font> +00440 <font class="comment"> }</font> +00441 <font class="comment"> }</font> +00442 <font class="comment"> break;</font> +00443 <font class="comment"> };</font> +00444 <font class="comment"></font> +00445 <font class="comment"> f.xmlPop();</font> +00446 <font class="comment"></font> +00447 <font class="comment">} // serial //*/</font> +00448 +<a name="l00449"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a6">00449</a> <font class="keywordtype">void</font> CLogicConditionNode::write (xmlNodePtr node)<font class="keyword"> const</font> +00450 <font class="keyword"></font>{ +00451 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"CONDITION_NODE"</font>, NULL); +00452 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Type"</font>, (<font class="keyword">const</font> xmlChar*)toString(Type).c_str()); +00453 +00454 <font class="keywordflow">switch</font>( Type ) +00455 { +00456 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#s2s0">TERMINATOR</a> : <font class="keywordflow">break</font>; +00457 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#s2s1">LOGIC_NODE</a> : +00458 { +00459 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.write(elmPtr); +00460 vector<CLogicConditionNode *>::const_iterator itNode = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); +00461 <font class="keywordflow">for</font>( ; itNode != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNode ) +00462 { +00463 (*itNode)->write(elmPtr); +00464 } +00465 } +00466 <font class="keywordflow">break</font>; +00467 }; +00468 } +00469 +<a name="l00470"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a7">00470</a> <font class="keywordtype">void</font> CLogicConditionNode::read (xmlNodePtr node) +00471 { +00472 <a class="code" href="namespaceNLLOGIC.html#a1">xmlCheckNodeName</a> (node, <font class="stringliteral">"CONDITION_NODE"</font>); +00473 +00474 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m0">Type</a> = (TConditionNodeType )atoi(<a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"Type"</font>).c_str()); +00475 <font class="keywordflow">switch</font>( Type ) +00476 { +00477 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#s2s0">TERMINATOR</a> : <font class="keywordflow">break</font>; +00478 <font class="keywordflow">case</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#s2s1">LOGIC_NODE</a> : +00479 { +00480 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m1">LogicBlock</a>.read (node); +00481 +00482 { +00483 <font class="comment">// Count the parent</font> +00484 <a class="code" href="types__nl_8h.html#a14">uint</a> nb = CIXml::countChildren (node, <font class="stringliteral">"CONDITION_NODE"</font>); +00485 <a class="code" href="types__nl_8h.html#a14">uint</a> i = 0; +00486 xmlNodePtr parent = CIXml::getFirstChildNode (node, <font class="stringliteral">"CONDITION_NODE"</font>); +00487 <font class="keywordflow">while</font> (i<nb) +00488 { +00489 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a0">CLogicConditionNode</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a> = <font class="keyword">new</font> <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a0">CLogicConditionNode</a>(); +00490 <a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a>->read(parent); +00491 <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.push_back (<a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a>); +00492 +00493 <font class="comment">// Next parent</font> +00494 parent = CIXml::getNextChildNode (parent, <font class="stringliteral">"CONDITION_NODE"</font>); +00495 i++; +00496 } +00497 } +00498 } +00499 <font class="keywordflow">break</font>; +00500 }; +00501 } +00502 +00503 <font class="comment">//-------------------------------------------------</font> +00504 <font class="comment">// ~CLogicConditionNode :</font> +00505 <font class="comment">//</font> +00506 <font class="comment">//-------------------------------------------------</font> +<a name="l00507"></a><a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#a5">00507</a> CLogicConditionNode::~CLogicConditionNode() +00508 { +00509 vector<CLogicConditionNode *>::iterator itNodes; +00510 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicConditionNode.html#m2">_Nodes</a>.end(); ++itNodes ) +00511 { +00512 <font class="keyword">delete</font> (*itNodes); +00513 } +00514 +00515 } <font class="comment">// ~CLogicConditionNode //</font> +00516 +00517 +00518 +00519 +00520 +00521 +00522 +00523 <font class="comment">//-------------------------------------------------</font> +00524 <font class="comment">// setLogicStateMachine :</font> +00525 <font class="comment">//</font> +00526 <font class="comment">//-------------------------------------------------</font> +<a name="l00527"></a><a class="code" href="classNLLOGIC_1_1CLogicCondition.html#a1">00527</a> <font class="keywordtype">void</font> CLogicCondition::setLogicStateMachine( CLogicStateMachine * logicStateMachine ) +00528 { +00529 <font class="keywordflow">if</font>( logicStateMachine == 0 ) +00530 { +00531 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"(LOGIC)<CLogicCondition::setLogicStateMachine> The state machine is null"</font>); +00532 } +00533 <font class="keywordflow">else</font> +00534 { +00535 <font class="comment">// init the logic state machine for each node</font> +00536 vector<CLogicConditionNode>::iterator itNodes; +00537 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.end(); ++itNodes ) +00538 { +00539 (*itNodes).setLogicStateMachine( logicStateMachine ); +00540 } +00541 } +00542 +00543 } <font class="comment">// setLogicStateMachine //</font> +00544 +00545 +00546 <font class="comment">//-------------------------------------------------</font> +00547 <font class="comment">// testLogic :</font> +00548 <font class="comment">//</font> +00549 <font class="comment">//-------------------------------------------------</font> +<a name="l00550"></a><a class="code" href="classNLLOGIC_1_1CLogicCondition.html#a5">00550</a> <font class="keywordtype">bool</font> CLogicCondition::testLogic() +00551 { +00552 vector<CLogicConditionNode>::iterator itNodes; +00553 <font class="keywordflow">for</font>( itNodes = <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.begin(); itNodes != <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.end(); ++itNodes ) +00554 { +00555 <font class="keywordflow">if</font>( (*itNodes).testLogic() == <font class="keyword">false</font> ) +00556 { +00557 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00558 } +00559 } +00560 +00561 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00562 +00563 } <font class="comment">// testLogic //</font> +00564 +00565 +00566 +00567 <font class="comment">//-------------------------------------------------</font> +00568 <font class="comment">// fillVarSet :</font> +00569 <font class="comment">//</font> +00570 <font class="comment">//-------------------------------------------------</font> +00571 <font class="keywordtype">void</font> CLogicCondition::fillVarSet( set<string>& condVars ) +00572 { +00573 vector<CLogicConditionNode>::iterator itNode; +00574 <font class="keywordflow">for</font>( itNode = <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.begin(); itNode != <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.end(); ++itNode ) +00575 { +00576 (*itNode).fillVarSet( condVars ); +00577 } +00578 +00579 } <font class="comment">// fillVarSet //</font> +00580 +00581 +00582 +00583 <font class="comment">//-------------------------------------------------</font> +00584 <font class="comment">// serial :</font> +00585 <font class="comment">//</font> +00586 <font class="comment">//-------------------------------------------------</font> +00587 <font class="comment">/*void CLogicCondition::serial( IStream &f )</font> +00588 <font class="comment">{</font> +00589 <font class="comment"> f.xmlPush("CONDITION");</font> +00590 <font class="comment"> </font> +00591 <font class="comment"> f.serial( _ConditionName );</font> +00592 <font class="comment"> f.serialCont( Nodes );</font> +00593 <font class="comment"></font> +00594 <font class="comment"> f.xmlPop();</font> +00595 <font class="comment"></font> +00596 <font class="comment">} // serial //*/</font> +00597 +<a name="l00598"></a><a class="code" href="classNLLOGIC_1_1CLogicCondition.html#a7">00598</a> <font class="keywordtype">void</font> CLogicCondition::write (xmlNodePtr node)<font class="keyword"> const</font> +00599 <font class="keyword"></font>{ +00600 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"CONDITION"</font>, NULL); +00601 xmlSetProp (elmPtr, (<font class="keyword">const</font> xmlChar*)<font class="stringliteral">"Name"</font>, (<font class="keyword">const</font> xmlChar*)<a class="code" href="classNLLOGIC_1_1CLogicCondition.html#o0">_ConditionName</a>.c_str()); +00602 +00603 <a class="code" href="types__nl_8h.html#a14">uint</a> i; +00604 <font class="keywordflow">for</font> (i = 0; i < <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.size(); i++) +00605 { +00606 <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>[i].write(elmPtr); +00607 } +00608 } +00609 +<a name="l00610"></a><a class="code" href="classNLLOGIC_1_1CLogicCondition.html#a8">00610</a> <font class="keywordtype">void</font> CLogicCondition::read (xmlNodePtr node) +00611 { +00612 <a class="code" href="namespaceNLLOGIC.html#a1">xmlCheckNodeName</a> (node, <font class="stringliteral">"CONDITION"</font>); +00613 +00614 <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#o0">_ConditionName</a> = <a class="code" href="namespaceNLLOGIC.html#a2">getXMLProp</a> (node, <font class="stringliteral">"Name"</font>); +00615 +00616 { +00617 <font class="comment">// Count the parent</font> +00618 <a class="code" href="types__nl_8h.html#a14">uint</a> nb = CIXml::countChildren (node, <font class="stringliteral">"CONDITION_NODE"</font>); +00619 <a class="code" href="types__nl_8h.html#a14">uint</a> i = 0; +00620 xmlNodePtr parent = CIXml::getFirstChildNode (node, <font class="stringliteral">"CONDITION_NODE"</font>); +00621 <font class="keywordflow">while</font> (i<nb) +00622 { +00623 CLogicConditionNode <a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a>; +00624 <a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a>.read(parent); +00625 <a class="code" href="classNLLOGIC_1_1CLogicCondition.html#m0">Nodes</a>.push_back (<a class="code" href="driver__opengl__extension__def_8h.html#a246">v</a>); +00626 +00627 <font class="comment">// Next parent</font> +00628 parent = CIXml::getNextChildNode (parent, <font class="stringliteral">"CONDITION_NODE"</font>); +00629 i++; +00630 } +00631 } +00632 } +00633 +00634 +00635 } <font class="comment">// NLLOGIC</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> |