view include/TaskManager/TaskManager.h @ 292:2369f477ffbe draft

Document/Cerium_2009.mm
author aaa
date Fri, 05 Jun 2009 18:53:42 +0900
parents e6eb4f8d6b0e
children 54725883131b cfd20d609ace
line wrap: on
line source

#ifndef INCLUDED_TASK_MANAGER
#define INCLUDED_TASK_MANAGER

#ifndef INCLUDED_TASK_MANAGER_IMPL
#  include "TaskManagerImpl.h"
#endif

#ifndef INCLUDED_RANDOM
#  include "Random.h"
#endif

class TaskManager {
public:
    /* constructor */
    TaskManager(int num = 1); // The number of threads
    ~TaskManager(void);

    /* variables */
    TaskManagerImpl *m_impl;    
    void (*tm_end)(void);
    RandomPtr gen_random;

    /* user function */
    HTaskPtr create_task(int cmd);
    void run(void);
    void *allocate(int size);
    void set_TMend(void (*endf)(void));
    int get_cpuNum(void);
    int get_random(void);

    /* functions */
    void init(void);
    void finish(void);

private:
    int machineNum;
};

#endif

extern TaskManager *manager;