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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
|
<!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='/'><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>agents.cpp</h1><a href="agents_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
00006 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00007 <font class="comment"> *</font>
00008 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00009 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00010 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00011 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00012 <font class="comment"> * any later version.</font>
00013 <font class="comment"></font>
00014 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00015 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00016 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00017 <font class="comment"> * General Public License for more details.</font>
00018 <font class="comment"></font>
00019 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00020 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00021 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00022 <font class="comment"> * MA 02111-1307, USA.</font>
00023 <font class="comment"> */</font>
00024 <font class="preprocessor">#include "<a class="code" href="agent_8h.html">nel/ai/agent/agent.h</a>"</font>
00025 <font class="preprocessor">#include "<a class="code" href="object__type_8h.html">nel/ai/agent/object_type.h</a>"</font>
00026 <font class="preprocessor">#include "<a class="code" href="agent__local__mailer_8h.html">nel/ai/agent/agent_local_mailer.h</a>"</font>
00027 <font class="preprocessor">#include "<a class="code" href="agent__digital_8h.html">nel/ai/agent/agent_digital.h</a>"</font>
00028 <font class="preprocessor">#include "<a class="code" href="agent__method__def_8h.html">nel/ai/agent/agent_method_def.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="interpret__object__message_8h.html">nel/ai/script/interpret_object_message.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="interpret__object__agent_8h.html">nel/ai/script/interpret_object_agent.h</a>"</font>
00031 <font class="preprocessor">#include "<a class="code" href="type__def_8h.html">nel/ai/script/type_def.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="msg__notify_8h.html">nel/ai/agent/msg_notify.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="object__ident_8h.html">nel/ai/agent/object_ident.h</a>"</font>
00034
00035 <font class="keyword">namespace </font>NLAIAGENT
00036 {
00037
<a name="l00038"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">00038</a> IAgent::IAgent(<font class="keyword">const</font> IAgent &a) : IAgentComposite(a)
00039 {
00040 <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.begin();
00041 }
00042
<a name="l00043"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a0">00043</a> IAgent::IAgent(IBasicAgent *parent): IAgentComposite(parent)
00044 {
00045 <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.begin();
00046 }
00047
<a name="l00048"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a1">00048</a> IAgent::IAgent(IBasicAgent *parent,IMailBox *m): IAgentComposite(parent,m)
00049 {
00050 <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.begin();
00051 }
00052
00053 <font class="comment">/* const IObjectIA::CProcessResult &IAgent::run();</font>
00054 <font class="comment"> IObjectIA *IAgent::run(const IMessageBase &);*/</font>
00055
00056
<a name="l00057"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a4">00057</a> <font class="keywordtype">void</font> IAgent::Kill()
00058 {
00059 <font class="comment">//sint n = _SizeChild;</font>
00060
00061 <font class="preprocessor">#ifdef NL_DEBUG</font>
00062 <font class="preprocessor"></font> <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n1">_SizeChild</a> != (sint)<a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.size())
00063 {
00064 sint i = (sint)<a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.size();
00065 <font class="keywordflow">throw</font>;
00066 }
00067
00068 <a class="code" href="debug_8h.html#a1">nlinfo</a> (<font class="stringliteral">" Kill 0x0%0x"</font>, <font class="keyword">this</font>);
00069
00070 <font class="preprocessor">#endif</font>
00071 <font class="preprocessor"></font> sint n = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n1">_SizeChild</a> ;
00072 <font class="keywordflow">while</font> ( <font class="comment">/*_AgentList.begin() != _AgentList.end()*/</font> n--)
00073 {
00074 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#b0">IConnectIA</a> *c = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.front();
00075 <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.pop_front();
00076 c->onKill(<font class="keyword">this</font>);
00077 c->release();
00078 }
00079 <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n1">_SizeChild</a> = 0;
00080 IAgentComposite::Kill();
00081 }
00082
<a name="l00083"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a5">00083</a> <font class="keywordtype">void</font> IAgent::onKill(IConnectIA *a)
00084 {
00085 <font class="keywordflow">if</font>(eraseFromList<IBasicAgent *>(&<a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>,(<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *)a))
00086 {
00087 a->release();
00088 <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n1">_SizeChild</a> --;
00089 }
00090 <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a8">removeConnection</a>(a);
00091 IAgentComposite::onKill(a);
00092 }
00093
<a name="l00094"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_0">00094</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *IAgent::clone()<font class="keyword"> const</font>
00095 <font class="keyword"> </font>{
00096 <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> *m = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">IAgent</a>(*<font class="keyword">this</font>);
00097 <font class="keywordflow">return</font> m;
00098 }
00099
<a name="l00100"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_1">00100</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *IAgent::newInstance()<font class="keyword"> const</font>
00101 <font class="keyword"> </font>{
00102 <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> *m;
00103 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() != NULL) m = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">IAgent</a>((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *)<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>());
00104 <font class="keywordflow">else</font> m = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">IAgent</a>(NULL);
00105 <font class="keywordflow">return</font> m;
00106 }
00107
<a name="l00108"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_2">00108</a> <font class="keywordtype">void</font> IAgent::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font>
00109 <font class="keyword"> </font>{
00110 <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">"class IAgent<%4x>"</font>,<font class="keyword">this</font>);
00111 }
00112
<a name="l00113"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a3">00113</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">IAgent::isEqual</a>(<font class="keyword">const</font> IBasicObjectIA &a)<font class="keyword"> const</font>
00114 <font class="keyword"> </font>{
00115 <font class="keywordflow">return</font> <font class="keyword">true</font>;
00116 }
00117
00118 <font class="comment">/*const NLAIC::CIdentType &IAgent::getType() const; </font>
00119 <font class="comment"> void IAgent::save(NLMISC::IStream &os);</font>
00120 <font class="comment"> void IAgent::load(NLMISC::IStream &is);*/</font>
00121
<a name="l00122"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#a2">00122</a> IAgent::~IAgent()
00123 {
00124 <a class="code" href="classNLAIAGENT_1_1IAgent.html#a4">Kill</a>();
00125 }
00126
<a name="l00127"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_4">00127</a> <font class="keywordtype">void</font> IAgent::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os)
00128 {
00129 IBasicAgent::save(os);
00130 IAgentComposite::save(os);
00131 }
00132
<a name="l00133"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_5">00133</a> <font class="keywordtype">void</font> IAgent::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is)
00134 {
00135 IBasicAgent::load(is);
00136 IAgentComposite::load(is);
00137 }
00138
<a name="l00139"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z117_1">00139</a> <font class="keywordtype">bool</font> IAgent::runChildrenStepByStep()
00140 {
00141 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> != <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.end())
00142 {
00143 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *c = *<a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a>;
00144
00145 <font class="keywordflow">if</font>(c->runStep().ResultState == <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#p1">ProcessNotComplit</a>.ResultState) <font class="keywordflow">return</font> <font class="keyword">false</font>;
00146
00147 <font class="keywordflow">if</font>(c->getState().ResultState == <a class="code" href="namespaceNLAIAGENT.html#a50a6">processToKill</a>)
00148 {
00149 <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> ++;
00150 <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#z115_2">removeChild</a>(c);
00151 }
00152 <font class="keywordflow">else</font> <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a>++;
00153
00154 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00155
00156 }
00157
00158 <a class="code" href="classNLAIAGENT_1_1IAgent.html#o0">_Iter_Child</a> = <a class="code" href="classNLAIAGENT_1_1IAgentComposite.html#n0">_AgentList</a>.begin();
00159 <font class="keywordflow">return</font> <font class="keyword">true</font>;
00160 }
00161
<a name="l00162"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z117_0">00162</a> <font class="keywordtype">void</font> IAgent::runChildren() <font class="comment">// Se charge de l'activation des fils</font>
00163 {
00164 <a class="code" href="classstd_1_1list.html">std::list<IBasicAgent *></a>::iterator i_agl = _AgentList.begin();
00165 sint n = _SizeChild;
00166
00167 <font class="preprocessor">#ifdef NL_DEBUG</font>
00168 <font class="preprocessor"></font> <font class="keywordflow">if</font>(n != (sint)_AgentList.size())
00169 <font class="keywordflow">throw</font>;
00170 <font class="preprocessor">#endif</font>
00171 <font class="preprocessor"></font>
00172 <font class="keywordflow">while</font> ( <font class="comment">/*i_agl != _AgentList.end()*/</font>n -- )
00173 {
00174 IBasicAgent *c = *i_agl;
00175
00176
00177 c->run();
00178 <font class="keywordflow">switch</font>(c->getState().ResultState)
00179 {
00180 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a50a6">processToKill</a>:
00181 {
00182 i_agl ++;
00183 removeChild(c);
00184 }
00185 <font class="keywordflow">break</font>;
00186 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a50a7">processPresKill</a>:
00187 {
00188 i_agl ++;
00189 c->incRef();
00190 removeChild(c);
00191 onKill(c);
00192 }
00193 <font class="keywordflow">break</font>;
00194 <font class="keywordflow">default</font>:
00195 i_agl ++;
00196 <font class="keywordflow">break</font>;
00197
00198 };
00199 }
00200 }
00201
<a name="l00202"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z119_0">00202</a> <font class="keywordtype">void</font> IAgent::processMessages()
00203 {
00204 IMailBox *mail = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a9">getMail</a>();
00205 <font class="comment">//const IMailBox::tListMessage &l = mail->getMesseageListe();</font>
00206 sint n = mail->size();
00207
00208 <font class="keywordflow">while</font>(<font class="comment">/*l.begin() != l.end()*/</font> n --)
00209 {
00210 <font class="keyword">const</font> IMessageBase &msg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a9">getMail</a>()->getMessage();
00211 <font class="preprocessor">#ifdef NL_DEBUG</font>
00212 <font class="preprocessor"></font> <font class="keyword">const</font> <font class="keywordtype">char</font> *msgBase = (<font class="keyword">const</font> <font class="keywordtype">char</font> *)msg.getType();
00213 <font class="keyword">const</font> <font class="keywordtype">char</font> *classBase = (<font class="keyword">const</font> <font class="keywordtype">char</font> *)<a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_3">getType</a>();
00214 <font class="preprocessor">#endif</font>
00215 <font class="preprocessor"></font> <font class="keywordflow">try</font>
00216 {
00217 (void)IBasicAgent::run( msg );
00218 mail->popMessage();
00219 }
00220 <font class="keywordflow">catch</font>(<a class="code" href="classNLAIE_1_1IException.html">NLAIE::IException</a> &)
00221 {
00222 <font class="comment">// We send an Error message because the incoming message isn't processed.</font>
00223 IMessageBase *o = (IMessageBase *)msg.clone();
00224 o->setMethodIndex(-1,-1);
00225 o->setSender(<font class="keyword">this</font>);
00226 o->setPerformatif(IMessageBase::PError);
00227 o->setReceiver((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getSender());
00228 ((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getSender())->sendMessage(o);
00229
00230 mail->popMessage();
00231 }
00232 }
00233 }
00234
00235 <font class="comment">/*std::string Shift="-";</font>
00236 <font class="comment"> sint kShift = 1;*/</font>
00237
<a name="l00238"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z119_1">00238</a> <font class="keyword">const</font> IObjectIA::CProcessResult &IAgent::run()
00239 {
00240 <font class="comment">/*nlinfo("%s<%4x> go to run %s with %d childs:",Shift.c_str(),this, (const char *)getType(),_AgentList.size());</font>
00241 <font class="comment"> Shift += "\t";</font>
00242 <font class="comment"> kShift++;*/</font>
00243
00244 <a class="code" href="classNLAIAGENT_1_1IAgent.html#z117_0">runChildren</a>(); <font class="comment">// Gestion des fils</font>
00245 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a9">getMail</a>()->run(); <font class="comment">// Execution de la boite aux lettres</font>
00246
00247 <a class="code" href="classNLAIAGENT_1_1IAgent.html#z119_0">processMessages</a>(); <font class="comment">// Traitement de ses propres messages</font>
00248
00249 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IAgent.html#a6">haveActivity</a>() && <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>().ResultState == <a class="code" href="namespaceNLAIAGENT.html#a50a2">processIdle</a>) <a class="code" href="classNLAIAGENT_1_1IAgent.html#a7">runActivity</a>();
00250
00251 <font class="comment">/*kShift --;</font>
00252 <font class="comment"> std::string chaine;</font>
00253 <font class="comment"> sint i;</font>
00254 <font class="comment"> for(i = 0; i < (sint)kShift; i ++)</font>
00255 <font class="comment"> {</font>
00256 <font class="comment"> chaine += Shift [i]; </font>
00257 <font class="comment"> }</font>
00258 <font class="comment"> Shift = chaine;*/</font>
00259
00260
00261 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>();
00262 }
00263
<a name="l00264"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z119_2">00264</a> <font class="keyword">const</font> IObjectIA::CProcessResult &IAgent::runStep()
00265 {
00266 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IAgent.html#z117_1">runChildrenStepByStep</a>())
00267 {
00268 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a9">getMail</a>()->run(); <font class="comment">// Execution de la boite aux lettres</font>
00269
00270 <a class="code" href="classNLAIAGENT_1_1IAgent.html#z119_0">processMessages</a>(); <font class="comment">// Traitement de ses propres messages</font>
00271
00272 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IAgent.html#a6">haveActivity</a>() && <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>().ResultState == <a class="code" href="namespaceNLAIAGENT.html#a50a2">processIdle</a>) <a class="code" href="classNLAIAGENT_1_1IAgent.html#a7">runActivity</a>();
00273 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">getState</a>();
00274 }
00275 <font class="keywordflow">else</font>
00276 <font class="keywordflow">return</font> IObjectIA::ProcessNotComplit;
00277 }
00278
<a name="l00279"></a><a class="code" href="classNLAIAGENT_1_1IAgent.html#z118_3">00279</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &IAgent::getType()<font class="keyword"> const</font>
00280 <font class="keyword"> </font>{
00281 <font class="keywordflow">return</font> *<a class="code" href="classNLAIAGENT_1_1IAgent.html#p0">IdAgent</a>;
00282 }
00283
00284
00287
<a name="l00288"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">00288</a> IBasicAgent::IBasicAgent(<font class="keyword">const</font> IBasicAgent &a): IConnectIA(a),_Mail((IMailBox *)a._Mail->clone())
00289 {
00290 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->setParent((<font class="keyword">const</font> IWordNumRef *) *<font class="keyword">this</font>);
00291 }
00292
00293
<a name="l00294"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a0">00294</a> IBasicAgent::IBasicAgent(<font class="keyword">const</font> IWordNumRef *parent): IConnectIA(parent)
00295 {
00296 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a> = <font class="keyword">new</font> <a class="code" href="namespaceNLAIAGENT.html#a0">tMailBoxLettre</a>((<font class="keyword">const</font> IWordNumRef *) *<font class="keyword">this</font>);
00297
00298 }
00299
<a name="l00300"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a1">00300</a> IBasicAgent::IBasicAgent(<font class="keyword">const</font> IWordNumRef *parent,IMailBox *m): IConnectIA(parent),_Mail(m)
00301 {
00302 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->setParent((<font class="keyword">const</font> IWordNumRef *) *<font class="keyword">this</font>);
00303 }
00304
<a name="l00305"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a2">00305</a> IBasicAgent::~IBasicAgent()
00306 {
00307 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->setParent(NULL);
00308 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->release();
00309 }
00310
<a name="l00311"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a3">00311</a> <font class="keyword">const</font> IObjectIA::CProcessResult &IBasicAgent::getState()<font class="keyword"> const </font>
00312 <font class="keyword"> </font>{
00313 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n0">_RunState</a>;
00314 }
00315
<a name="l00316"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a4">00316</a> <font class="keywordtype">void</font> IBasicAgent::setState(<a class="code" href="namespaceNLAIAGENT.html#a50">TProcessStatement</a> state, IObjectIA *result)
00317 {
00318 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n0">_RunState</a>.ResultState = state;
00319 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n0">_RunState</a>.Result = result;
00320 }
00321
<a name="l00322"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a5">00322</a> IObjectIA::CProcessResult IBasicAgent::sendMessage(IMessageBase *msg)
00323 {
00324 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->addMessage(msg);
00325 <font class="keywordflow">return</font> IObjectIA::ProcessRun;
00326 }
00327
<a name="l00328"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a6">00328</a> IObjectIA::CProcessResult IBasicAgent::sendMessage(IMessageBase *msg, IBasicAgent &receiver)
00329 {
00330 receiver.getMail()->addMessage( msg );
00331 <font class="keywordflow">return</font> IObjectIA::ProcessRun;
00332 }
00333
<a name="l00334"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a9">00334</a> IMailBox *IBasicAgent::getMail()<font class="keyword"> const</font>
00335 <font class="keyword"> </font>{
00336 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>;
00337 }
00338
<a name="l00339"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z113_0">00339</a> <font class="keywordtype">void</font> IBasicAgent::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os)
00340 {
00341 IConnectIA::save(os);
00342 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->save(os);
00343 }
00344
<a name="l00345"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z113_1">00345</a> <font class="keywordtype">void</font> IBasicAgent::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is)
00346 {
00347 IConnectIA::load(is);
00348 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->load(is);
00349 <a class="code" href="classNLAIC_1_1CIdentTypeAlloc.html">NLAIC::CIdentTypeAlloc</a> <a class="code" href="driver__opengl__extension__def_8h.html#a356">id</a>;
00350 }
00351
00352 <font class="comment">/*void IBasicAgent::addMsgGroup(IBasicMessageGroup &grp)</font>
00353 <font class="comment"> {</font>
00354 <font class="comment"> getMail()->addGroup( grp );</font>
00355 <font class="comment"> }</font>
00356 <font class="comment"></font>
00357 <font class="comment"> void IBasicAgent::removeMsgGroup(IBasicMessageGroup &grp)</font>
00358 <font class="comment"> {</font>
00359 <font class="comment"> getMail()->removeGroup( grp );</font>
00360 <font class="comment"> }*/</font>
00361
<a name="l00362"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b8">00362</a> <font class="keywordtype">void</font> IBasicAgent::onKill(IConnectIA *a)
00363 {
00364 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#n1">_Mail</a>->onKill(a);
00365 }
00366
<a name="l00367"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b1">00367</a> IObjectIA *IBasicAgent::run(<font class="keyword">const</font> IMessageBase &msg)
00368 {
00369 IMessageBase *returnMsg = NULL;
00370 <font class="keywordflow">switch</font>(msg.getPerformatif())
00371 {
00372 <font class="keywordflow">case</font> IMessageBase::PUndefine:
00373 {
00374 std::string text;
00375 text = <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"Function IObjectIA *IBasicAgent::run('%s') proccess an IMessageBase::PUndefine performatif"</font>,(<font class="keyword">const</font> <font class="keywordtype">char</font> *)msg.getType());
00376 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionNotImplemented.html">NLAIE::CExceptionNotImplemented</a>(text.c_str());
00377 }
00378 <font class="keywordflow">break</font>;
00379 <font class="keywordflow">case</font> IMessageBase::PExec:
00380
00381 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b2">runExec</a>(msg);
00382 <font class="keywordflow">if</font>(msg.getContinuation() != NULL)
00383 {
00384 returnMsg->incRef();
00385 ((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getContinuation())->sendMessage(returnMsg);
00386 }
00387 <font class="keywordflow">break</font>;
00388 <font class="keywordflow">case</font> IMessageBase::PAchieve:
00389 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b4">runAchieve</a>(msg);
00390 <font class="keywordflow">if</font>(msg.getContinuation() != NULL)
00391 {
00392 returnMsg->incRef();
00393 ((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getContinuation())->sendMessage(returnMsg);
00394 }
00395 <font class="keywordflow">break</font>;
00396 <font class="keywordflow">case</font> IMessageBase::PAsk:
00397 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b5">runAsk</a>(msg);
00398 returnMsg->setPerformatif(IMessageBase::PTell);
00399 returnMsg->incRef();
00400 ((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getSender())->sendMessage(returnMsg);
00401 <font class="keywordflow">if</font>(msg.getContinuation() != NULL)
00402 {
00403 returnMsg->incRef();
00404 ((<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *)msg.getContinuation())->sendMessage(returnMsg);
00405 }
00406 <font class="keywordflow">break</font>;
00407 <font class="keywordflow">case</font> IMessageBase::PTell:
00408 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b6">runTell</a>(msg);
00409
00410 <font class="keywordflow">break</font>;
00411 <font class="keywordflow">case</font> IMessageBase::PBreak:
00412 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b7">runBreak</a>(msg);
00413 <font class="keywordflow">break</font>;
00414 <font class="keywordflow">case</font> IMessageBase::PKill:
00415 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b9">runKill</a>(msg);
00416 <font class="keywordflow">break</font>;
00417 <font class="keywordflow">case</font> IMessageBase::PError:
00418 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b10">runError</a>(msg);
00419 <font class="keywordflow">break</font>;
00420
00421 <font class="keywordflow">case</font> IMessageBase::PEven:
00422 returnMsg = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b3">runEven</a>(msg);
00423 ((IMessageBase &)msg).setDispatch();
00424 <font class="keywordflow">break</font>;
00425 <font class="keywordflow">default</font>: <font class="keywordflow">break</font>;
00426 }
00427
00428 <font class="keywordflow">if</font>(returnMsg) returnMsg->release();
00429 <font class="keywordflow">return</font> NULL;
00430 }
00431
00432
00433 <font class="keyword">const</font> <font class="keyword">static</font> sint32 <a class="code" href="namespaceNLAIAGENT.html#a14">_GetMailer</a> = 0;
00434 <font class="keyword">const</font> <font class="keyword">static</font> sint32 <a class="code" href="namespaceNLAIAGENT.html#a15">_Father</a> = 1;
00435 <font class="keyword">const</font> <font class="keyword">static</font> sint32 <a class="code" href="namespaceNLAIAGENT.html#a16">_RunTel</a> = 2;
00436 <font class="keyword">const</font> <font class="keyword">static</font> sint32 <a class="code" href="namespaceNLAIAGENT.html#a17">_RunAsk</a> = 3;
00437 <font class="keyword">const</font> <font class="keyword">static</font> sint32 <a class="code" href="namespaceNLAIAGENT.html#a18">_GetNumId</a> = 4;
00438 <font class="keyword">const</font> <font class="keyword">static</font> sint32 _LastM = 5;
00439
<a name="l00440"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#r0">00440</a> IBasicAgent::CMethodCall IBasicAgent::_Method[] =
00441 {
00442 IBasicAgent::CMethodCall(<a class="code" href="agent__method__def_8h.html#a4">_MAILER_</a>,<a class="code" href="namespaceNLAIAGENT.html#a14">_GetMailer</a>),
00443 IBasicAgent::CMethodCall(<a class="code" href="agent__method__def_8h.html#a31">_FATHER_</a>,<a class="code" href="namespaceNLAIAGENT.html#a15">_Father</a>),
00444 IBasicAgent::CMethodCall(<a class="code" href="agent__method__def_8h.html#a6">_RUNTEL_</a>,<a class="code" href="namespaceNLAIAGENT.html#a16">_RunTel</a>),
00445 IBasicAgent::CMethodCall(<a class="code" href="agent__method__def_8h.html#a7">_RUNASK_</a>,<a class="code" href="namespaceNLAIAGENT.html#a17">_RunAsk</a>),
00446 IBasicAgent::CMethodCall(<a class="code" href="agent__method__def_8h.html#a10">_GETNUMID_</a>,<a class="code" href="namespaceNLAIAGENT.html#a18">_GetNumId</a>)
00447 };
00448
00449
<a name="l00450"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z114_0">00450</a> sint32 IBasicAgent::getMethodIndexSize()<font class="keyword"> const</font>
00451 <font class="keyword"> </font>{
00452 <font class="keywordflow">return</font> IObjectIA::getMethodIndexSize() + _LastM;
00453 }
00454
<a name="l00455"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z114_1">00455</a> <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> IBasicAgent::isMember(<font class="keyword">const</font> IVarName *className,<font class="keyword">const</font> IVarName *methodName,<font class="keyword">const</font> IObjectIA &p)<font class="keyword"> const</font>
00456 <font class="keyword"> </font>{
00457 <font class="keywordflow">if</font>(className == NULL)
00458 {
00459 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> a;
00460 <font class="keywordflow">for</font>(<font class="keywordtype">int</font> i = 0; i < _LastM; i++)
00461 {
00462 <font class="keywordflow">if</font>(*methodName == IBasicAgent::_Method[i].MethodName)
00463 {
00464 CObjectType *c;
00465 <font class="keywordflow">if</font>(i == <a class="code" href="namespaceNLAIAGENT.html#a16">_RunTel</a> || i == <a class="code" href="namespaceNLAIAGENT.html#a17">_RunAsk</a>)
00466 {
00467 <font class="keyword">static</font> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> paramMsg(1,<font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimple.html">NLAISCRIPT::COperandSimple</a> (<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAISCRIPT_1_1CMsgNotifyParentClass.html#p0">NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass</a>)));
00468
00469 <font class="keywordflow">if</font>(paramMsg.<a class="code" href="classNLAISCRIPT_1_1CParam.html#a5">eval</a>((<a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> &)p) < 0.0) <font class="keywordflow">continue</font>;
00470 c = <font class="keyword">new</font> CObjectType(<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAISCRIPT_1_1CMessageClass.html#p0">NLAISCRIPT::CMessageClass::IdMessageClass</a>));
00471 }
00472 <font class="keywordflow">else</font>
00473 <font class="keywordflow">if</font> (i == <a class="code" href="namespaceNLAIAGENT.html#a18">_GetNumId</a>)
00474 {
00475 c = <font class="keyword">new</font> CObjectType(<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(CStringType::IdStringType));
00476 }
00477 <font class="keywordflow">else</font>
00478 {
00479 c = <font class="keyword">new</font> CObjectType(<font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(CLocalAgentMail::LocalAgentMail));
00480 }
00481 a.push(CIdMethod(IBasicAgent::_Method[i].Index + IObjectIA::getMethodIndexSize(),0.0,NULL,c));
00482 <font class="keywordflow">break</font>;
00483 }
00484 }
00485
00486 <font class="keywordflow">if</font>(a.size()) <font class="keywordflow">return</font> a;
00487 <font class="keywordflow">else</font> <font class="keywordflow">return</font> IConnectIA::isMember(className,methodName,p);
00488 }
00489 <font class="keywordflow">return</font> IConnectIA::isMember(className,methodName,p);
00490 }
00491
<a name="l00492"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z114_2">00492</a> IObjectIA::CProcessResult IBasicAgent::runMethodeMember(sint32 h, sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,IObjectIA *p)
00493 {
00494 <font class="keywordflow">return</font> IConnectIA::runMethodeMember(h,<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,p);
00495 }
00496
<a name="l00497"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#z114_3">00497</a> IObjectIA::CProcessResult IBasicAgent::runMethodeMember(sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,IObjectIA *p)
00498 {
00499 IBaseGroupType *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a> = (IBaseGroupType *)p;
00500
00501 <font class="keywordflow">switch</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - IObjectIA::getMethodIndexSize())
00502 {
00503 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a14">_GetMailer</a>:
00504 {
00505 IObjectIA::CProcessResult a;
00506 a.Result = <font class="keyword">new</font> CLocalAgentMail(<font class="keyword">this</font>);
00507 <font class="keywordflow">return</font> a;
00508 }
00509 <font class="keywordflow">break</font>;
00510
00511 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a15">_Father</a>:
00512 {
00513 IObjectIA::CProcessResult a;
00514 <a class="code" href="classNLAIAGENT_1_1IRefrence.html#b0">IRefrence</a> *father = <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>();
00515 <font class="keywordflow">if</font> ( father )
00516 a.Result = <font class="keyword">new</font> CLocalAgentMail( (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *) father );
00517 <font class="keywordflow">else</font>
00518 {
00519 a.Result = &DigitalType::NullOperator;
00520 a.Result->incRef();
00521 }
00522 <font class="keywordflow">return</font> a;
00523 }
00524 <font class="keywordflow">break</font>;
00525
00526 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a17">_RunAsk</a>:
00527 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a16">_RunTel</a>:
00528 {
00529 IObjectIA::CProcessResult a;
00530 a.Result = <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#a15">run</a>((<font class="keyword">const</font> IMessageBase &)*<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>->get());
00531 <font class="keywordflow">return</font> a;
00532 }
00533 <font class="keywordflow">break</font>;
00534
00535 <font class="keywordflow">case</font> <a class="code" href="namespaceNLAIAGENT.html#a18">_GetNumId</a>:
00536 {
00537 IObjectIA::CProcessResult a;
00538 std::string <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
00539 ((<font class="keyword">const</font> IWordNumRef &)*<font class="keyword">this</font>).getNumIdent().getDebugString(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>);
00540 a.Result = <font class="keyword">new</font> CStringType(CStringVarName(<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>.c_str()));
00541 <font class="keywordflow">return</font> a;
00542 }
00543 <font class="keywordflow">break</font>;
00544
00545 }
00546 <font class="keywordflow">return</font> IConnectIA::runMethodeMember(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,p);
00547 }
00548
<a name="l00549"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b5">00549</a> IMessageBase *IBasicAgent::runAsk(<font class="keyword">const</font> IMessageBase &m)
00550 {
00551 <font class="keywordflow">if</font>(<a class="code" href="classNLAISCRIPT_1_1CMsgNotifyParentClass.html#p0">NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass</a> == m.getType())
00552 {
00553 <font class="keywordflow">if</font>(<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() != NULL)
00554 {
00555 CNotifyParentScript *msg = <font class="keyword">new</font> CNotifyParentScript();
00556 <font class="keywordflow">return</font> msg;
00557 }
00558 <font class="keywordflow">else</font>
00559 {
00560 CNotifyParentScript *msg = <font class="keyword">new</font> CNotifyParentScript((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *)<a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>());
00561 <font class="keywordflow">return</font> msg;
00562 }
00563 }
00564 <font class="keywordflow">else</font>
00565 {
00566 std::string debugString;
00567 std::string text;
00568 <a class="code" href="classNLAIC_1_1IBasicType.html#a5">getDebugString</a>(debugString);
00569 text += <a class="code" href="namespaceNLAIC.html#a5">NLAIC::stringGetBuild</a>(<font class="stringliteral">"runAsk(%s) note implementaited for the '%s' interface for the instence '%s'"</font>,(<font class="keyword">const</font> <font class="keywordtype">char</font> *)m.getType(),(<font class="keyword">const</font> <font class="keywordtype">char</font> *)<a class="code" href="classNLAIC_1_1IBasicType.html#a2">getType</a>(),debugString.c_str());
00570 <font class="keywordflow">throw</font> <a class="code" href="classNLAIE_1_1CExceptionNotImplemented.html">NLAIE::CExceptionNotImplemented</a>(text.c_str());
00571 <font class="keywordflow">return</font> NULL;
00572 }
00573 }
00574
<a name="l00575"></a><a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b6">00575</a> IMessageBase *IBasicAgent::runTell(<font class="keyword">const</font> IMessageBase &m)
00576 {
00577 <font class="keywordflow">if</font>(<a class="code" href="classNLAISCRIPT_1_1CMsgNotifyParentClass.html#p0">NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass</a> == m.getType())
00578 {
00579 <font class="comment">/*const INombreDefine *n = (const INombreDefine *)m.getFront();</font>
00580 <font class="comment"> if(n->getNumber() != 0.0)</font>
00581 <font class="comment"> {</font>
00582 <font class="comment"> const CLocalAgentMail *parent = (const CLocalAgentMail *)m.get();</font>
00583 <font class="comment"> }*/</font>
00584 <font class="keywordflow">return</font> (IMessageBase *)m.clone();
00585 }
00586 <font class="keywordflow">else</font>
00587 {
00588 <font class="comment">/* std::string debugString;</font>
00589 <font class="comment"> std::string text;</font>
00590 <font class="comment"> getDebugString(debugString);</font>
00591 <font class="comment"> text += NLAIC::stringGetBuild("runTell(%s) note implementaited for the '%s' interface for the instence '%s'",(const char *)m.getType(),(const char *)getType(),debugString.c_str());</font>
00592 <font class="comment"> throw NLAIE::CExceptionNotImplemented(text.c_str()); */</font>
00593 <font class="keywordflow">return</font> NULL;
00594 }
00595 }
00596 }
</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>
|