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
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NLMISC::CTaskManager class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLMISC::CTaskManager Class Reference</h1><code>#include <<a class="el" href="a06486.html">task_manager.h</a>></code>
<p>
<p>Inheritance diagram for NLMISC::CTaskManager:
<p><center><img src="a02216.png" usemap="#NLMISC::CTaskManager_map" border="0" alt=""></center>
<map name="NLMISC::CTaskManager_map">
<area href="a02187.html" alt="NLMISC::IRunnable" shape="rect" coords="0,0,182,24">
<area href="a02215.html" alt="NLMISC::CAsyncFileManager" shape="rect" coords="0,112,182,136">
</map>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="a02216.html">CTaskManager</a> is a class that manage a list of Task with one Thread <dl compact><dt><b>Author:</b></dt><dd>Alain Saffray <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00055">55</a> of file <a class="el" href="a06486.html">task_manager.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera0">addTask</a> (<a class="el" href="a02187.html">IRunnable</a> *, float priority=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a task to TaskManager and its priority. <a href="#NLMISC_1_1CTaskManagera0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera1">CTaskManager</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLMISC_1_1CTaskManagera1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera2">deleteTask</a> (<a class="el" href="a02187.html">IRunnable</a> *<a class="el" href="a04223.html#a628">r</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a task, only if task is not running, return true if found and deleted. <a href="#NLMISC_1_1CTaskManagera2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera3">dump</a> (std::vector< std::string > &result)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Dump task list. <a href="#NLMISC_1_1CTaskManagera3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02187.html#NLMISC_1_1IRunnablePosa0">getName</a> (std::string &result) const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera5">getNumWaitingTasks</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get number of waiting task. <a href="#NLMISC_1_1CTaskManagera5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera6">isTaskRunning</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Is there a current task ? <a href="#NLMISC_1_1CTaskManagera6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera7">isThreadRunning</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">return false if exit() is required. task added with <a class="el" href="a02216.html#NLMISC_1_1CTaskManagera0">addTask()</a> should test this flag. <a href="#NLMISC_1_1CTaskManagera7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera8">registerTaskPriorityCallback</a> (<a class="el" href="a03470.html">IChangeTaskPriority</a> *callback)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Register task priority callback. <a href="#NLMISC_1_1CTaskManagera8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera9">run</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Manage TaskQueue. <a href="#NLMISC_1_1CTaskManagera9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera10">sleepTask</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sleep a Task. <a href="#NLMISC_1_1CTaskManagera10"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera11">taskListSize</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Task list size. <a href="#NLMISC_1_1CTaskManagera11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagera12">~CTaskManager</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructeur. <a href="#NLMISC_1_1CTaskManagera12"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerb0">waitCurrentTaskToComplete</a> ()</td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>CSynchronized< std::list<<br>
std::string > > </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp0">_DoneTaskQueue</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>CSynchronized< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp1">_RunningTask</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">queue of tasks, using list container instead of queue for DeleteTask methode <a href="#NLMISC_1_1CTaskManagerp1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>CSynchronized< std::list<<br>
<a class="el" href="a03469.html">CWaitingTask</a> > > </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp2">_TaskQueue</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03880.html">IThread</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp3">_Thread</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">thread pointer <a href="#NLMISC_1_1CTaskManagerp3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">flag indicate thread loop, if false cause thread exit <a href="#NLMISC_1_1CTaskManagerp4"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerd0">changeTaskPriority</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Register task priority callback. <a href="#NLMISC_1_1CTaskManagerd0"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03470.html">IChangeTaskPriority</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerr0">_ChangePriorityCallback</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The callback. <a href="#NLMISC_1_1CTaskManagerr0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a></td></tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NLMISC_1_1CTaskManagera1" doxytag="NLMISC::CTaskManager::CTaskManager" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLMISC::CTaskManager::CTaskManager </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00039">39</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00108">_ChangePriorityCallback</a>, <a class="el" href="a06486.html#l00158">_IsTaskRunning</a>, <a class="el" href="a06486.html#l00146">_RunningTask</a>, <a class="el" href="a06486.html#l00151">_Thread</a>, <a class="el" href="a06486.html#l00154">_ThreadRunning</a>, and <a class="el" href="a03880.html#NLMISC_1_1IThreada4">NLMISC::IThread::start()</a>.
<p>
<div class="fragment"><pre>00039 : <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp1">_RunningTask</a> (<span class="stringliteral">""</span>), <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp2">_TaskQueue</a> (<span class="stringliteral">""</span>), <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp0">_DoneTaskQueue</a> (<span class="stringliteral">""</span>)
00040 {
00041 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a> = <span class="keyword">false</span>;
00042 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a> = <span class="keyword">true</span>;
00043 CSynchronized<string>::CAccessor currentTask(&_RunningTask);
00044 currentTask.value () = <span class="stringliteral">""</span>;
00045 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp3">_Thread</a> = IThread::create(<span class="keyword">this</span>);
00046 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp3">_Thread</a>->start();
00047 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr0">_ChangePriorityCallback</a> = NULL;
00048 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera12" doxytag="NLMISC::CTaskManager::~CTaskManager" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLMISC::CTaskManager::~<a class="el" href="a02216.html">CTaskManager</a> </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Destructeur.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00053">53</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00154">_ThreadRunning</a>, and <a class="el" href="a05586.html#l00073">NLMISC::nlSleep()</a>.
<p>
<div class="fragment"><pre>00054 {
00055 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a> = <span class="keyword">false</span>;
00056 <span class="keywordflow">while</span>(!<a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a>)
00057 <a class="code" href="a05378.html#a256">nlSleep</a>(10);
00058 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLMISC_1_1CTaskManagera0" doxytag="NLMISC::CTaskManager::addTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::addTask </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02187.html">IRunnable</a> * </td>
<td class="mdname" nowrap>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>priority</em> = 0</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Add a task to TaskManager and its priority.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00126">126</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a05646.html#l00993">r</a>.
<p>
Referenced by <a class="el" href="a05455.html#l00067">NLMISC::CAsyncFileManager::addLoadTask()</a>, <a class="el" href="a06770.html#l00080">NL3D::CZoneManager::checkZonesAround()</a>, <a class="el" href="a05455.html#l00149">NLMISC::CAsyncFileManager::loadFile()</a>, <a class="el" href="a05455.html#l00156">NLMISC::CAsyncFileManager::loadFiles()</a>, and <a class="el" href="a05455.html#l00163">NLMISC::CAsyncFileManager::signal()</a>.
<p>
<div class="fragment"><pre>00127 {
00128 CSynchronized<std::list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00129 acces.value().push_back(CWaitingTask(r, priority));
00130 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerd0" doxytag="NLMISC::CTaskManager::changeTaskPriority" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::changeTaskPriority </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Register task priority callback.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00216">216</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00108">_ChangePriorityCallback</a>, <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a03470.html#NLMISC_1_1CTaskManager_1_1IChangeTaskPrioritya0">NLMISC::CTaskManager::IChangeTaskPriority::getTaskPriority()</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00061">run()</a>.
<p>
<div class="fragment"><pre>00217 {
00218 <span class="keywordflow">if</span> (<a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr0">_ChangePriorityCallback</a>)
00219 {
00220 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00221 <a class="code" href="a03889.html">list<CWaitingTask></a> &taskList = acces.value();
00222
00223 <a class="code" href="a03889.html">list<CWaitingTask></a>::iterator ite = taskList.begin();
00224 <span class="keywordflow">while</span>(ite != taskList.end())
00225 {
00226 <span class="comment">// Get the new priority</span>
00227 ite->Priority = <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr0">_ChangePriorityCallback</a>-><a class="code" href="a03470.html#NLMISC_1_1CTaskManager_1_1IChangeTaskPrioritya0">getTaskPriority</a>(*(ite->Task));
00228
00229 <span class="comment">// Next task</span>
00230 ite++;
00231 }
00232 }
00233 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera2" doxytag="NLMISC::CTaskManager::deleteTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLMISC::CTaskManager::deleteTask </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02187.html">IRunnable</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>r</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Delete a task, only if task is not running, return true if found and deleted.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00133">133</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a05646.html#l00993">r</a>.
<p>
<div class="fragment"><pre>00134 {
00135 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00136 <span class="keywordflow">for</span>(<a class="code" href="a03889.html">list<CWaitingTask></a>::iterator it = acces.value().begin(); it != acces.value().end(); it++)
00137 {
00138 <span class="keywordflow">if</span>(it->Task == <a class="code" href="a04223.html#a628">r</a>)
00139 {
00140 acces.value().erase(it);
00141 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00142 }
00143 }
00144 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00145 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera3" doxytag="NLMISC::CTaskManager::dump" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::dump </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< std::string > & </td>
<td class="mdname1" valign="top" nowrap> <em>result</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Dump task list.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00163">163</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00148">_DoneTaskQueue</a>, <a class="el" href="a06486.html#l00146">_RunningTask</a>, <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>.
<p>
<div class="fragment"><pre>00164 {
00165 CSynchronized<string>::CAccessor accesCurrent(&_RunningTask);
00166 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00167 CSynchronized<list<string> >::CAccessor accesDone(&_DoneTaskQueue);
00168
00169 <span class="keyword">const</span> <a class="code" href="a03889.html">list<CWaitingTask></a> &taskList = acces.value();
00170 <span class="keyword">const</span> <a class="code" href="a03889.html">list<string></a> &taskDone = accesDone.value();
00171 <span class="keyword">const</span> string &taskCurrent = accesCurrent.value();
00172
00173 <span class="comment">// Resize the destination array</span>
00174 result.clear ();
00175 result.reserve (taskList.size () + taskDone.size () + 1);
00176
00177 <span class="comment">// Add the waiting strings</span>
00178 <a class="code" href="a03889.html">list<string></a>::const_reverse_iterator iteDone = taskDone.rbegin ();
00179 <span class="keywordflow">while</span> (iteDone != taskDone.rend ())
00180 {
00181 result.push_back (<span class="stringliteral">"Done : "</span> + *iteDone);
00182
00183 <span class="comment">// Next task</span>
00184 iteDone++;
00185 }
00186
00187 <span class="comment">// Add the current string</span>
00188 <span class="keywordflow">if</span> (!taskCurrent.empty())
00189 {
00190 result.push_back (<span class="stringliteral">"Current : "</span> + taskCurrent);
00191 }
00192
00193 <span class="comment">// Add the waiting strings</span>
00194 <a class="code" href="a03889.html">list<CWaitingTask></a>::const_iterator ite = taskList.begin ();
00195 <span class="keywordflow">while</span> (ite != taskList.end ())
00196 {
00197 string name;
00198 ite->Task->getName (name);
00199 result.push_back (<span class="stringliteral">"Waiting : "</span> + name + <span class="stringliteral">" "</span> + <a class="code" href="a05378.html#a244">toString</a>(ite->Priority));
00200
00201 <span class="comment">// Next task</span>
00202 ite++;
00203 }
00204 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1IRunnablePosa0" doxytag="NLMISC::CTaskManager::getName" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void NLMISC::IRunnable::getName </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string & </td>
<td class="mdname1" valign="top" nowrap> <em>result</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, virtual, inherited]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Reimplemented in <a class="el" href="a02220.html#NL3D_1_1CAsyncFileManager3D_1_1CMeshLoada1">NL3D::CAsyncFileManager3D::CMeshLoad</a>, <a class="el" href="a02218.html#NL3D_1_1CAsyncFileManager3D_1_1CIGLoada1">NL3D::CAsyncFileManager3D::CIGLoad</a>, <a class="el" href="a02219.html#NL3D_1_1CAsyncFileManager3D_1_1CIGLoadUsera1">NL3D::CAsyncFileManager3D::CIGLoadUser</a>, <a class="el" href="a02222.html#NL3D_1_1CAsyncFileManager3D_1_1CTextureLoada1">NL3D::CAsyncFileManager3D::CTextureLoad</a>, <a class="el" href="a03752.html#NL3D_1_1CZoneLoadingTaska1">NL3D::CZoneLoadingTask</a>, <a class="el" href="a02593.html#NLPACS_1_1CGlobalRetriever_1_1CLrLoadera1">NLPACS::CGlobalRetriever::CLrLoader</a>, <a class="el" href="a02223.html#NLMISC_1_1CAsyncFileManager_1_1CFileLoada1">NLMISC::CAsyncFileManager::CFileLoad</a>, <a class="el" href="a02224.html#NLMISC_1_1CAsyncFileManager_1_1CMultipleFileLoada1">NLMISC::CAsyncFileManager::CMultipleFileLoad</a>, and <a class="el" href="a02225.html#NLMISC_1_1CAsyncFileManager_1_1CSignala1">NLMISC::CAsyncFileManager::CSignal</a>.
<p>
Definition at line <a class="el" href="a06535.html#l00074">74</a> of file <a class="el" href="a06535.html">thread.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00061">run()</a>.
<p>
<div class="fragment"><pre>00075 {
00076 result = <span class="stringliteral">"NoName"</span>;
00077 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera5" doxytag="NLMISC::CTaskManager::getNumWaitingTasks" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLMISC::CTaskManager::getNumWaitingTasks </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get number of waiting task.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00208">208</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00209 {
00210 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00211 <span class="keywordflow">return</span> acces.value().size();
00212 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera6" doxytag="NLMISC::CTaskManager::isTaskRunning" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLMISC::CTaskManager::isTaskRunning </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Is there a current task ?
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00090">90</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
References <a class="el" href="a06486.html#l00158">_IsTaskRunning</a>.
<p>
<div class="fragment"><pre>00090 {<span class="keywordflow">return</span> <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a>;}
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera7" doxytag="NLMISC::CTaskManager::isThreadRunning" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLMISC::CTaskManager::isThreadRunning </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
return false if exit() is required. task added with <a class="el" href="a02216.html#NLMISC_1_1CTaskManagera0">addTask()</a> should test this flag.
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00081">81</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
References <a class="el" href="a06486.html#l00154">_ThreadRunning</a>.
<p>
<div class="fragment"><pre>00081 {<span class="keywordflow">return</span> <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a>;}
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera8" doxytag="NLMISC::CTaskManager::registerTaskPriorityCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::registerTaskPriorityCallback </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03470.html">IChangeTaskPriority</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>callback</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Register task priority callback.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00237">237</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00108">_ChangePriorityCallback</a>.
<p>
<div class="fragment"><pre>00238 {
00239 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr0">_ChangePriorityCallback</a> = callback;
00240 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera9" doxytag="NLMISC::CTaskManager::run" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::run </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Manage TaskQueue.
<p>
<p>
Implements <a class="el" href="a02187.html#NLMISC_1_1IRunnablePosa1">NLMISC::IRunnable</a>.
<p>
Definition at line <a class="el" href="a06485.html#l00061">61</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00148">_DoneTaskQueue</a>, <a class="el" href="a06486.html#l00158">_IsTaskRunning</a>, <a class="el" href="a06486.html#l00146">_RunningTask</a>, <a class="el" href="a06486.html#l00147">_TaskQueue</a>, <a class="el" href="a06486.html#l00154">_ThreadRunning</a>, <a class="el" href="a06485.html#l00216">changeTaskPriority()</a>, <a class="el" href="a06535.html#l00074">NLMISC::IRunnable::getName()</a>, <a class="el" href="a06485.html#l00032">NLMISC_DONE_TASK_SIZE</a>, <a class="el" href="a02187.html#NLMISC_1_1IRunnablePosa1">NLMISC::IRunnable::run()</a>, <a class="el" href="a06486.html#l00075">sleepTask()</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>.
<p>
<div class="fragment"><pre>00062 {
00063 IRunnable *runnableTask;
00064 <span class="keywordtype">float</span> priorityTask;
00065 <span class="keywordflow">while</span>(<a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a>)
00066 {
00067 {
00068 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00069 <span class="keywordflow">if</span>(acces.value().empty())
00070 {
00071 runnableTask = NULL;
00072 }
00073 <span class="keywordflow">else</span>
00074 {
00075 <span class="comment">// Update task priorities</span>
00076 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerd0">changeTaskPriority</a> ();
00077
00078 <span class="comment">// Get the best task</span>
00079 <a class="code" href="a03889.html">list<CWaitingTask></a> &taskList = acces.value();
00080 <a class="code" href="a03889.html">list<CWaitingTask></a>::iterator ite = taskList.begin();
00081 <a class="code" href="a03889.html">list<CWaitingTask></a>::iterator bestIte = ite;
00082 <span class="keywordflow">while</span> (ite != taskList.end())
00083 {
00084 <span class="keywordflow">if</span> (ite->Priority < bestIte->Priority)
00085 bestIte = ite;
00086
00087 <span class="comment">// Next task;</span>
00088 ite++;
00089 }
00090
00091 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a> = <span class="keyword">true</span>;
00092 runnableTask = bestIte->Task;
00093 priorityTask = bestIte->Priority;
00094 taskList.erase (bestIte);
00095 }
00096 }
00097 <span class="keywordflow">if</span>(runnableTask)
00098 {
00099 {
00100 CSynchronized<string>::CAccessor currentTask(&_RunningTask);
00101 string temp;
00102 runnableTask->getName(temp);
00103 currentTask.value () = temp + <span class="stringliteral">" "</span> + <a class="code" href="a05378.html#a244">toString</a> (priorityTask);
00104 }
00105 runnableTask->run();
00106 {
00107 CSynchronized<string>::CAccessor currentTask(&_RunningTask);
00108 CSynchronized<list<string> >::CAccessor doneTask(&_DoneTaskQueue);
00109 doneTask.value().push_front (currentTask.value ());
00110 currentTask.value () = <span class="stringliteral">""</span>;
00111 <span class="keywordflow">if</span> (doneTask.value().size () > <a class="code" href="a05062.html#a0">NLMISC_DONE_TASK_SIZE</a>)
00112 doneTask.value().resize (NLMISC_DONE_TASK_SIZE);
00113 }
00114
00115 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a> = <span class="keyword">false</span>;
00116 }
00117 <span class="keywordflow">else</span>
00118 {
00119 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagera10">sleepTask</a>();
00120 }
00121 }
00122 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagerp4">_ThreadRunning</a> = <span class="keyword">true</span>;
00123 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera10" doxytag="NLMISC::CTaskManager::sleepTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::sleepTask </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sleep a Task.
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00075">75</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
References <a class="el" href="a05586.html#l00073">NLMISC::nlSleep()</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00061">run()</a>, and <a class="el" href="a06485.html#l00155">waitCurrentTaskToComplete()</a>.
<p>
<div class="fragment"><pre>00075 { <a class="code" href="a05378.html#a256">nlSleep</a>(10); }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagera11" doxytag="NLMISC::CTaskManager::taskListSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLMISC::CTaskManager::taskListSize </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Task list size.
<p>
<p>
Definition at line <a class="el" href="a06485.html#l00148">148</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00147">_TaskQueue</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00149 {
00150 CSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
00151 <span class="keywordflow">return</span> acces.value().size();
00152 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerb0" doxytag="NLMISC::CTaskManager::waitCurrentTaskToComplete" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CTaskManager::waitCurrentTaskToComplete </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
If any, wait the current running task to complete this function MUST be called in a 'accessor to the _TaskQueue' statement because a mutex is required eg: { CSynchronized<list<IRunnable *> >::CAccessor acces(&_TaskQueue); <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerb0">waitCurrentTaskToComplete()</a>; }
<p>
Definition at line <a class="el" href="a06485.html#l00155">155</a> of file <a class="el" href="a06485.html">task_manager.cpp</a>.
<p>
References <a class="el" href="a06486.html#l00158">_IsTaskRunning</a>, and <a class="el" href="a06486.html#l00075">sleepTask()</a>.
<p>
Referenced by <a class="el" href="a05455.html#l00072">NLMISC::CAsyncFileManager::cancelLoadTask()</a>.
<p>
<div class="fragment"><pre>00156 {
00157 <span class="keywordflow">while</span> (<a class="code" href="a02216.html#NLMISC_1_1CTaskManagerr1">_IsTaskRunning</a>)
00158 <a class="code" href="a02216.html#NLMISC_1_1CTaskManagera10">sleepTask</a>();
00159 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLMISC_1_1CTaskManagerr0" doxytag="NLMISC::CTaskManager::_ChangePriorityCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03470.html">IChangeTaskPriority</a>* <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerr0">NLMISC::CTaskManager::_ChangePriorityCallback</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The callback.
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00108">108</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00216">changeTaskPriority()</a>, <a class="el" href="a06485.html#l00039">CTaskManager()</a>, and <a class="el" href="a06485.html#l00237">registerTaskPriorityCallback()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerp0" doxytag="NLMISC::CTaskManager::_DoneTaskQueue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> CSynchronized<std::list<std::string> > <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp0">NLMISC::CTaskManager::_DoneTaskQueue</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00148">148</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00163">dump()</a>, and <a class="el" href="a06485.html#l00061">run()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerr1" doxytag="NLMISC::CTaskManager::_IsTaskRunning" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> volatile bool <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerr1">NLMISC::CTaskManager::_IsTaskRunning</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00158">158</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00039">CTaskManager()</a>, <a class="el" href="a06486.html#l00090">isTaskRunning()</a>, <a class="el" href="a06485.html#l00061">run()</a>, and <a class="el" href="a06485.html#l00155">waitCurrentTaskToComplete()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerp1" doxytag="NLMISC::CTaskManager::_RunningTask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> CSynchronized<std::string> <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp1">NLMISC::CTaskManager::_RunningTask</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
queue of tasks, using list container instead of queue for DeleteTask methode
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00146">146</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00039">CTaskManager()</a>, <a class="el" href="a06485.html#l00163">dump()</a>, and <a class="el" href="a06485.html#l00061">run()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerp2" doxytag="NLMISC::CTaskManager::_TaskQueue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> CSynchronized<std::list<<a class="el" href="a03469.html">CWaitingTask</a>> > <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp2">NLMISC::CTaskManager::_TaskQueue</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00147">147</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00126">addTask()</a>, <a class="el" href="a06485.html#l00216">changeTaskPriority()</a>, <a class="el" href="a06485.html#l00133">deleteTask()</a>, <a class="el" href="a06485.html#l00163">dump()</a>, <a class="el" href="a06485.html#l00208">getNumWaitingTasks()</a>, <a class="el" href="a06485.html#l00061">run()</a>, and <a class="el" href="a06485.html#l00148">taskListSize()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerp3" doxytag="NLMISC::CTaskManager::_Thread" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03880.html">IThread</a>* <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp3">NLMISC::CTaskManager::_Thread</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
thread pointer
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00151">151</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00039">CTaskManager()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CTaskManagerp4" doxytag="NLMISC::CTaskManager::_ThreadRunning" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> volatile bool <a class="el" href="a02216.html#NLMISC_1_1CTaskManagerp4">NLMISC::CTaskManager::_ThreadRunning</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
flag indicate thread loop, if false cause thread exit
<p>
<p>
Definition at line <a class="el" href="a06486.html#l00154">154</a> of file <a class="el" href="a06486.html">task_manager.h</a>.
<p>
Referenced by <a class="el" href="a06485.html#l00039">CTaskManager()</a>, <a class="el" href="a06486.html#l00081">isThreadRunning()</a>, <a class="el" href="a06485.html#l00061">run()</a>, and <a class="el" href="a06485.html#l00053">~CTaskManager()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06486.html">task_manager.h</a><li><a class="el" href="a06485.html">task_manager.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:37:19 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.6 </small></address>
</body>
</html>
|