Mercurial > hg > Game > Cerium
view TaskManager/kernel/ppe/TaskQueueInfo.h @ 498:bce667ff20b9 draft
double linked HTaskInfo/HTask
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 11 Oct 2009 11:46:41 +0900 |
parents | 67fb962f58fa |
children | 981aa2f89a80 |
line wrap: on
line source
#ifndef INCLUDED_TASK_QUEUE_INFO #define INCLUDED_TASK_QUEUE_INFO #include "Task.h" #include "TaskQueue.h" class TaskQueueInfo : public TaskQueue { public: /* constructor */ TaskQueueInfo(); BASE_NEW_DELETE(TaskQueueInfo); /* functions */ TaskQueuePtr create(Task *task); void free_(TaskQueuePtr queue); void addFirst(TaskQueue* e); void addLast(TaskQueue* e); TaskQueue* getFirst(); TaskQueue* getLast(); int remove(TaskQueue* e); TaskQueue* poll(); void moveToFirst(TaskQueue* e); // or use(); TaskQueue* get(int index); TaskQueue* find(Task *task); int empty(); void freePool() ; // Iterator TaskQueue* getNext(TaskQueue* q) ; int hasNext(TaskQueue* q); private: /* variables */ static TaskQueueInfo taskQueuePool; TaskQueue* first; TaskQueue* last; /* functions */ int extend_pool(int num); void destroy(); }; #endif