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
|
<!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>valueset.cpp</h1><a href="valueset_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00002 <font class="comment"> *</font>
00003 <font class="comment"> * This file is part of NEVRAX <MODULE_NAME>.</font>
00004 <font class="comment"> * NEVRAX <MODULE_NAME> is free software; you can redistribute it and/or modify</font>
00005 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00006 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00007 <font class="comment"> * any later version.</font>
00008 <font class="comment"></font>
00009 <font class="comment"> * NEVRAX <MODULE_NAME> is distributed in the hope that it will be useful, but</font>
00010 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00011 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00012 <font class="comment"> * General Public License for more details.</font>
00013 <font class="comment"></font>
00014 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00015 <font class="comment"> * along with NEVRAX <MODULE_NAME>; see the file COPYING. If not, write to the</font>
00016 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00017 <font class="comment"> * MA 02111-1307, USA.</font>
00018 <font class="comment"> */</font>
00019
00020 <font class="preprocessor">#include "<a class="code" href="valueset_8h.html">nel/ai/logic/valueset.h</a>"</font>
00021 <font class="preprocessor">#include "<a class="code" href="var_8h.html">nel/ai/logic/var.h</a>"</font>
00022 <font class="preprocessor">#include "<a class="code" href="boolval_8h.html">nel/ai/logic/boolval.h</a>"</font>
00023 <font class="preprocessor">#include "<a class="code" href="clause_8h.html">nel/ai/logic/clause.h</a>"</font>
00024 <font class="preprocessor">#include "<a class="code" href="ai__assert_8h.html">nel/ai/logic/ai_assert.h</a>"</font>
00025
00026 <font class="keyword">namespace </font>NLAILOGIC
00027 {
00028 <font class="keyword">using</font> <font class="keyword">namespace </font>NLAIAGENT;
00029
<a name="l00030"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#p1">00030</a> <font class="keyword">const</font> <a class="code" href="namespaceNLAIAGENT.html#a50">TProcessStatement</a> CValueSet::state = <a class="code" href="namespaceNLAIAGENT.html#a50a2">processIdle</a>;
00031
<a name="l00032"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">00032</a> CValueSet::CValueSet()
00033 {
00034 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = 0;
00035 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = NULL;
00036 }
00037
<a name="l00039"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a1">00039</a> CValueSet::CValueSet(sint32 size)
00040 {
00041 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">size</a>;
00042 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00043
00044 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00045 {
00046 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = NULL;
00047 }
00048 }
00049
<a name="l00051"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a2">00051</a> CValueSet::CValueSet(<font class="keyword">const</font> CValueSet &cp)
00052 {
00053 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = cp._NbValues;
00054
00055 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00056
00057 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00058 {
00059 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] = (<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *) cp._Values[i];
00060
00061 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00062 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00063 }
00064 }
00065
<a name="l00067"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a3">00067</a> CValueSet::CValueSet(std::vector<IBaseVar *> &vars)
00068 {
00069 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = vars.size();
00070
00071 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00072
00073 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00074 {
00075 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = vars[i]->getValue();
00076
00077 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00078 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00079 }
00080 }
00081
00082 <font class="comment">// Construit un valueSet � partir d'un autre en changeant la position des valeurs:</font>
00083 <font class="comment">// pos = positions dans le nouveau CValueSet des valeurs du premier.</font>
00084
<a name="l00087"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a4">00087</a> CValueSet::CValueSet(CValueSet *vals, std::vector<sint32> &pos)
00088 {
00089 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = pos.size();
00090
00091 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00092
00093 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00094 {
00095 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = NULL;
00096 }
00097
00098 std::vector<sint32>::iterator it_pos = pos.begin();
00099 sint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> = 0;
00100 <font class="keywordflow">while</font> ( it_pos != pos.end() )
00101 {
00102 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> ] = vals->_Values[ *it_pos ];
00103 it_pos++;
00104 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>++;
00105 }
00106 }
00107
00109 CValueSet::CValueSet(sint32 size, <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> *vals, std::vector<sint32> &pos)
00110 {
00111 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">size</a>;
00112
00113 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00114
00115 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00116 {
00117 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = NULL;
00118 }
00119
00120 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a>::iterator it_val = vals->begin();
00121 std::vector<sint32>::iterator it_pos = pos.begin();
00122
00123 <font class="keywordflow">while</font> ( it_val != vals->end() && it_pos != pos.end() )
00124 {
00125 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ *it_pos ] = *it_val;
00126 (*it_val)->incRef();
00127 it_val++;
00128 it_pos++;
00129 }
00130 }
00131
<a name="l00132"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a6">00132</a> CValueSet::~CValueSet()
00133 {
00134 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00135 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00136 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a3">release</a>();
00137 <font class="keyword">delete</font>[] <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>;
00138 }
00139
<a name="l00140"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a8">00140</a> <font class="keywordtype">void</font> CValueSet::setValue(sint32 pos, IObjectIA *obj)
00141 {
00142 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[pos] = obj;
00143 <font class="keywordflow">if</font> ( obj )
00144 obj-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00145 }
00146
00147 <font class="comment">// Unification d'un CValueSet ave un autre.</font>
00148 <font class="comment">// Renvoie NULL si l'unification �choue, </font>
00149 <font class="comment">// Un nouveau CValueSet corrrespondant � la l'unification si r�ussit</font>
00150
00151
<a name="l00155"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a9">00155</a> CValueSet *CValueSet::unify(<font class="keyword">const</font> CValueSet *un)<font class="keyword"> const</font>
00156 <font class="keyword"> </font>{
00157 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> *result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a>( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> );
00158 <font class="keywordtype">int</font> i;
00159 <font class="keywordflow">for</font>( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00160 {
00161 result->_Values[i] = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i];
00162 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00163 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00164
00165 }
00166
00167 <font class="keywordflow">for</font> (i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ; i++ )
00168 {
00169 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *x_val = result->_Values[ i ];
00170 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *y_val = un->_Values[ i ];
00171
00172 <font class="comment">/* if ( !x_val && !y_val )</font>
00173 <font class="comment"> result->_Values[i] = NULL ;</font>
00174 <font class="comment">*/</font>
00175 <font class="keywordflow">if</font> ( x_val && y_val )
00176 {
00177 <font class="comment">// IObjectIA *test;</font>
00178 <font class="keywordflow">if</font> ( (*x_val) == ( *y_val ) )
00179 {
00180 <font class="comment">// Nothing to do </font>
00181 }
00182 <font class="keywordflow">else</font>
00183 {
00184 result->release();
00185 <font class="keywordflow">return</font> NULL;
00186 }
00187 <font class="comment">// test->release();</font>
00188 }
00189 <font class="keywordflow">else</font>
00190 {
00191 <font class="keywordflow">if</font> ( y_val )
00192 {
00193 result->_Values[i] = y_val;
00194 result->_Values[i]->incRef();
00195 }
00196 }
00197 }
00198 <font class="keywordflow">return</font> result;
00199 }
00200
00202 CValueSet *CValueSet::unify(<a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> *vals, std::vector<sint32> &pos_vals)<font class="keyword"> const</font>
00203 <font class="keyword"> </font>{
00204 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> *result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a>( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> );
00205 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00206 {
00207 result->_Values[i] = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i];
00208 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00209 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00210
00211 }
00212
00213 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a>::iterator it_val = vals->begin();
00214 std::vector<sint32>::iterator it_pos = pos_vals.begin();
00215
00216 <font class="comment">// -----------------</font>
00217
00218 <font class="preprocessor">#ifdef NL_DEBUG</font>
00219 <font class="preprocessor"></font> std::string buf;
00220 this-><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a17">getDebugString</a>(buf);
00221 std::string buf2;
00222 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> tmp(<a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>, vals, pos_vals);
00223 tmp.getDebugString(buf2);
00224 <font class="preprocessor">#endif</font>
00225 <font class="preprocessor"></font> <font class="comment">//TRACE(" \nUNIFICATION:\n VS = %s\n VP = %s \n", buf, buf2);</font>
00226
00227 <font class="comment">// -----------------</font>
00228
00229 <font class="keywordflow">while</font> ( it_val != vals->end() && it_pos != pos_vals.end() )
00230 {
00231 sint32 pos = *it_pos;
00232 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *l_val = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ pos ];
00233 <font class="comment">// IObjectIA *test = NULL;</font>
00234 <font class="keywordflow">if</font> ( !l_val || ( (*l_val) == ( **it_val ) ) )
00235 {
00236 <font class="comment">// if ( test )</font>
00237 <font class="comment">// test->release();</font>
00238 result->_Values[ pos ] = *it_val;
00239 result->_Values[ pos ]->incRef();
00240 }
00241 <font class="keywordflow">else</font>
00242 {
00243 <font class="comment">// if ( test )</font>
00244 <font class="comment">// test->release();</font>
00245 <font class="keyword">delete</font> result;
00246 <font class="keywordflow">return</font> NULL;
00247 }
00248 it_val++;
00249 it_pos++;
00250
00251 }
00252
00253 <font class="keywordflow">return</font> result;
00254 }
00255
<a name="l00256"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a11">00256</a> CValueSet *CValueSet::unify(CValueSet *vals, std::vector<sint32> &pos_vals)<font class="keyword"> const</font>
00257 <font class="keyword"> </font>{
00258 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> *result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a>( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> );
00259 <font class="keywordtype">int</font> i;
00260 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00261 {
00262 result->_Values[i] = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i];
00263 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00264 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00265
00266 }
00267
00268 <font class="keywordflow">for</font> (i = 0; i < (sint32) pos_vals.size(); i++ )
00269 {
00270 sint32 pos = pos_vals[i];
00271 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *l_val = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ pos ];
00272 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *r_val = (*vals)[i];
00273 <font class="comment">// IObjectIA *test = NULL;</font>
00274 <font class="comment">// if ( !l_val || !( test = (*l_val) != ( *r_val ) )->isTrue() )</font>
00275 <font class="keywordflow">if</font> ( !l_val || ( (*l_val) == ( *r_val ) ) )
00276 {
00277 <font class="comment">// if ( test )</font>
00278 <font class="comment">// test->release();</font>
00279 <font class="keywordflow">if</font> ( !l_val )
00280 {
00281 result->_Values[ pos ] = r_val;
00282 <font class="keywordflow">if</font> ( (*vals)[i] )
00283 result->_Values[ pos ]->incRef();
00284 }
00285 }
00286 <font class="keywordflow">else</font>
00287 {
00288 <font class="comment">// if ( test )</font>
00289 <font class="comment">// test->release();</font>
00290 result->release();
00291 <font class="keywordflow">return</font> NULL;
00292 }
00293 }
00294 <font class="keywordflow">return</font> result;
00295 }
00296
00297
<a name="l00298"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a12">00298</a> <font class="keywordtype">bool</font> CValueSet::operator==(CValueSet *cp)
00299 {
00300 <font class="keywordflow">if</font>( cp->_NbValues != <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> )
00301 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00302
00303 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00304 <font class="keywordflow">if</font> ( cp->_Values[i] != <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00305 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00306 <font class="keywordflow">return</font> <font class="keyword">true</font>;
00307 }
00308
<a name="l00309"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a13">00309</a> IObjectIA *CValueSet::operator[](sint32 pos)
00310 {
00311 <font class="keywordflow">if</font> ( pos <= <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> )
00312 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[pos];
00313 <font class="keywordflow">else</font>
00314 <font class="keywordflow">return</font> NULL; <font class="comment">// TODO: exception!!!!!!!!!!!!</font>
00315 }
00316
<a name="l00317"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a7">00317</a> IObjectIA *CValueSet::getValue(sint32 pos)
00318 {
00319 <font class="keywordflow">if</font> ( pos <= <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> )
00320 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[pos];
00321 <font class="keywordflow">else</font>
00322 <font class="keywordflow">return</font> NULL; <font class="comment">// TODO: exception!!!!!!!!!!!!</font>
00323 }
00324
<a name="l00326"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a15">00326</a> sint32 CValueSet::undefined()<font class="keyword"> const</font>
00327 <font class="keyword"> </font>{
00328 sint32 nb_undef = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>;
00329 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00330 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] != NULL )
00331 nb_undef--;
00332 <font class="keywordflow">return</font> nb_undef;
00333 }
00334
<a name="l00335"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">00335</a> sint32 <a class="code" href="cf__lexical_8cpp.html#a94">CValueSet::size</a>()
00336 {
00337 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>;
00338 }
00339
<a name="l00341"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a16">00341</a> <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> *CValueSet::getValues()
00342 {
00343 <font class="comment">// Warning: this list must be deleted after use!!!</font>
00344 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> *result = <font class="keyword">new</font> <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a>;
00345 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00346 {
00347 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00348 result->push_back( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] );
00349 }
00350 <font class="keywordflow">return</font> result;
00351 }
00352
<a name="l00353"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a18">00353</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CValueSet::clone()<font class="keyword"> const</font>
00354 <font class="keyword"> </font>{
00355 <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *tmp = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a>( *<font class="keyword">this</font> );
00356 <font class="keywordflow">return</font> tmp;
00357 }
00358
<a name="l00359"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a19">00359</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CValueSet::newInstance()<font class="keyword"> const</font>
00360 <font class="keyword"> </font>{
00361 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a18">clone</a>();
00362 }
00363
<a name="l00364"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a20">00364</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CValueSet::getType()<font class="keyword"> const</font>
00365 <font class="keyword"> </font>{
00366 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#p0">IdValueSet</a>;
00367 }
00368
<a name="l00369"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a21">00369</a> <font class="keywordtype">void</font> CValueSet::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os)
00370 {
00371 sint32 nb_Values = (sint32) <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>;
00372 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( nb_Values );
00373 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> values;
00374 std::vector<sint32> pos;
00375
00376 <font class="keywordflow">for</font> ( sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00377 {
00378 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00379 {
00380 values.push_back( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] );
00381 pos.push_back( i );
00382 }
00383 }
00384 sint32 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">size</a> = (sint32) values.size();
00385 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">size</a> );
00386
00387 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a>::iterator it_val = values.begin();
00388 std::vector<sint32>::iterator it_pos = pos.begin();
00389
00390 <font class="keywordflow">while</font> ( it_val != values.end() )
00391 {
00392 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( (<a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &) ( *it_val )->getType() );
00393 ( *it_val )->save( os );
00394 sint32 ip = (sint32) *it_pos;
00395 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( ip );
00396 }
00397 }
00398
<a name="l00399"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a22">00399</a> <font class="keywordtype">void</font> CValueSet::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is)
00400 {
00401 <font class="comment">// Deletes the old table</font>
00402 <font class="keywordtype">int</font> i;
00403 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00404 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00405 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a3">release</a>();
00406 <font class="keyword">delete</font>[] <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>;
00407
00408 <font class="comment">// Creates the new one</font>
00409 sint32 nb_Values;
00410 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( nb_Values );
00411 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = (sint32) nb_Values;
00412 sint32 nbvals;
00413 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( nbvals );
00414
00415 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00416
00417 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00418 {
00419 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = NULL;
00420 }
00421
00422 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> vals;
00423 std::vector<sint32> pos;
00424
00425 <font class="keywordflow">for</font> ( i = 0; i < nbvals; i++ )
00426 {
00427 <a class="code" href="classNLAIC_1_1CIdentTypeAlloc.html">NLAIC::CIdentTypeAlloc</a> <a class="code" href="driver__opengl__extension__def_8h.html#a356">id</a>;
00428 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( id );
00429 <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *tmp_val = (<a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *) id.<a class="code" href="classNLAIC_1_1CIdentTypeAlloc.html#a3">allocClass</a>();
00430 tmp_val->load( is );
00431 tmp_val->incRef();
00432 vals.push_back( tmp_val );
00433 }
00434 }
00435
<a name="l00436"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a17">00436</a> <font class="keywordtype">void</font> CValueSet::getDebugString(std::string &txt)<font class="keyword"> const</font>
00437 <font class="keyword"> </font>{
00438 std::string buf;
00439 txt += <font class="stringliteral">" <CValueSet> "</font>;
00440 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00441 {
00442 txt += <font class="stringliteral">" , "</font>;
00443 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00444 {
00445 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IBasicType.html#a5">getDebugString</a>( buf );
00446
00447 txt += buf ;
00448 }
00449 <font class="keywordflow">else</font> txt += <font class="stringliteral">"NULL"</font>;
00450 }
00451 }
00452
<a name="l00453"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a23">00453</a> IObjetOp *CValueSet::operator ! ()<font class="keyword"> const</font>
00454 <font class="keyword"> </font>{
00455 CBoolType *result = <font class="keyword">new</font> CBoolType ( !<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a27">isTrue</a>() );
00456 <font class="keywordflow">return</font> result;
00457 }
00458
<a name="l00459"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a24">00459</a> IObjectIA *CValueSet::operator != (IObjectIA &a)<font class="keyword"> const</font>
00460 <font class="keyword"> </font>{
00461 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> != ((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)a)._NbValues )
00462 {
00463 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">false</font> );
00464 <font class="keywordflow">return</font> result;
00465 }
00466
00467
00468 <font class="keywordflow">for</font> (sint32 i = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00469 {
00470 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] != ((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)a)._Values[i] )
00471 {
00472 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">false</font> );
00473 <font class="keywordflow">return</font> result;
00474 }
00475
00476 }
00477 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">true</font> );
00478 <font class="keywordflow">return</font> result;
00479 }
00480
<a name="l00481"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a25">00481</a> IObjectIA *CValueSet::operator == (IObjectIA &a)<font class="keyword"> const</font>
00482 <font class="keyword"> </font>{
00483 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> != ((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)a)._NbValues )
00484 {
00485 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">false</font> );
00486 <font class="keywordflow">return</font> result;
00487 }
00488
00489 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00490 {
00491 <font class="keywordtype">bool</font> test_result = (*<a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]) == *((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)a)._Values[i];
00492 <font class="comment">/* IObjectIA *test = (*_Values[i]) != *((CValueSet &)a)._Values[i];</font>
00493 <font class="comment"> bool test_result = test->isTrue();</font>
00494 <font class="comment"> test->release(); */</font>
00495 <font class="keywordflow">if</font> ( !test_result )
00496 {
00497 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">false</font> );
00498 <font class="keywordflow">return</font> result;
00499 }
00500 }
00501 CBoolType *result = <font class="keyword">new</font> CBoolType ( <font class="keyword">true</font> );
00502 <font class="keywordflow">return</font> result;
00503 }
00504
<a name="l00505"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a26">00505</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CValueSet::isEqual</a>(<font class="keyword">const</font> IBasicObjectIA &cmp)<font class="keyword"> const</font>
00506 <font class="keyword"> </font>{
00507 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> != ((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)cmp)._NbValues )
00508 {
00509 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00510 }
00511
00512 <font class="keywordflow">for</font> (sint32 i = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00513 {
00514 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] != ((<a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> &)cmp)._Values[i] )
00515 {
00516 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00517 }
00518 }
00519 <font class="keywordflow">return</font> <font class="keyword">true</font>;
00520 }
00521
<a name="l00522"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a27">00522</a> <font class="keywordtype">bool</font> CValueSet::isTrue()<font class="keyword"> const</font>
00523 <font class="keyword"> </font>{
00524 <font class="keywordflow">return</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a15">undefined</a>() == (sint32) 0 );
00525 }
00526
<a name="l00527"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a28">00527</a> <font class="keyword">const</font> IObjectIA::CProcessResult &CValueSet::run()
00528 {
00529 <font class="keywordflow">return</font> IObjectIA::ProcessRun;
00530 }
00531
<a name="l00532"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a29">00532</a> CValueSet *CValueSet::forward(CClause *clause,std::vector<sint32> &pos)
00533 {
00534 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a> *result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a0">CValueSet</a>( clause->nbVars() );
00535
00536 std::vector<sint32>::iterator it_pos = pos.begin();
00537
00538 <font class="keywordflow">for</font> (sint32 i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00539 {
00540 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i] )
00541 {
00542 result->_Values[ *it_pos ] = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i];
00543 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00544 it_pos++;
00545 }
00546 }
00547 <font class="keywordflow">return</font> result;
00548 }
00549
<a name="l00550"></a><a class="code" href="classNLAILOGIC_1_1CValueSet.html#a30">00550</a> <font class="keywordtype">void</font> CValueSet::setSize(sint32 size)
00551 {
00552 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> = <a class="code" href="classNLAILOGIC_1_1CValueSet.html#a14">size</a>;
00553 sint32 i;
00554
00555 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> != NULL )
00556 {
00557 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ );
00558 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[i]-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a3">release</a>();
00559 <font class="keyword">delete</font> <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>;
00560 }
00561
00562 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a> = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *[ <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a> ];
00563
00564 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n1">_NbValues</a>; i++ )
00565 {
00566 <a class="code" href="classNLAILOGIC_1_1CValueSet.html#n0">_Values</a>[ i ] = NULL;
00567 }
00568 }
00569 }
</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>
|