1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
<!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="/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="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=><b>Home</B></FONT></A> </TD>
<TD><IMG width=6 height=14 SRC="/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="/inc/img/black_banner.jpg"><A HREF=""><IMG SRC="/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="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="/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="/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
</TABLE>
</TD></TR></TABLE></TD></TR></TABLE>
<!------ End Box ------>
</TD>
<TD WIDTH=15><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD ALIGN=left valign=top><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!-- title -->
<TABLE background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG SRC="/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="/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:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> </center>
<hr><h1>message_script.cpp</h1><a href="message__script_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="message__script_8h.html">nel/ai/agent/message_script.h</a>"</font>
00025 <font class="preprocessor">#include "<a class="code" href="interpret__object__message_8h.html">nel/ai/script/interpret_object_message.h</a>"</font>
00026 <font class="preprocessor">#include "<a class="code" href="codage_8h.html">nel/ai/script/codage.h</a>"</font>
00027 <font class="preprocessor">#include "<a class="code" href="type__def_8h.html">nel/ai/script/type_def.h</a>"</font>
00028 <font class="preprocessor">#include "<a class="code" href="object__unknown_8h.html">nel/ai/script/object_unknown.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="msg_8h.html">nel/ai/agent/msg.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="ai__exception_8h.html">nel/ai/e/ai_exception.h</a>"</font>
00031
00032 <font class="keyword">namespace </font>NLAIAGENT
00033 {
00034 <font class="keyword">static</font> CGroupType listBidon;
00035
<a name="l00036"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">00036</a> CMessageScript::CMessageScript(<font class="keyword">const</font> CMessageScript &m):IMessageBase(m)
00037 {
00038 <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a> = m._MessageClass;
00039 <font class="comment">/*if ( _MessageClass )</font>
00040 <font class="comment"> _MessageClass->incRef();*/</font>
00041 <font class="comment">//CVectorGroupType *x = new CVectorGroupType(m.size());</font>
00042 }
00043
<a name="l00044"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a1">00044</a> CMessageScript::CMessageScript(<a class="code" href="classNLAISCRIPT_1_1CMessageClass.html">NLAISCRIPT::CMessageClass</a> *b) : _MessageClass( b )
00045 {
00046 <font class="comment">/*if ( _MessageClass )</font>
00047 <font class="comment"> _MessageClass->incRef();*/</font>
00048 }
00049
<a name="l00050"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a2">00050</a> CMessageScript::CMessageScript( <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> &<a class="code" href="driver__opengl__extension__def_8h.html#a413">components</a>, <a class="code" href="classNLAISCRIPT_1_1CMessageClass.html">NLAISCRIPT::CMessageClass</a> *message_class ): _MessageClass( message_class )
00051 {
00052 <font class="comment">/*if ( _MessageClass )</font>
00053 <font class="comment"> _MessageClass->incRef();*/</font>
00054
00055 <font class="comment">// Creates the static components array</font>
00056 CVectorGroupType *<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a> = <font class="keyword">new</font> CVectorGroupType(components.size());
00057 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a>::iterator it_c = components.begin();
00058 sint32 i = 0;
00059 <font class="keywordflow">while</font> ( it_c != components.end() )
00060 {
00061 <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>->setObject(i,*it_c);
00062 it_c++;
00063 i ++;
00064 }
00065 <a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a0">setMessageGroup</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>);
00066 <a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a8">setGroup</a>(CMessageGroup::msgScriptingGroup);
00067 }
00068
<a name="l00069"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a3">00069</a> CMessageScript::~CMessageScript()
00070 {
00071 <font class="comment">/*#ifdef NL_DEBUG</font>
00072 <font class="comment"> const char *name = (const char *)getType();</font>
00073 <font class="comment">#endif*/</font>
00074 <font class="comment">/*if ( _MessageClass )</font>
00075 <font class="comment"> _MessageClass->release(); */</font>
00076 }
00077
<a name="l00078"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_0">00078</a> sint32 CMessageScript::getMethodIndexSize()<font class="keyword"> const</font>
00079 <font class="keyword"> </font>{
00080 <font class="keywordflow">return</font> IMessageBase::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_7">getMethodIndexSize</a>();
00081 }
00082
<a name="l00083"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a6">00083</a> sint32 CMessageScript::getBaseMethodCount()<font class="keyword"> const</font>
00084 <font class="keyword"> </font>{
00085 <font class="keywordflow">return</font> IMessageBase::getMethodIndexSize();
00086 }
00087
00088
<a name="l00089"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a4">00089</a> <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *CMessageScript::getMethode(sint32 inheritance,sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>)
00090 {
00091 <font class="preprocessor">#ifdef NL_DEBUG</font>
00092 <font class="preprocessor"></font> <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> >= <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_7">getMethodIndexSize</a>())
00093 {
00094 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>();
00095 }
00096
00097 <font class="keywordflow">if</font> ( inheritance >= <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z233_2">sizeVTable</a>())
00098 {
00099 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>();
00100 }
00101 <font class="preprocessor">#endif</font>
00102 <font class="preprocessor"></font> <font class="keywordflow">return</font> (<a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *)<a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_1">getBrancheCode</a>(inheritance,<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>).getCode();
00103 }
00104
<a name="l00105"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a5">00105</a> <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *CMessageScript::getMethode(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>)
00106 {
00107 <font class="preprocessor">#ifdef NL_DEBUG</font>
00108 <font class="preprocessor"></font> <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> >= <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_7">getMethodIndexSize</a>())
00109 {
00110 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>();
00111 }
00112 <font class="preprocessor">#endif</font>
00113 <font class="preprocessor"></font> <font class="keywordflow">return</font> (<a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *)<a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_1">getBrancheCode</a>(index).getCode();
00114 }
00115
00116
<a name="l00117"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_3">00117</a> IObjectIA::CProcessResult CMessageScript::runMethodeMember(sint32 inheritance, sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, IObjectIA *c)
00118 {
00119 <font class="keywordflow">if</font>(c->getType() != <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#p0">NLAISCRIPT::CCodeContext::IdCodeContext</a>)
00120 {
00121 <font class="keywordflow">return</font> IMessageBase::runMethodeMember(inheritance,<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, c);
00122 }
00123
00124 <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *opPtr = NULL;
00125 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> &context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> &)*c;
00126
00127 sint32 i = <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a6">getBaseMethodCount</a>();
00128 <font class="keywordflow">if</font>(i < 0)
00129 {
00130 <font class="comment">/*if (context.ContextDebug.Active)</font>
00131 <font class="comment"> {</font>
00132 <font class="comment"> context.ContextDebug.Param.push_back(&listBidon);</font>
00133 <font class="comment"> listBidon.incRef();</font>
00134 <font class="comment"> }*/</font>
00135
00136 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = IMessageBase::runMethodeMember(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,(<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m5">Param</a>.back());
00137 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result != NULL)
00138 {
00139 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>++;
00140 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>[(int)context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>] = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result;
00141 }
00142 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00143 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00144 }
00145 <font class="keywordflow">else</font>
00146 {
00147 opPtr = <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a4">getMethode</a>( inheritance, i);
00148 }
00149
00150 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00151
00152 <font class="keywordflow">if</font>(opPtr)
00153 {
00154 <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> &op = *opPtr;
00155 <a class="code" href="classNLAISCRIPT_1_1CCodeBrancheRun.html">NLAISCRIPT::CCodeBrancheRun</a> *opTmp = context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a>;
00156 sint32 ip = (uint32)*context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a>;
00157 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = (<a class="code" href="classNLAISCRIPT_1_1CCodeBrancheRun.html">NLAISCRIPT::CCodeBrancheRun</a> *)&op;
00158 *context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = 0;
00159
00160 <font class="comment">/*TProcessStatement k = IObjectIA::ProcessIdle;</font>
00161 <font class="comment"></font>
00162 <font class="comment"> while(k != IObjectIA::ProcessEnd)</font>
00163 <font class="comment"> {</font>
00164 <font class="comment"> k = op.run(context); </font>
00165 <font class="comment"> }*/</font>
00166
00167 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = ((<a class="code" href="classNLAISCRIPT_1_1ICodeBranche.html">NLAISCRIPT::ICodeBranche</a> *)opPtr)->run(context);
00168
00169 <font class="comment">// If we are in Debug Mode</font>
00170 <font class="keywordflow">if</font> (context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m6">ContextDebug</a>.Active)
00171 {
00172 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m6">ContextDebug</a>.callStackPop();
00173 }
00174
00175 *context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = ip;
00176 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = opTmp;
00177 }
00178 <font class="keywordflow">else</font>
00179 {
00180 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionUnReference.html">NLAIE::CExceptionUnReference</a>(<font class="stringliteral">"CMessageScript::runMethodeMember(sint32 , sint32, IObjectIA *) because code is null"</font>);
00181 }
00182 <font class="comment">/*IObjectIA::CProcessResult r;</font>
00183 <font class="comment"> r.Result = NULL;</font>
00184 <font class="comment"> r.ResultState = k;*/</font>
00185 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00186 }
00187
<a name="l00188"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_4">00188</a> IObjectIA::CProcessResult CMessageScript::runMethodeMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,IObjectIA *c)
00189 {
00190 <font class="keywordflow">if</font>(c->getType() != <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#p0">NLAISCRIPT::CCodeContext::IdCodeContext</a>)
00191 {
00192 <font class="keywordflow">return</font> IMessageBase::runMethodeMember(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, c);
00193 }
00194
00195 <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> *opPtr = NULL;
00196 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> &context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> &)*c;
00197
00198 sint32 i = <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a6">getBaseMethodCount</a>();
00199 <font class="keywordflow">if</font>(i < 0)
00200 {
00201 <font class="comment">/*if (context.ContextDebug.Active)</font>
00202 <font class="comment"> {</font>
00203 <font class="comment"> context.ContextDebug.Param.push_back(&listBidon);</font>
00204 <font class="comment"> listBidon.incRef();</font>
00205 <font class="comment"> }*/</font>
00206
00207 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = IMessageBase::runMethodeMember(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,(<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m5">Param</a>.back());
00208 <font class="keywordflow">if</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result != NULL)
00209 {
00210 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>++;
00211 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>[(int)context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m0">Stack</a>] = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result;
00212 }
00213 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00214 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00215 }
00216 <font class="keywordflow">else</font>
00217 {
00218 opPtr = <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a4">getMethode</a>(i);
00219 }
00220
00221 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00222
00223 <font class="keywordflow">if</font>(opPtr)
00224 {
00225 <a class="code" href="classNLAISCRIPT_1_1IOpCode.html">NLAISCRIPT::IOpCode</a> &op = *opPtr;
00226 <a class="code" href="classNLAISCRIPT_1_1CCodeBrancheRun.html">NLAISCRIPT::CCodeBrancheRun</a> *opTmp = context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a>;
00227 sint32 ip = (uint32)*context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a>;
00228 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = (<a class="code" href="classNLAISCRIPT_1_1CCodeBrancheRun.html">NLAISCRIPT::CCodeBrancheRun</a> *)&op;
00229 *context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = 0;
00230
00231 <font class="comment">/*:TProcessStatement k = IObjectIA::ProcessIdle;</font>
00232 <font class="comment"></font>
00233 <font class="comment"> while(k != IObjectIA::ProcessEnd)</font>
00234 <font class="comment"> {</font>
00235 <font class="comment"> k = op.run(context); </font>
00236 <font class="comment"> }*/</font>
00237
00238 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = ((<a class="code" href="classNLAISCRIPT_1_1ICodeBranche.html">NLAISCRIPT::ICodeBranche</a> *)opPtr)->run(context);
00239
00240 <font class="comment">// If we are in Debug Mode</font>
00241 <font class="keywordflow">if</font> (context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m6">ContextDebug</a>.Active)
00242 {
00243 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m6">ContextDebug</a>.callStackPop();
00244 }
00245
00246 *context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = ip;
00247 context.<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m2">Code</a> = opTmp;
00248 }
00249 <font class="keywordflow">else</font>
00250 {
00251 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionUnReference.html">NLAIE::CExceptionUnReference</a>(<font class="stringliteral">"CMessageScript::runMethodeMember(sint32, IObjectIA *) because code is null"</font>);
00252 }
00253 <font class="comment">/*IObjectIA::CProcessResult r;</font>
00254 <font class="comment"> r.Result = NULL;</font>
00255 <font class="comment"> r.ResultState = k;*/</font>
00256 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00257 }
00258
<a name="l00259"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_2">00259</a> sint32 CMessageScript::isClassInheritedFrom(<font class="keyword">const</font> IVarName &class_name)<font class="keyword"> const</font>
00260 <font class="keyword"> </font>{
00261 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z234_0">isClassInheritedFrom</a>( class_name );
00262 }
00263
<a name="l00264"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_5">00264</a> <font class="keywordtype">bool</font> CMessageScript::setStaticMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,IObjectIA *op)
00265 {
00266 <font class="preprocessor">#ifdef NL_DEBUG</font>
00267 <font class="preprocessor"></font> <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> >= <a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_16">size</a>() )
00268 {
00269 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>();
00270 }
00271 <font class="preprocessor">#endif</font>
00272 <font class="preprocessor"></font> CVectorGroupType *a = (CVectorGroupType *)<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a1">getMessageGroup</a>();
00273 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *b = (<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)(*a)[ <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> ];
00274 a->setObject(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, op);
00275 <font class="keywordflow">if</font>(op != b) b->release();
00276 <font class="keywordflow">else</font> <font class="keywordflow">return</font> <font class="keyword">true</font>;
00277 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00278 }
00279
<a name="l00280"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_6">00280</a> <font class="keyword">const</font> IObjectIA *CMessageScript::getStaticMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>)<font class="keyword"> const</font>
00281 <font class="keyword"> </font>{
00282 <font class="preprocessor">#ifdef NL_DEBUG</font>
00283 <font class="preprocessor"></font> <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> >= <a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_16">size</a>() )
00284 {
00285 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionIndexError.html">NLAIE::CExceptionIndexError</a>();
00286 }
00287 <font class="preprocessor">#endif</font>
00288 <font class="preprocessor"></font> <font class="keywordflow">return</font> (*this)[ <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> ];
00289 }
00290
<a name="l00291"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_8">00291</a> sint32 CMessageScript::getStaticMemberIndex(<font class="keyword">const</font> IVarName &name)<font class="keyword"> const</font>
00292 <font class="keyword"> </font>{
00293 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#a20">getStaticMemberIndex</a>(name);
00294 }
00295
<a name="l00296"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_7">00296</a> sint32 CMessageScript::getStaticMemberSize()<font class="keyword"> const</font>
00297 <font class="keyword"> </font>{
00298 <font class="keywordflow">return</font> 0;
00299 }
00300
<a name="l00301"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_1">00301</a> <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> CMessageScript::isMember(<font class="keyword">const</font> IVarName *className,<font class="keyword">const</font> IVarName *methodName,<font class="keyword">const</font> IObjectIA &<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)<font class="keyword"> const</font>
00302 <font class="keyword"> </font>{
00303
00304 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> result = IMessageBase::isMember(className, methodName, <a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>);
00305
00306 <font class="keywordflow">if</font> ( result.size() )
00307 {
00308 <font class="keywordflow">return</font> result;
00309 }
00310
00311 <font class="keywordflow">if</font>( *methodName == CStringVarName(<font class="stringliteral">"send"</font>) )
00312 {
00313 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00314 <a class="code" href="classNLAISCRIPT_1_1COperandVoid.html">NLAISCRIPT::COperandVoid</a> typeR;
00315 <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CObjectUnknown.html">NLAISCRIPT::CObjectUnknown</a>((<a class="code" href="classNLAISCRIPT_1_1IOpType.html">NLAISCRIPT::IOpType</a> *)typeR.<a class="code" href="classNLAISCRIPT_1_1COperandVoid.html#a7">clone</a>());
00316 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.push(CIdMethod(0,0.0,NULL,t));
00317 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00318 }
00319
00320 <font class="keywordflow">return</font> result;
00321 }
00322
<a name="l00323"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_1">00323</a> <font class="keywordtype">void</font> CMessageScript::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os)
00324 {
00325 IMessageBase::save(os);
00326 }
00327
<a name="l00328"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_0">00328</a> <font class="keywordtype">void</font> CMessageScript::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is)
00329 {
00330 IMessageBase::load(is);
00331 }
00332
<a name="l00333"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_2">00333</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CMessageScript::clone()<font class="keyword"> const</font>
00334 <font class="keyword"> </font>{
00335 <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">CMessageScript</a> *cl = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">CMessageScript</a>( *<font class="keyword">this</font> );
00336
00337 <font class="keywordflow">return</font> cl;
00338 }
00339
<a name="l00340"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_3">00340</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CMessageScript::newInstance()<font class="keyword"> const</font>
00341 <font class="keyword"> </font>{
00342 <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">CMessageScript</a> *instance;
00343 <font class="keywordflow">if</font> ( _MessageClass )
00344 {
00345 instance = (<a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">CMessageScript</a> *) <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CMessageClass.html#z236_3">buildNewInstance</a>();
00346 }
00347 <font class="keywordflow">else</font>
00348 {
00349 instance = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#a0">CMessageScript</a>();
00350 }
00351 <font class="keywordflow">return</font> instance;
00352 }
00353
<a name="l00354"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_4">00354</a> <font class="keywordtype">void</font> CMessageScript::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font>
00355 <font class="keyword"> </font>{
00356 <font class="keywordflow">if</font> ( _MessageClass )
00357 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"<%s> (scripted)\n -StaticComponents:\n"</font>,(<font class="keyword">const</font> <font class="keywordtype">char</font> *)<a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CMessageClass.html#a6">getType</a>());
00358 <font class="keywordflow">else</font>
00359 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"<undefined_class> (scripted)\n -StaticComponents:\n"</font>);
00360
00361 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_16">size</a>(); i++ )
00362 {
00363 std::string buf;
00364 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">" "</font>;
00365 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#a17">getComponent</a>(i) )
00366 {
00367 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#a26">getComponentName</a>(i);
00368 }
00369 <font class="keywordflow">else</font>
00370 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">"<unnamed>"</font>;
00371
00372 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">" "</font>;
00373 (*this)[i]->getDebugString(buf);
00374 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += buf;
00375 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">"\n"</font>;
00376
00377 }
00378 }
00379
<a name="l00380"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z163_0">00380</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CMessageScript::isEqual</a>(<font class="keyword">const</font> IBasicObjectIA &a)<font class="keyword"> const</font>
00381 <font class="keyword"> </font>{
00382 <font class="keywordflow">return</font> <a class="code" href="chain_8cpp.html#a2">IMessageBase::isEqual</a>(a);
00383 }
00384
<a name="l00385"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z164_5">00385</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CMessageScript::getType()<font class="keyword"> const</font>
00386 <font class="keyword"> </font>{
00387 <font class="keywordflow">if</font> ( _MessageClass )
00388 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#n0">_MessageClass</a>-><a class="code" href="classNLAISCRIPT_1_1CMessageClass.html#a6">getType</a>();
00389 <font class="keywordflow">else</font>
00390 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CMessageScript.html#p0">IdMessageScript</a>;
00391 }
00392
<a name="l00393"></a><a class="code" href="classNLAIAGENT_1_1CMessageScript.html#z162_9">00393</a> <font class="keyword">const</font> IObjectIA::CProcessResult &CMessageScript::run()
00394 {
00395 <font class="keywordflow">return</font> IObjectIA::ProcessRun;
00396 }
00397 }
</pre></div>
<!-- footer -->
<BR><FONT Size=+5> </FONT>
</TD>
<TD WIDTH=15><IMG SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|