view include/TaskManager/TaskManager.h @ 247:0098b5ff0d11

change example
author aaa
date Mon, 01 Jun 2009 19:33:09 +0900
parents 401b55a4a4dd
children f8006660a45c 81b25e5d5379
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;