view include/TaskManager/TaskQueueInfo.h @ 107:ce5755f544c1 cvs

Initial revision
author chiaki
date Tue, 04 Mar 2008 18:06:44 +0900
parents 90523ccc4dff
children 028ffc9c0375
line wrap: on
line source

#ifndef INCLUDED_TASK_QUEUE_INFO
#define INCLUDED_TASK_QUEUE_INFO

#ifndef INCLUDED_TASK
#  include "task.h"
#endif

#ifndef INCLUDED_HTASK_INFO
#  include "HTaskInfo.h"
#endif

typedef struct task_queue {
    HTaskPtr task;
    TaskQueuePtr next;
} TaskQueue, *TaskQueuePtr;

class TaskQueueInfo {
public:
    /* constructor */
    TaskQueueInfo(void);
    ~TaskQueueInfo(void);

    /* functions */
    int init(int num);
    TaskQueuePtr create(HTaskPtr task);
    void free(TaskQueuePtr queue);
    static TaskQueuePtr append(TaskQueuePtr list, TaskQueuePtr q);

private:
    /* variables */
    TaskQueuePtr taskQueuePool;
    TaskQueuePtr freeTaskQueue;

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

#endif