Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/HTaskInfo.h @ 499:981aa2f89a80 draft
still fixing...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 11 Oct 2009 15:42:00 +0900 |
parents | bce667ff20b9 |
children | 7ddbe22d4cdb |
rev | line source |
---|---|
46 | 1 #ifndef INCLUDED_HTASK_INFO |
2 #define INCLUDED_HTASK_INFO | |
3 | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
4 #include "Task.h" |
307 | 5 #include "HTask.h" |
46 | 6 |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
7 class HTaskInfo : public HTask { |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
8 |
46 | 9 public: |
10 /* constructor */ | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
11 HTaskInfo(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
12 |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
13 BASE_NEW_DELETE(HTaskInfo); |
46 | 14 |
15 /* functions */ | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
16 HTaskPtr HTaskInfo::create(int cmd); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
17 |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
18 void free_(HTaskPtr queue); |
46 | 19 |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
20 void addFirst(HTask* e); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
21 void addLast(HTask* e); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
22 HTask* getFirst(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
23 HTask* getLast(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
24 int remove(HTask* e); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
25 HTask* poll(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
26 void moveToFirst(HTask* e); // or use(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
27 HTask* get(int index); |
499 | 28 HTask* find(HTask *task); |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
29 int empty(); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
30 void freePool() ; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
31 |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
32 // Iterator |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
33 HTask* getNext(HTask* q) ; |
499 | 34 int length(); |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
35 |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
36 private: |
46 | 37 /* variables */ |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
38 |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
39 static HTaskInfo taskQueuePool; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
40 HTask* first; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
41 HTask* last; |
46 | 42 |
43 /* functions */ | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
44 int extend_pool(int num); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
366
diff
changeset
|
45 void destroy(); |
46 | 46 }; |
47 | |
48 #endif |