view TaskManager/kernel/ppe/TaskQueueInfo.h @ 493:2a7a9f80b8e7 draft

fix free conflict.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 09 Oct 2009 11:29:42 +0900
parents 6b2dda81ea9d
children f1470e379c31
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();
    ~TaskQueueInfo();

    BASE_NEW_DELETE(TaskQueueInfo);

    /* functions */
    int init(int num);
    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();
 
private:
    /* variables */
    TaskQueue* taskQueuePool;
    TaskQueue* freeTaskQueue;

    TaskQueue* first;
    TaskQueue* last;


    /* functions */
    int extend_pool(int num);
    void destroy();  
};

#endif