Mercurial > hg > Members > kono > Cerium
comparison TaskManager/kernel/ppe/TaskListInfo.h @ 801:974cd68383b3
TaslListInfo
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 May 2010 18:20:16 +0900 |
parents | eacbcdb23986 |
children | 8a6f1fa038de |
comparison
equal
deleted
inserted
replaced
800:2708c4a7bade | 801:974cd68383b3 |
---|---|
2 #define INCLUDED_TASK_LIST_INFO | 2 #define INCLUDED_TASK_LIST_INFO |
3 | 3 |
4 #include "types.h" | 4 #include "types.h" |
5 #include "TaskList.h" | 5 #include "TaskList.h" |
6 | 6 |
7 class TaskListInfo { | 7 class TaskListInfo : public TaskList { |
8 public: | 8 public: |
9 /* constructor */ | 9 /* constructor */ |
10 TaskListInfo(void); | 10 TaskListInfo(); |
11 virtual ~TaskListInfo(void); | 11 |
12 BASE_NEW_DELETE(TaskListInfo); | |
12 | 13 |
13 /* functions */ | 14 /* functions */ |
14 int init(int num); | 15 TaskListPtr create(); |
15 TaskListPtr create(void); | |
16 void free(TaskListPtr list); | |
17 static TaskListPtr append(TaskListPtr list, TaskListPtr q); | |
18 virtual int extend_pool(int num); | |
19 TaskListPtr clear_taskList(TaskListPtr list); | |
20 | 16 |
21 static int length(TaskListPtr list); | 17 void free_(TaskListPtr queue); |
22 | 18 |
23 protected: | 19 void addFirst(TaskList* e); |
20 void addLast(TaskList* e); | |
21 TaskList* getFirst(); | |
22 TaskList* getLast(); | |
23 int remove(TaskList* e); | |
24 TaskList* poll(); | |
25 void moveToFirst(TaskList* e); // or use(); | |
26 TaskList* get(int index); | |
27 TaskList* find(TaskList *task); | |
28 int empty(); | |
29 void freePool() ; | |
30 | |
31 // Iterator | |
32 TaskList* getNext(TaskList* q) ; | |
33 int length(); | |
34 | |
35 private: | |
24 /* variables */ | 36 /* variables */ |
25 TaskListPtr taskListPool; | 37 |
26 TaskListPtr freeTaskList; | 38 static TaskListInfo taskListPool; |
39 TaskList* first; | |
40 TaskList* last; | |
27 | 41 |
28 /* functions */ | 42 /* functions */ |
29 void destroy(void); | 43 int extend_pool(int num); |
30 | 44 void destroy(); |
31 private: | |
32 }; | 45 }; |
33 | 46 |
47 typedef TaskListInfo *TaskListInfoPtr; | |
48 | |
34 #endif | 49 #endif |
50 |